l
 ¸çNc               @   sÎ   d Z  d d l Z d  a d  a i  Z d	 „  Z d
 „  Z d „  Z	 d! d „ Z d! d „ Z d  d „ Z i d d 6d d 6d" d 6d# d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d  d 6d „ Z d S($   u   pathsu   modulesu   checku   enableu   disableu	   reset_allu   module_bl_infoi    Nc              C   sB   t  j j d ƒ }  |  t  j j d ƒ 7}  |  t  j j d ƒ 7}  |  S(   Nu   addonsu   addons_contribu   addons_extern(   u   _bpyu   utilsu   script_paths(   u   paths(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   paths'   s    c          	      sÈ  d d  l  ‰  d a d a t ƒ  } d d  ‡  f d † } t |  j ƒ  ƒ } x9| D]1} | j	 d ƒ ss | j	 d ƒ r| d } n d  } xû t
 j j | ƒ D]ç \ } } | | h 8} |  j | ƒ } | rE| j | k rò t d | j | f ƒ d a qE| j ˆ  j j | ƒ k rEt d | | j ˆ  j j | ƒ | ƒ |  | =d  } qEn  | d  k r• | | | d | ƒ} | r|| |  | <q|q• q• WqO Wx | D] }	 |  |	 =q‹W~ t |  j ƒ  ƒ }
 |
 j d	 d
 „  ƒ |
 S(   Ni    c                s  t  j j r t d | |  ƒ n  d d  l } t | ƒ } t | d d d ƒ} | r’g  } t | ƒ } d }	 xŽ |	 j d ƒ sú y | j	 ƒ  }	 WnR t
 k
 rà }
 z2 t sÀ d a t d | |
 ƒ n  | j ƒ  d  SWYd  d  }
 ~
 Xn Xt |	 ƒ d k rm Pqm qm Wx‚ |	 j ƒ  r| j |	 ƒ y | j	 ƒ  }	 Wqþ t
 k
 r{}
 z2 t s[d a t d | |
 ƒ n  | j ƒ  d  SWYd  d  }
 ~
 Xqþ Xqþ Wd j | ƒ } n | j ƒ  } | j ƒ  y | j | d	 | ƒ} Wn2 t d
 | ƒ d d  l } | j ƒ  d  } Yn Xd  } | roxj | j D]\ } | j | j k rt | j ƒ d k rht | j d d d ƒ d k re| } PqeqhqqWn  | r
yC | |  ƒ } | j | j ƒ | _ | | _ ˆ  j  j! | ƒ | _" Wn/ t d |  ƒ d d  l } | j ƒ  ‚  Yn X| d  k	 r| | j d <n  | Sd  Sd  S(   Nu   fake_modulei    u   ru   encodingu   UTF-8u    u   bl_infou   Error reading file as UTF-8:u   filenameu&   Syntax error 'ast.parse' can't read %ri   u   idu   AST error in module %su   supportT(#   u   _bpyu   appu   debugu   printu   astu   typeu   openu   iteru
   startswithu   readlineu   UnicodeDecodeErroru   error_encodingu   Trueu   closeu   Noneu   lenu   rstripu   appendu   joinu   readu   parseu	   tracebacku	   print_excu   bodyu	   __class__u   Assignu   targetsu   getattru   literal_evalu   valueu   bl_infou   __file__u   pathu   getmtimeu   __time__(   u   mod_nameu   mod_pathu   speedyu   force_supportu   astu
   ModuleTypeu   file_modu   linesu	   line_iteru   lu   eu   datau   ast_datau	   tracebacku	   body_infou   bodyu   mod(   u   os(    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   fake_moduleA   s~    



	
u   addons_contribu   addons_externu   TESTINGu-   multiple addons with the same name:
  %r
  %ru   reloading addon:u   force_supportu   keyc             S   s   |  j  d |  j  d f S(   Nu   categoryu   name(   u   bl_info(   u   mod(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   <lambda>º   s   
FT(   u   osu   Falseu   error_duplicatesu   error_encodingu   pathsu   Trueu   Noneu   setu   keysu   endswithu   _bpyu   pathu   module_namesu   getu   __file__u   printu   __time__u   getmtimeu   listu   valuesu   sort(   u   module_cacheu	   path_listu   fake_moduleu   modules_staleu   pathu   force_supportu   mod_nameu   mod_pathu   modu	   mod_staleu   mod_list(    (   u   osu`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   modules6   sL    	O			c             C   sŠ   d d l  } |  t j j j k } | j j |  ƒ } | oH t | d t ƒ } | t k r€ t	 d |  t | d d ƒ f ƒ d } n  | | f S(   uÑ   
    Returns the loaded state of the addon.

    :arg module_name: The name of the addon and module.
    :type module_name: string
    :return: (loaded_default, loaded_state)
    :rtype: tuple of booleans
    i    Nu   __addon_enabled__up   Warning: addon-module %r found module but without __addon_enabled__ field, possible name collision from file: %ru   __file__u	   <unknown>F(   u   sysu   _bpyu   contextu   user_preferencesu   addonsu   modulesu   getu   getattru   Ellipsisu   printu   False(   u   module_nameu   sysu   loaded_defaultu   modu   loaded_state(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   checkÀ   s    		c       
      C   sÒ  d d l  } d d l } d d l } d „  } | j j |  ƒ } | ré | j j | j ƒ ré d | _	 t
 | d d ƒ } | j j | j ƒ } | | k ré t d | j d ƒ y | j | ƒ Wn | ƒ  | j |  =d SYn Xd | _	 qé n  y1 t |  ƒ } | j j | j ƒ | _ d | _	 Wn | ƒ  d SYn Xy | j ƒ  Wn | ƒ  | j |  =d SYn X| r¦t j j j j |  ƒ }	 |	 s¦t j j j j ƒ  }	 |  |	 _ q¦n  d	 | _	 t j j rÎt d | j ƒ n  | S(
   uÀ   
    Enables an addon by name.

    :arg module_name: The name of the addon and module.
    :type module_name: string
    :return: the loaded module or None on failure.
    :rtype: module
    i    Nc              S   s   d d  l  }  |  j ƒ  d  S(   Ni    (   u	   tracebacku	   print_exc(   u	   traceback(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   handle_errorè   s    u   __time__u   module changed on disk:u   reloading...u   	addon_utils.enableFT(   u   osu   sysu   impu   modulesu   getu   pathu   existsu   __file__u   Falseu   __addon_enabled__u   getattru   getmtimeu   printu   reloadu   Noneu
   __import__u   __time__u   registeru   _bpyu   contextu   user_preferencesu   addonsu   newu   moduleu   Trueu   appu   debugu   __name__(
   u   module_nameu   default_setu   osu   sysu   impu   handle_erroru   modu
   mtime_origu	   mtime_newu   ext(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   enableÚ   sP    
		
		
		c          	   C   sß   d d l  } | j j |  ƒ } | r_ d | _ y | j ƒ  Wqo d d l } | j ƒ  Yqo Xn t d |  d ƒ t	 j
 j j } | r¿ x8 |  | k r» | j |  ƒ } | r‡ | j | ƒ q‡ q‡ Wn  t	 j j rÛ t d |  ƒ n  d S(   u{   
    Disables an addon by name.

    :arg module_name: The name of the addon and module.
    :type module_name: string
    i    Nu   addon_utils.disableu
   not loadedu   	addon_utils.disableF(   u   sysu   modulesu   getu   Falseu   __addon_enabled__u
   unregisteru	   tracebacku	   print_excu   printu   _bpyu   contextu   user_preferencesu   addonsu   removeu   appu   debug(   u   module_nameu   default_setu   sysu   modu	   tracebacku   addonsu   addon(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   disable%  s$    	c       
      C   sî   d d l  } d d l } t ƒ  } xÆ | D]¾ } t j j | ƒ x¥ t j j | ƒ D]‘ \ } } t | ƒ \ } } |  r  | j	 j
 | ƒ }	 |	 r  | j |	 ƒ q  n  | | k r¯ qQ | rÂ t | ƒ qQ | rQ t d | ƒ t | ƒ qQ qQ Wq( Wd S(   u=   
    Sets the addon state based on the user preferences.
    i    Nu    	addon_utils.reset_all unloading(   u   sysu   impu   pathsu   _bpyu   utilsu   _sys_path_ensureu   pathu   module_namesu   checku   modulesu   getu   reloadu   enableu   printu   disable(
   u   reload_scriptsu   sysu   impu
   paths_listu   pathu   mod_nameu   mod_pathu
   is_enabledu	   is_loadedu   mod(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu	   reset_allJ  s$    	u    u   nameu   authoru   versionu   blenderu   apiu   locationu   descriptionu   wiki_urlu   tracker_urlu	   COMMUNITYu   supportu   categoryu   warningu   show_expandedc             C   s‰   t  |  d i  ƒ } d | k r" | S| s4 | |  _ n  x* | j ƒ  D] \ } } | j | | ƒ qA W| d s{ |  j | d <n  d  | d <| S(   Nu   bl_infou   _initu   name(   u   getattru   bl_infou   itemsu
   setdefaultu   __name__u   None(   u   modu
   info_basisu
   addon_infou   keyu   value(    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   module_bl_infoh  s    

(   u   pathsu   modulesu   checku   enableu   disableu	   reset_allu   module_bl_infoFT(    (    (   u   __all__u   bpyu   _bpyu   Falseu   error_duplicatesu   error_encodingu   addons_fake_modulesu   pathsu   modulesu   checku   Trueu   enableu   disableu	   reset_allu   module_bl_info(    (    (    u`   I:\Didattica\Lezioni\Software\blender-2.61-release-windows32\2.61\scripts\modules\addon_utils.pyu   <module>   s:         		Š	K%
