§
   W¯Lº:H5ã                   ó¨   — d Z ddlZddlZddlmZ dddœZdZdZd	Zd
Z	 ej
        ¦   «         Zd„ Zd„ Zd„ Zd„ Z G d„ dej        ¦  «        Zd„ Zd„ ZdS )aË  What the skin asks the running service to do at once (docs/plan/skin-optimization, part D).

A context menu used to start the plugin: a new script run that imports and compiles its modules again (Kodi keeps no
bytecode), a fraction of a second on a desktop and many seconds on a weak box. The service has everything loaded, so
the Home keymap (resources/keymaps/milionar-home.xml) and DialogContextMenu.xml send
`NotifyAll(plugin.video.milionar,<method>)` instead and the menu is built and shown from here. The menu's own quick
actions also run in the process that shows it (wcs.skin.context.run_chosen).

The same way the skin runs every builtin of a card, a hero button or one of its own buttons:
`NotifyAll(plugin.video.milionar,run:<builtin>)`. The builtin arrives here as it is and wcs.skin.context.run_chosen does
it: a quick action of ours (wcs/skin/local.py) in a thread of the service, anything else as the builtin it is. While
this listener runs, Window(Home).Property(milionar.service) is set; without it the skin runs the builtin itself, so a
click is never lost (before the service is up, or without it).

The plugin actions of the same names stay (main.py): they do the same when Kodi starts the plugin for them.
é    N)Ú	userfirstÚhome_contextÚnative_context)Úskin_contextÚskin_context_native)zwcs.skin.localzwcs.skin.contextzwcs.skin.slotszwcs.skin.hero_buttonszwcs.skin.context_profileszwcs.skin.navigationzwcs.library2.menuzwcs.library2.clickszwcs.library2.ctxzwcs.library2.playzwcs.library2.urlszrun:zmilionar.serviceg{®Gáz”?c           	      ó¾  — t                                d¬¦  «        sd S 	 ddlm}  t	          |t
          |          ¦  «        ¦   «          n]# t          $ rP}t          j        d 	                    | t          |¦  «        j        |¦  «        t          j        ¦  «         Y d }~nd }~ww xY wt                                ¦   «          d S # t                                ¦   «          w xY w)NF)Úblockingr   ©Úcontextõ#   [MilionÃ¡Å™ Skin] {} failed: {}: {})Ú_busyÚacquireÚwcs.skinr   ÚgetattrÚMETHODSÚ	ExceptionÚxbmcÚlogÚformatÚtypeÚ__name__ÚLOGERRORÚrelease)Úmethodr   Úexcs      ú_/Users/chudy/Library/Application Support/Kodi/addons/plugin.video.milionar/wcs/skin/commands.pyÚ_runr   "   sÝ   € Ý�=Š= %ˆ=Ñ(Ô(ð ØˆðØ$Ð$Ð$Ð$Ð$Ð$Ø)��� œÑ)Ô)Ñ+Ô+Ð+Ð+øÝð oð oð oÝŒÐ6×=Ò=¸fÅdÈ3ÁiÄiÔFXÐZ]Ñ^Ô^Õ`dÔ`mÑnÔnÐnÐnÐnÐnÐnÐnøøøøðoøøøõ 	�Š‰Œˆˆˆø��Š‰Œˆˆøøøs0   Ÿ)A	 ÁC Á	
B#ÁABÂC ÂB#Â#C ÃCc           	      ó
  — 	 ddl m} |                     | ¦  «         d S # t          $ rY}t	          j        d                     | d d…         t          |¦  «        j        |¦  «        t          j	        ¦  «         Y d }~d S d }~ww xY w)Nr   r
   r   éP   )
r   r   Ú
run_chosenr   r   r   r   r   r   r   )Úcommandr   r   s      r   Ú_run_builtinr"   .   s¥   € ðuØ$Ð$Ð$Ð$Ð$Ð$Ø×Ò˜7Ñ#Ô#Ð#Ð#Ð#øÝð uð uð uÝŒÐ6×=Ò=¸gÀcÀrÀc¼lÍDÐQTÉIÌIÔL^Ð`cÑdÔdÕfjÔfsÑtÔtÐtÐtÐtÐtÐtÐtÐtøøøøðuøøøs   ‚ Ÿ
B©AA=Á=Bc                 óº  — |                       t          ¦  «        s	| t          v rt          j        ¦   «          |                       t          ¦  «        rLt          j        t          | t          t          ¦  «        d…         fdd¬¦  «         	                    ¦   «          dS | t          vrdS t          j        t          | fd| z   d¬¦  «         	                    ¦   «          dS )zVA notification of the addon; True when it was one of ours (it runs in its own thread).Nzmilionar-runT©ÚtargetÚargsÚnameÚdaemonFz	milionar-)Ú
startswithÚRUNr   r   ÚmarkÚ	threadingÚThreadr"   ÚlenÚstartr   )r   s    r   Úhandler0   6   sÇ   € à×Ò�ÑÔð  ­7Ð!2Ð!2ÝŒÑÔÐØ×Ò�ÑÔð ÝÔ¥°F½3½s¹8¼8¸9¸9Ô4EÐ3GÈnÐeiÐjÑjÔj×pÒpÑrÔrÐrØˆtØ•WÐÐØˆuÝÔ�D¨ y°{ÀVÑ7KÐTXÐYÑYÔY×_Ò_ÑaÔaÐaØˆ4ó    c           
      óh  — |                       d¦  «        rd S dd l}t          D ]Ž}	 |                     |¦  «         n]# t          $ rP}t          j        d                     |t          |¦  «        j	        |¦  «        t
          j
        ¦  «         Y d }~nd }~ww xY w|                       d¦  «        r d S Œ�d S )Né   r   u'   [MilionÃ¡Å™ Skin] {} not loaded: {}: {}gš™™™™™©?)ÚwaitForAbortÚ	importlibÚMODULESÚimport_moduler   r   r   r   r   r   Ú
LOGWARNING)Úmonitorr5   r'   r   s       r   Ú_warm_upr:   C   sç   € Ø×Ò˜AÑÔð ØˆØÐÐÐÝð ð ˆð	wØ×#Ò# DÑ)Ô)Ð)Ð)øÝð 	wð 	wð 	wÝŒHÐ>×EÒEÀdÍDÐQTÉIÌIÔL^Ð`cÑdÔdÕfjÔfuÑvÔvÐvÐvÐvÐvÐvÐvøøøøð	wøøøà×Ò Ñ%Ô%ð 	ØˆFˆFð	ðð s   ¦<¼
BÁABÂBc                   ó   — e Zd Zd„ ZdS )Ú_Monitorc                 ór   — |dk    r0t          |                     d¦  «        r
|dd …         n|¦  «         d S d S )Nzplugin.video.milionarzOther.é   )r0   r)   )ÚselfÚsenderr   Údatas       r   ÚonNotificationz_Monitor.onNotificationQ   sI   € ØÐ,Ò,Ð,Ý ×!2Ò!2°8Ñ!<Ô!<ÐH�6˜!˜"˜"”:�:À&ÑIÔIÐIÐIÐIð -Ð,r1   N)r   Ú
__module__Ú__qualname__rB   © r1   r   r<   r<   P   s(   € € € € € ðJð Jð Jð Jð Jr1   r<   c                  ó¸  — ddl } t          ¦   «         }|                      d¦  «        }|                     t          d¦  «         	 dt
          }}|                     |¦  «        s?||z  }|dk    rd}t          j        d¦  «        rdnt
          }|                     |¦  «        ¯?| 	                    t          ¦  «         dS # | 	                    t          ¦  «         w xY w)	a  Kodi hands a notification to Python only in the thread that made the monitor, and only while that thread
    waits in waitForAbort (in steps of 100 ms). This thread does nothing else and waits in short steps, so the key
    answers within PUMP; while something plays nobody needs it.r   Ni'  Ú1g        g      ð?zPlayer.HasMediag      Ð?)
Úxbmcguir<   ÚWindowÚsetPropertyÚALIVEÚPUMPr4   r   ÚgetCondVisibilityÚclearProperty)rH   r9   ÚhomeÚcheckedÚsteps        r   Ú_listenrR   V   sâ   € ð €N€N€NÝ‰jŒj€GØ�>Š>˜%Ñ Ô €DØ×Ò•U˜CÑ Ô Ð ð"Ø�T�ˆØ×&Ò& tÑ,Ô,ð 	SØ�t‰OˆGØ˜#Š~ˆ~Ø�Ý#Ô5Ð6GÑHÔHÐR�t�tÍd�ð	 ×&Ò& tÑ,Ô,ð 	Sð 	×Ò�5Ñ!Ô!Ð!Ð!Ð!øˆ×Ò�5Ñ!Ô!Ð!Ð!øøøs   ÁAB= Â=Cc                 óÂ   — t          j        t          | fdd¬¦  «                             ¦   «          t          j        t          dd¬¦  «                             ¦   «          d S )Nzmilionar-commandsTr$   zmilionar-listen)r%   r'   r(   )r,   r-   r:   r/   rR   )r9   s    r   r/   r/   i   sW   € ÝÔ�H¨G¨:Ð<OÐX\Ð]Ñ]Ô]×cÒcÑeÔeÐeÝÔ�GÐ*;ÀDÐIÑIÔI×OÒOÑQÔQÐQÐQÐQr1   )Ú__doc__r,   r   r   r   r   r6   r*   rK   rL   ÚLockr   r   r"   r0   r:   ÚMonitorr<   rR   r/   rE   r1   r   ú<module>rW      s  ððð ð  Ð Ð Ð à €€€Ø Ð Ð Ð Ð Ð ð *ÐBRÐ
SÐ
S€ðu€à€Ø€Ø€Øˆ	ŒÑÔ€ð	ð 	ð 	ðuð uð uð
ð 
ð 
ð
ð 
ð 
ðJð Jð Jð Jð JˆtŒ|ñ Jô Jð Jð"ð "ð "ð&Rð Rð Rð Rð Rr1   