§
   æ˜X�Ã=Xã                   ó    — d Z ddlZddlZddlZddlZddlZddlmZ ddlm	Z	 dZ
dddd	d
dddddddœZdZdZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )a:  Temporary timing lines in kodi.log for docs/plan/skin-optimization; remove with that plan's last step.

`log()` writes one line with the prefix PREFIX at LOGINFO, so it is there without Kodi's debug logging.

The probe thread watches Home and does not care how the rows get their cards (plugin call, static items, items bound
by the service): it only counts, per section, the rows whose list has at least one card.

  focus <sec>                      another menu item got the focus
  cards <sec> <k>/<n>              the number of that section's rows with cards changed (n = its configured rows)

Normally only the section on screen is watched. With the file `perf_watch` in the addon's profile directory (written
by scripts/skin_harness/measure.py) every section that is not switched off is watched, also in the background.
é    N)Úfamily)ÚWIDGET_SLOTSu   [DEBUG][MilionÃ¡Å™ Perf] )Úforyoui }  ÚHomeMenuNoMilForYouButton)ÚcontiÀ]  ÚHomeMenuNoMilContinueButton)Ú	my_moviesiHq  ÚHomeMenuNoMilMyMoviesButton)Ú	my_seriesi0u  ÚHomeMenuNoMilMySeriesButton)ÚmytviðU  ÚHomeMenuNoMilMyTVButton)Úvinyliy  ÚHomeMenuNoMilVinylButton)ÚmycinemaiØY  ÚHomeMenuNoMilMyCinemaButton)Úgamei¨a  ÚHomeMenuNoMilGameButton)Úaii�e  ÚHomeMenuNoMilAIButton)Úkraskaixi  ÚHomeMenuNoMilKraskaButton)Útmdbi`m  ÚHomeMenuNoMilTMDbButton)Ú
mil_foryouÚmil_continueÚmil_mymoviesÚmil_myseriesÚmil_mytvÚ	mil_vinylÚmil_mycinemaÚmil_gameÚmil_aiÚ
mil_kraskaÚmil_tmdbgš™™™™™©?g      @z=special://profile/addon_data/plugin.video.milionar/perf_watchc                 óT   — t          j        t          | z   t           j        ¦  «         d S )N)ÚxbmcÚlogÚPREFIXÚLOGINFO)Úmessages    ú^/Users/chudy/Library/Application Support/Kodi/addons/plugin.video.milionar/wcs/skin/perflog.pyr(   r(   *   s!   € Ý„H�V�gÑ�tœ|Ñ,Ô,Ð,Ð,Ð,ó    c                 óÖ   — g }t          dt          dz   ¦  «        D ]M}t          j        d                     | |¦  «        ¦  «        }|r!|dk    r|                     ||dz  z   ¦  «         ŒN|S )z*List ids of the section's configured rows.é   zSkin.String(mil.{}.{}.type)Úofféd   )Úranger   r'   ÚgetInfoLabelÚformatÚappend)ÚsectionÚbaseÚresultÚnumberÚrows        r,   Ú_slotsr;   .   sw   € à€FÝ˜�<¨!Ñ+Ñ,Ô,ð /ð /ˆÝÔÐ =× DÒ DÀWÈfÑ UÔ UÑVÔVˆØð 	/�3˜%’<�<Ø�MŠM˜$ ¨#¡Ñ-Ñ.Ô.Ð.øØ€Mr-   c                  óH   — d„ t                                ¦   «         D ¦   «         S )zH{section: list ids} of the sections whose menu item is not switched off.c                 ó†   — i | ]>\  }}}t          j        d                      |¦  «        ¦  «        °-|t          ||¦  «        “Œ?S )zSkin.HasSetting({}))r'   ÚgetCondVisibilityr4   r;   )Ú.0r6   r7   Úflags       r,   ú
<dictcomp>z"_configuration.<locals>.<dictcomp>:   s`   € ð Oð Oð OÑ/B¨w¸¸dÝÔ)Ð*?×*FÒ*FÀtÑ*LÔ*LÑMÔMðOˆG•V˜G TÑ*Ô*ð Oð Oð Or-   )ÚMENUSÚvalues© r-   r,   Ú_configurationrE   8   s0   € ðOð OÅeÇlÂlÁnÄnð Oñ Oô Oð Or-   c                 óº   — d}| D ]U}t          j        d                     |¦  «        ¦  «        }|                     ¦   «         rt	          |¦  «        dk    r|dz  }ŒV|S )Nr   zContainer({}).NumItemsr/   )r'   r3   r4   ÚisdigitÚint)ÚidsÚcountÚlist_idÚvalues       r,   Ú_with_cardsrM   >   sb   € Ø€EØð ð ˆÝÔ!Ð":×"AÒ"AÀ'Ñ"JÔ"JÑKÔKˆØ�=Š=‰?Œ?ð 	�s 5™zœz¨Aš~˜~Ø�Q‰JˆEøØ€Lr-   c           	      ó   — t           j                             t          j        t
          ¦  «        ¦  «        }t          d                     |rdnd¦  «        ¦  «         d„ t           	                    ¦   «         D ¦   «         }i d}}d i d}}}|  
                    |rt          nd¦  «        �sUt          j        ¦   «         ot          j        d¦  «        }|sd }ŒKt!          j        ¦   «         }||z
  t$          k    rt'          ¦   «         |}}|                     t          j        d	¦  «        ¦  «        }	|	|k    r&|	}|	r"t          d
                     |	¦  «        ¦  «         |r|n||v r|gng D ]v}
||
         }t-          |¦  «        t/          |¦  «        f}|                     |
¦  «        |k    r5|||
<   t          d                     |
|d         |d         ¦  «        ¦  «         Œw|  
                    |rt          nd¦  «        �¯Sd S d S )Nzprobe started ({})zall sectionszthe section on screenc                 ó&   — i | ]\  }}||d          “ŒS )r   rD   )r?   ÚmenurC   s      r,   rA   z_probe.<locals>.<dictcomp>J   s"   € ÐAÐAÐA¡< 4¨ˆt�V˜A”YÐAÐAÐAr-   g        Fg      Ð?zWindow.IsActive(home)z%Container(9000).ListItem.Property(id)zfocus {}zcards {} {}/{}r   r/   )ÚosÚpathÚexistsÚxbmcvfsÚtranslatePathÚ
WATCH_FLAGr(   r4   rB   ÚitemsÚwaitForAbortÚPOLLr   Úactiver'   r>   ÚtimeÚ	monotonicÚCONFIG_EVERYrE   Úgetr3   rM   Úlen)ÚmonitorÚ	watch_allÚby_menuÚsectionsÚread_atÚfocusedÚcountsrZ   Únowr6   ÚnamerI   rL   s                r,   Ú_proberi   G   s  € Ý”—’�wÔ4µZÑ@Ô@ÑAÔA€IÝÐ×#Ò#°iÐ$\ N NÐE\Ñ]Ô]Ñ^Ô^Ð^ØAÐAµ5·;²;±=´=ÐAÑAÔA€GØ˜Cˆg€HØ" B¨�VˆV€GØ×"Ò"¨6Ð#;¥4 4°tÑ<Ô<ñ GÝ”‘”ÐT¥TÔ%;Ð<SÑ%TÔ%TˆØð 	ØˆGØÝŒnÑÔˆØ�‰=�LÒ(Ð(Ý .Ñ 0Ô 0°#�gˆHØ—+’+�dÔ/Ð0WÑXÔXÑYÔYˆØ�gÒÐØˆGØð 0Ý�J×%Ò% gÑ.Ô.Ñ/Ô/Ð/Ø!*ÐX�X�X¸WÈÐ=PÐ=P°°	°	ÐVXð 	Gð 	GˆDØ˜4”.ˆCÝ  Ñ%Ô%¥s¨3¡x¤xÐ0ˆEØ�zŠz˜$ÑÔ 5Ò(Ð(Ø$��t‘ÝÐ$×+Ò+¨D°%¸´(¸EÀ!¼HÑEÔEÑFÔFÐFøð% ×"Ò"¨6Ð#;¥4 4°tÑ<Ô<ñ Gð Gð Gð Gð Gr-   c           	      óð   — 	 t          | ¦  «         d S # t          $ rX}t          j        t          d                     t          |¦  «        j        |¦  «        z   t          j        ¦  «         Y d }~d S d }~ww xY w)Nzprobe stopped: {}: {})	ri   Ú	Exceptionr'   r(   r)   r4   ÚtypeÚ__name__Ú
LOGWARNING)r`   Úexcs     r,   Ú_guardedrp   b   s�   € ðdÝˆw‰ŒˆˆˆøÝð dð dð dÝŒ•Ð1×8Ò8½¸c¹¼Ô9KÈSÑQÔQÑQÕSWÔSbÑcÔcÐcÐcÐcÐcÐcÐcÐcøøøøðdøøøs   ‚ “
A5�AA0Á0A5c                 óf   — t          j        t          | fdd¬¦  «                             ¦   «          d S )Nzmilionar-perfT)ÚtargetÚargsrh   Údaemon)Ú	threadingÚThreadrp   Ústart)r`   s    r,   rw   rw   i   s1   € ÝÔ�H¨G¨:¸OÐTXÐYÑYÔY×_Ò_ÑaÔaÐaÐaÐar-   )Ú__doc__rQ   ru   r[   r'   rT   Úwcs.skinr   Úwcs.skin.hero_contractr   r)   rB   rY   r]   rV   r(   r;   rE   rM   ri   rp   rw   rD   r-   r,   ú<module>r{      s+  ððð ð 
€	€	€	Ø Ð Ð Ð Ø €€€à €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø /Ð /Ð /Ð /Ð /Ð /à	$€àEØGØLØLØ?ØBØKØ?Ø9ØEØ?ð
	Að 
	A€ð €Ø€ØL€
ð-ð -ð -ðð ð ðOð Oð Oðð ð ðGð Gð Gð6dð dð dðbð bð bð bð br-   