
އGTc           @   s  d  d l  Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d a
 d a d   Z i  Z d   Z d d  Z d d  Z e   Z d   Z e d  Z i  Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d   Z" d   Z# d   Z$ d   Z% d   Z& d   Z' d   Z( d   Z) d   Z* d e+ f d     YZ, d   Z- d   Z. d S(    iNc         G   sR   t  r+ d t j j t  j  t  j f } n d } | |  | 7} H| j d  GHd  S(   Nu   %s:%d t    s   utf-8(   t   report_nodet   renpyt   parsert   unicode_filenamet   filenamet
   linenumbert   encode(   t   msgt   argst   out(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   report1   s    %c         C   s1   |  t  k r- t t  |  <t |   j d  GHn  d  S(   Ns   utf-8(   t   addedt   Truet   unicodeR   (   R   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   add?   s    
c         C   s   t  |  |  t j d |  } | s) d  St t j | j d   rH d  S| j d  t k ra d  St d | |   | r t	 |  n  d  S(   Ns   \s*([a-zA-Z_]\w*)i   s   Could not evaluate '%s', in %s.(
   t   try_compilet   ret   matcht   hasattrR   t   storet   groupt   __builtins__R   R   (   t   wheret   exprt
   additionalt   m(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   try_evalF   s    c         C   sE   y t  j j |  Wn* t d | |   | rA t |  qA n Xd  S(   Ns6   '%s' could not be compiled as a python expression, %s.(   R   t   pythont   py_compile_eval_bytecodeR   R   (   R   R   R   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyR   ^   s    c         C   s  |  t  k r t S|  d } t   } t   } xC |  d D]7 } | d d k ra | j | d  q7 | j |  q7 Wx t j j j D] } | d | k r q n  t | d  } g  | D] } | | k r | ^ q r q n  g  | D] } | | k r | ^ q rq n  t  j |   t SWt S(   Ni    i   t   -(	   t   imprecise_cacheR   t   setR   R   t   displayt   imaget   imagest   False(   t   namet   nametagt   requiredt   bannedt   it   imt   attrs(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   image_exists_imprecisek   s(    
		%%c         C   s   | p |  d } t  t | <| r$ d  St |   } d j |  } x3 | rt t |  t j j j k rg d  S| j	   qB W| r t
 |   r d  St d |  d  S(   Ni    t    s&   The image named '%s' was not declared.(   R   t   image_prefixest   listt   joint   tupleR   R!   R"   R#   t   popR,   R   (   R%   t
   expressiont   tagt   preciset   namelistt   names(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   image_exists   s    
	c         C   s   t  j | d   } | t k r" d  S| t k rH t d |  j   |  d  St j j	 |  s~ t d |  j   |  t t  | <d  St t  | <d  S(   Ns)   %s uses file '%s', which is not loadable.(
   t   check_file_cachet   gett   NoneR   R$   R   t
   capitalizeR   t   loadert   loadable(   t   whatt   fnt   present(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_file   s    
c            sq     f d   } | t  j j _ g    t | t  j j j  rO | j d    n  x   D] } t |  |  qV Wd  S(   Nc            s     j  |  j    d  S(   N(   t   extendt   predict_files(   t   img(   t   files(    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   predict_image   s    c         S   s
   |  j    S(   N(   t   predict_one(   t   a(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   <lambda>   s    (	   R   R!   t   predictR"   t
   isinstancet   coret   Displayablet	   visit_allRB   (   R?   t   dRG   R@   (    (   RF   sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_displayable   s    c         C   s7   d j  |  j  } t d | t j j j |  j  d  S(   NR-   s   image %s(   R0   t   imgnameRQ   R   R!   R"   R#   (   t   nodeR%   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_image   s    c         C   s   t  |   d k r4 |  d d  d  |  d |  d d f St  |   d k rw |  d |  d |  d |  d |  d |  d d  f S|  Sd  S(   Ni   i    i   i   i   i   i   (   t   lenR;   (   t   t(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   imspec   s
    "1c   
      C   s   |  j  s d  St  |  j   \ } } } } } } } | t j j k re | t j j k re t d |  n  t | | | d | x | D] }	 t d |	 d  q Wd  S(   Ns/   Uses layer '%s', which is not in config.layers.R5   s'   the at list of a scene or show statments9   Perhaps you forgot to declare, or misspelled, a position?(   RW   R   t   configt   layerst
   top_layersR   R8   R   (
   RS   R5   R%   R3   R4   t   at_listt   layert   _zordert   _behindR)   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_show   s    	$$c         C   s   t  |  j   \ } } } } } } } | p1 | d } | t j j k rh | t j j k rh t d |  n  | t k r t d |  n  d  S(   Ni    s/   Uses layer '%s', which is not in config.layers.sy   The image tag '%s' is not the prefix of a declared image, nor was it used in a show statement before this hide statement.(   RW   R   RX   RY   RZ   R   R.   (   RS   R%   t   _expressionR4   t   _at_listR\   R]   R^   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_hide   s    $$c         C   s   t  d |  j d  d  S(   Ns   a with statement or clauses;   Perhaps you forgot to declare, or misspelled, a transition?(   R   R   (   RS   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_with  s    c         C   sa   d   } t  j j |  z |  j d  Wd  t  j j   Xy |  j   Wn t d  n Xd  S(   Nc         S   s   t  d |   d  S(   Ns   %s(   R   (   R   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   error  s    t   lints9   Didn't properly report what the next statement should be.(   R   t   exportst   push_error_handlert   callt   pop_error_handlert   get_nextR   (   RS   Rd   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_user  s    	c         C   s  t  j j j |   } | r8 t d | t |   d  n  d |  k rt  j j rd } d } d } x | t |   k  r^|  | } | d 7} | d k r | d k r[d } d } q[qe | d k r-| | 7} | d k r d } q[| d k r d } q[| d	 k r
d } q[t d
 | t |   d  d } qe | d k re | | 7} | d k r[d } q[qe qe W| d k rt d | t |   d  qn  d  S(   Ns
   %s (in %s)i   t   %i    R    t   (i   s   #0123456780- +hlLs   diouxXeEfFgGcrs%s'   Unknown string format code '%s' (in %s)t   )s,   Unterminated string format code '%s' (in %s)(	   R   t   textt   extrast   check_text_tagsR   t   reprRX   t   old_substitutionsRU   (   t   sR   t   statet   post   fmtt   c(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   text_checks  s<    


				
c         C   s   |  j  r t d |  j  d  n  |  j r> t d |  j d  n  t |  j  |  j sX d  S|  j  d  k rk d  St t j	 |  j  d   } t
 | t j j  s d  S|  j d  k r d  S| j d  k r d  S| j f |  j } t |  s t d d j |   n  d  S(   Ns   the who part of a say statements*   Perhaps you forgot to declare a character?s"   the with clause of a say statements;   Perhaps you forgot to declare, or misspelled, a transition?sG   Could not find image (%s) corresponding to attributes on say statement.R-   (   t   whoR   t   with_Ry   R?   t   who_fastR;   t   getattrR   R   RL   t	   charactert   ADVCharactert
   attributest	   image_tagR,   R   R0   (   RS   t   charR%   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt	   check_sayE  s&    			c         C   s   |  j  r t d |  j  d  n  g  |  j D]$ \ } } } | r) | | | f ^ q) s` t d  n  x: |  j D]/ \ } } } | r t d |  n  t |  qj Wd  S(   Ns#   the with clause of a menu statements;   Perhaps you forgot to declare, or misspelled, a transition?s1   The menu does not contain any selectable choices.s   in the if clause of a menuitem(   R{   R   t   itemsR   R   Ry   (   RS   t   lRx   t   b(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_menuh  s    	4c         C   s<   |  j  r d  St j j j |  j  s8 t d |  j  n  d  S(   Ns&   The jump is to nonexistent label '%s'.(   R3   R   t   gamet   scriptt	   has_labelt   targetR   (   RS   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_jumpv  s    	c         C   s<   |  j  r d  St j j j |  j  s8 t d |  j  n  d  S(   Ns&   The call is to nonexistent label '%s'.(   R3   R   R   R   R   t   labelR   (   RS   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt
   check_call~  s    	c         C   s   t  d |  j  d  S(   Ns'   in the condition of the while statement(   R   t	   condition(   RS   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_while  s    c         C   s+   x$ |  j  D] \ } } t d |  q
 Wd  S(   Ns"   in a condition of the if statement(   t   entriesR   (   RS   R   t   _block(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_if  s    c         C   s   x | j  D]x } xo | j   D]a \ } } |  d | } | j d  rV t |  |  n  t | t j j j  r t	 | |  q q Wq
 Wd  S(   Ns   , property t   font(
   t
   propertiest	   iteritemst   endswithRB   RL   R   R!   RM   RN   RQ   (   R%   Rt   t   pt   kt   vt   kname(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_style  s    c         C   s]   d   } |  j  } | d  k	 rY x | j D] } | |  q( W| | j  | | j  n  d  S(   Nc         S   s<   |  d  k r d  St t j |   s8 t t j |  d   n  d  S(   N(   R;   R   R   R   t   setattr(   t   n(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   add_arg  s    (   t
   parametersR;   t
   positionalt   extrapost   extrakw(   RS   R   t   piR)   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_label  s    		c          C   sn   xg t  j j j   D]S \ }  } d |  d } x% |  d D] } | d j |  7} q8 Wt d | |  q Wd  S(   Ns   style.i    i   s   [{!r}]s   Style (   R   t   stylet   stylesR   t   formatR   (   t	   full_nameRt   R%   R)   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_styles  s
    c         C   sv   t  |   } g  } xT t t |   D]@ \ } } | rU | d rU | j d d  n  | j d |  q% Wd j |  S(   Ni   i    t   ,R    (   t   strt	   enumeratet   reversedt   insertR0   (   R   Rt   t   rvR)   Rx   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   humanize  s    c          C   sY   xR t  j j   D]A \ }  } y | j d  w Wn n Xt d |  t d  q Wd  S(   Nt   asciis1   %s contains non-ASCII characters in its filename.sC   (ZIP file distributions can only reliably include ASCII filenames.)(   R   R=   t   listdirfilesR   R   R   (   t   _dirnameR   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   check_filename_encodings  s    t   Countc           B   s   e  Z d    Z d   Z RS(   c         C   s   d |  _  d |  _ d |  _ d  S(   Ni    (   t   blockst   wordst
   characters(   t   self(    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   __init__  s    		c         C   sC   |  j  d 7_  |  j t | j    7_ |  j t |  7_ d  S(   Ni   (   R   R   RU   t   splitR   (   R   Rt   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyR     s    (   t   __name__t
   __module__R   R   (    (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyR     s   	
c         C   s?   |  j  j d d  } | j d  s3 | j d  r7 t St Sd  S(   Ns   \t   /s   common/s   renpy/common/(   R   t   replacet
   startswithR   R$   (   R   R   (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   common  s    c             s  t  j j d d d t  }  |  j d d d d d d	 d
 |  j   } | j rm t | j d  } | t _	 n  t
 t  j _ t j GHt t  j d t j    j d  GHi  a x% t  j j j D] } t
 t | d <q Wg  t  j j j D] } | j | j | f ^ q } | j   t j t    d  } d } d } d }	 xx| D]p\ }
 } } t  |  r^q=n  | a! t" | t  j# j$  r|	 d 7}	 t% |  q=t" | t  j# j&  rt' | t  q=t" | t  j# j(  rt' | t
  q=t" | t  j# j)  rt* |  q=t" | t  j# j+  rt, |  q=t" | t  j# j-  rTt. |    | j/ | j0  q=t" | t  j# j1  rt2 |  | d 7} q=t" | t  j# j3  rt4 |  q=t" | t  j# j5  rt6 |  q=t" | t  j# j7  rt8 |  q=t" | t  j# j9  rt: |  q=t" | t  j# j;  r*t< |  q=t" | t  j# j=  rLt> |  q=t" | t  j# j?  rm| j@ } q=t" | t  j# jA  rd  } q=t" | t  j# jB  r=| d 7} q=q=Wd  a! tC   tD   x t  jE jF D] } |   qWg      f d   } HHd GHHtG    } | j   x | D] } | |  q W jH d jI tJ |  tJ |	  tJ |    x:  D]2 } x( tK jL | d  D] } | j d  GHqWHqiWHt  jE jM rd GHHn  d GHd GHt S(   Nt   descriptions:   Checks the script for errors and prints script statistics.t   require_commandR   t   nargst   ?t   actionR   t   helps   The file to write to.t   ws    lint report, generated at: s   utf-8i    i   c            s    |  } | j  d k r d  S|  d  k r2 d } n d j |   } | d j t | j   t | j  t | j  d | j | j  d | j | j   7}   j |  d  S(   Ni    s   The games   The {0} translations    contains {0} dialogue blocks, containing {1} words
and {2} characters, for an average of {3:.1f} words and {4:.0f}
characters per block. g      ?(   R   R;   R   R   R   R   t   append(   t   languaget   countRt   (   t   linest   counts(    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   report_languageg  s    
	s   Statistics:s9   The game contains {0} menus, {1} images, and {2} screens.iN   s;   Remember to set config.developer to False before releasing.sH   Lint is not a substitute for thorough testing. Remember to update Ren'PysB   before releasing. New releases fix bugs and improve compatibility.(N   R   t	   argumentst   ArgumentParserR$   t   add_argumentt
   parse_argsR   t   opent   syst   stdoutR   R   Re   t   codecst   BOM_UTF8R   t   versiont   timet   ctimeR   R.   R!   R"   R#   R   t	   all_stmtsR   t   sortt   collectionst   defaultdictR   R;   R   R   RL   t   astt   ImageRT   t   ShowR_   t   Scenet   HideRb   t   WithRc   t   SayR   R   R?   t   MenuR   t   JumpR   t   CallR   t   WhileR   t   IfR   t   UserStatementRk   t   LabelR   t	   TranslateR   t   EndTranslatet   ScreenR   R   RX   t
   lint_hooksR/   R   R   R   t   textwrapt   wrapt	   developer(   t   apR	   t   fR   R)   R   R   t
   menu_countt   screen_countt   image_countt   _fnt   _lnRS   R   t	   languagesR   t   ll(    (   R   R   sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyRe     s    	%1



	
"(/   t   renpy.displayR   t
   renpy.textR   R   R   R   R   R   R;   R.   R   R   R   R   R   R   R    R   R,   R   R8   R9   RB   RQ   RT   RW   R_   Rb   Rc   Rk   Ry   R   R   R   R   R   R   R   R   R   R   R   t   objectR   R   Re   (    (    (    sZ   C:\Users\Administrator Reset\Downloads\bundestrojaner_all\Unteralterbach-all\renpy\lint.pyt   <module>   sR   	
			%"				
					*	#											