³ò
Íª*Ic        
   @   sC  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d d2 d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ	 d
 e f d „  ƒ  YZ
 d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d  e f d! „  ƒ  YZ d" e f d# „  ƒ  YZ h  e d$ <e	 d% <e
 d& <e d' <e d( <e d) <e d* <e d+ <e d, <e d- <e d. <e d/ <e d0 <e d1 <Z d S(3   iÿÿÿÿNt   Commandc           B   sª   e  Z d  „  Z d „  Z e i d „  ƒ Z e i d „  ƒ Z e i d „  ƒ Z e i d „  ƒ Z	 e i d „  ƒ Z
 e i d „  ƒ Z e i d „  ƒ Z e i d	 „  ƒ Z RS(
   c         C   s1   | |  _  | |  _ | |  _ d  |  _ d  |  _ d  S(   N(   t
   connectiont	   action_idt   command_paramst   Nonet   runnert   log(   t   selfR   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt   __init__   s
    					c         C   s   | |  _  |  i  i |  _ d  S(   N(   R   R   (   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt
   set_runner*   s    	c         C   sp   t  |  i ƒ } |  i d j o | d j o d  SqP n |  i | j o d  Sn t i d |  i | f ƒ ‚ d  S(   Nt   manyi   s   %d != %d(   t   lenR   t   expected_paramst   signage_exceptionst   InvalidCommandParameters(   R   t
   num_params(    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt   check_params/   s    c         G   s   t  i ƒ  ‚ d  S(   N(   t   player_presentation_errorst   NotImplementedException(   R   t   args(    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt   run_cmd;   s    c         C   sÝ  y |  i  ƒ  |  i |  i Œ  Wn¸t i j
 oD x* t i ƒ  i ƒ  D] } |  i i	 | ƒ qE W|  i
 d d ƒ ngt i j
 oL } x* t i ƒ  i ƒ  D] } |  i i	 | ƒ q™ W|  i d t | ƒ ƒ nt i j
 oL } x* t i ƒ  i ƒ  D] } |  i i	 | ƒ qó W|  i
 d t | ƒ ƒ n³ t i j
 oL } x* t i ƒ  i ƒ  D] } |  i i	 | ƒ qMW|  i
 d t | ƒ ƒ nY t j
 oL } x* t i ƒ  i ƒ  D] } |  i i	 | ƒ q¤W|  i
 d t | ƒ ƒ n Xd  S(   Nt   formatR   t   nomediat   versiont   version2t    (   R   R   R   R   R   t	   tracebackt
   format_exct
   splitlinesR   t   debugt   send_fatal_responseR   t   IllegalArgumentExceptiont   send_failed_responset   strt   VersionErrort   Version2Errort	   Exception(   R   t   linet   err(    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt   run@   s8    
     c         G   s#   |  i  i t i |  i | ƒ ƒ d  S(   N(   R   t   sendResponset   player_protocol_definitiont   MSG_EncodeFailedResponseR   (   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR    [   s    	c         G   s#   |  i  i t i |  i | ƒ ƒ d  S(   N(   R   R(   R)   t   MSG_EncodeFatalResponseR   (   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   b   s    	c         G   s#   |  i  i t i |  i | ƒ ƒ d  S(   N(   R   R(   R)   t   MSG_EncodeFlushedResponseR   (   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt   send_flushed_responseh   s    	c         G   s#   |  i  i t i |  i | ƒ ƒ d  S(   N(   R   R(   R)   t   MSG_EncodeStartedResponseR   (   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt   send_started_responseo   s    	c         G   s#   |  i  i t i |  i | ƒ ƒ d  S(   N(   R   R(   R)   t   MSG_EncodeSucceededResponseR   (   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyt   send_successful_responsev   s    	(   t   __name__t
   __module__R   R	   t   player_presentation_utilst
   log_methodR   R   R'   R    R   R-   R/   R1   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR       s   		t   ImmediateCommandc           B   s   e  Z RS(    (   R2   R3   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR6   ~   s   t   Capsc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   sl   x. |  i  i D]  } |  i | |  i  i | Œ q Wx* |  i  i i ƒ  D] } |  i d | ƒ qD W|  i ƒ  d  S(   Nt   property(   R   t   capsR/   t
   propertiest   get_supported_propertiesR1   (   R   t   capt   prop(    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   ‰   s      (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR7   „   s   t   Delayc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i   c         C   s‚   y t  | ƒ } Wn" t j
 o t i d ƒ ‚ n Xx< | d j o. |  i i d  j	 o t i d ƒ | d 8} q8 W|  i	 ƒ  d  S(   Ns   not an integeri    i   (
   t   intt
   ValueErrorR   R   R   t   running_mediaR   t   timet   sleepR1   (   R   t
   delay_timet   counter(    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   ˜   s      (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR>   “   s   t   Flushc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   sr   x4 |  i  i i ƒ  p  |  i  i i ƒ  } | i ƒ  q W|  i  i d  j	 o |  i  i i d t ƒ n |  i	 ƒ  d  S(   Nt   flushed(
   R   t   queuet   emptyt   getR-   RA   R   t   stopt   TrueR1   (   R   t   command(    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   ­   s     (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRF   ¨   s   t   Hidec           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s!   |  i  i i t ƒ |  i ƒ  d  S(   N(   R   t   oot   set_visiblet   FalseR1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   ½   s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRN   ¸   s   t   Initc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s   |  i  i ƒ  |  i ƒ  d  S(   N(   R   t   start_ooR1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   É   s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRR   Ä   s   t   NoOpc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s   d  S(   N(    (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   Õ   s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRT   Ð   s   t   Pollc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s   |  i  ƒ  d  S(   N(   R1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   à   s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRU   Û   s   t   Propertyc           B   s    e  Z d  Z e i d „  ƒ Z RS(   R
   c      	   G   sŽ   y |  i  i i | } Wn" t j
 o t i d ƒ ‚ n Xy | |  i  i | Œ Wn* t j
 o } t i t | ƒ ƒ ‚ n X|  i ƒ  d  S(   NR   (	   R   R:   t   set_methodst   KeyErrorR   R   t	   TypeErrorR!   R1   (   R   R=   R   t   funcR&   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   ë   s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRV   æ   s   t   Quitc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s   |  i  i ƒ  |  i ƒ  d  S(   N(   R   RK   R1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR     s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR[   ü   s   t   Startc           B   s>   e  Z d  Z d „  Z e i d „  ƒ Z e i e d „ ƒ Z RS(   i   c         G   s&   t  i |  | Œ d  |  _ t |  _ d  S(   N(   R    R   R   t   presentationRQ   t   stopped(   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR     s    	c         C   sE  |  i  i d  j	 o |  i  i i ƒ  n |  |  i  _ | i d ƒ p t i | ƒ ‚ n d | d f } | GH|  i  i i | ƒ |  _	 |  i	 i
 d t ƒ |  i  i i ƒ  |  i	 i ƒ  x. |  i o" |  i	 i ƒ  o t i d ƒ q· W|  i	 i ƒ  } |  i  i i ƒ  \ } } |  i  i i d | ƒ } | i ƒ  i | ƒ |  i ƒ  d  S(   Ns   file:s7   file:///home/credativ/UK/projects/onelan/chris-tests/%si   t   IsFullScreeni   t   AutomaticAdvancement(   R   RA   R   RK   t
   startswithR   R   RO   t   get_presentationR]   t   setPropertyValueRQ   RP   t   startR^   t	   isRunningRB   RC   t   getControllerR:   t
   get_timingt   makePropertyValuet   getSlideShowt   setPropertyR/   (   R   t   targett   urlt
   controllert
   slide_timet   effect_timet   slide_advance(    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR     s*     	c         C   sY   t  |  _ |  i d  j	 o |  i i ƒ  n | o |  i ƒ  n |  i ƒ  d  |  i _ d  S(   N(	   RL   R^   R]   R   t   endR-   R1   R   RA   (   R   RG   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRK   C  s    	
(	   R2   R3   R   R   R4   R5   R   RQ   RK   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR\     s
   	-t   Stopc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s5   |  i  i d  j	 o |  i  i i ƒ  n |  i ƒ  d  S(   N(   R   RA   R   RK   R1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   Z  s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRr   U  s   t   Versionc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i   c         C   s…   |  i  i d  j	 o* |  i  i | j o t i d ƒ ‚ qw n; | |  i  i d j o | |  i  _ n t i d | ƒ ‚ |  i ƒ  d  S(   NR   R   s   %s not supported(   R   R   R   R   R#   R9   R"   R1   (   R   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   g  s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRs   b  s   t   Waitc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   sž   |  i  i d  j o |  i d g ƒ d  Sn x" |  i  i ƒ  o t i d ƒ q. W|  i i |  i  i i	 ƒ |  i  i d  j	 o |  i  i i
 ƒ  n |  i ƒ  d  S(   Ns   No media currently playingi   (   R   RA   R   R   t   media_is_runningRB   RC   R   R   R]   RK   R1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   }  s     (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRt   x  s   t   ZToFrontc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s   |  i  i i ƒ  |  i ƒ  d  S(   N(   R   RO   t   to_frontR1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR     s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRv   ‹  s   t   ZToBackc           B   s    e  Z d  Z e i d „  ƒ Z RS(   i    c         C   s   |  i  i i ƒ  |  i ƒ  d  S(   N(   R   RO   t   to_backR1   (   R   (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyR   œ  s    (   R2   R3   R   R4   R5   R   (    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pyRx   —  s   R9   t   delayt   flusht   hidet   initt   pollR8   t   quitRd   RK   R   t   waitt	   z_to_backt
   z_to_front(    (   RB   R   R   R)   R   R4   R    R6   R7   R>   RF   RN   RR   RT   RU   RV   R[   R\   Rr   Rs   Rt   Rv   Rx   t   command_registry(    (    (    sI   /home/credativ/UK/projects/onelan/pyplayer/player_presentation_command.pys   <module>   sJ   rM													
