³ò
ÐêqOc           @€  sŸ  d  Z  d d k l Z d d k l Z d d k l Z d d k Z e e e ƒ i	 i
 d d ƒ d d   i d	 d
 ƒ ƒ Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e i f d „  ƒ  YZ d d „ Z d „  Z d „  Z d „  Z e d ƒ d „ Z d d d d d d g Z xm e D]e Z e e ƒ Z e i ƒ  o e i ƒ  n e i ƒ  o e i ƒ  n qe i i  d e! e ƒ ƒ qWd „  Z" d d „ Z# e ƒ  Z$ d S(!   sj   
$Rev: 627 $
$LastChangedBy: satoon101 $
$LastChangedDate: 2012-03-27 18:28:57 -0400 (Tue, 27 Mar 2012) $
iÿÿÿÿ(   t   with_statement(   t   name(   t   pathNt   addonsi   i    s   \t   /t   GunGameErrorc           B€  s   e  Z d  Z RS(   s$   Base Error to use for GunGame errors(   t   __name__t
   __module__t   __doc__(    (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyR      s   t   InfoListc           B€  s   e  Z d  Z d „  Z RS(   sv   Class used to store the keylist and verify that attributes
        that start with "_" do not get added to the keylistc         C€  s.   | i  d ƒ p t t |  ƒ i | ƒ n d S(   s\   Verify that the item does not start with
            "_" when adding the item to the keylistt   _N(   t
   startswitht   superR	   t   append(   t   selft   item(    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyR   (   s    (   R   R   R   R   (    (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyR	   $   s   t   _GunGameInfoc           B€  s&   e  Z d  Z d „  Z e d „  ƒ Z RS(   s/   Class used to store the AddonInfo for GunGame51c         C€  s   t  ƒ  |  _ t ƒ  |  _ d S(   s%   Called on initialization of the classN(   R	   t   keylistt   get_versiont   _version(   R   (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyt   __init__6   s    c         C€  s   |  i  S(   s.   Property that returns the version of GunGame51(   R   (   R   (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyt   version?   s    (   R   R   R   R   t   propertyR   (    (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyR   3   s   		c         C€  s4   |  o) t  |  ƒ i d d ƒ }  t i |  ƒ Sn t S(   sá   !Gets an absolute path to a game directory.

    @remark Implicitly replaces \ with / (linux support)

    @param dir Directory to append to the game directory.

    @return An absolute path to the game directory plus \p dir.s   \R   (   t   strt   replacet	   game_patht   joinpath(   t   folder(    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyt   get_game_dirJ   s    c           C€  s   t  S(   N(   t   os_name(    (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyt   get_osX   s    c           C€  s   t  t i d ƒ ƒ d j S(   s‹   !Checks to see if the server is currently in a map.

    @retval True The server is in a map.
    @retval False The server is not in a map.t   eventscripts_currentmapt    (   R   t   est	   ServerVar(    (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyt   in_map\   s    c         C€  s"   |  i  d d ƒ }  |  i  d d ƒ S(   Ns   \rR    s   \n(   R   (   t   text(    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyt   remove_return_charsd   s    s   addons/eventscriptsc         c€  s   xx t  |  ƒ i ƒ  D]d } d | j o q n t | ƒ i d d ƒ g  } | i d ƒ D] } | t | i ƒ qV ~ g Vq Wd S(   s"  
    Generator that returns a list of files from within the gungame51 directory
    recursively.

    returns something like this:
    ['c:/srcds/cstrike/addons/eventscripts/gungame51',
        ['core', 'gungame51.py', 'scripts', '__init__.py']]

    (Excluding svn folders and files.)
    t	   gungame51s   \R   s   *.pyN(   R   t   walkdirsR   R   t   filesR   (   t   topR   t   _[1]t   x(    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyt   get_file_listi   s     sD   addons/eventscripts/gungame51/core/events/data/es_gungame_events.ress?   addons/eventscripts/gungame51/scripts/included/gg_error_loggings8   addons/eventscripts/gungame51/scripts/included/gg_thankss9   cfg/gungame51/included_addon_configs/gg_error_logging.cfgs2   cfg/gungame51/included_addon_configs/gg_thanks.cfgs#   cfg/gungame51/gg_default_addons.cfgs   echo [GunGame] Deleted %sc      	   C€  s	  |  d j o t  i Sn |  d j o0 t  i d t d ƒ ƒ t  i d t d ƒ ƒ n |  d j o£ d d k l } g  } | D]G } | | i |  j o- | d d | | i i | | i i f q} q} ~ } | p d d d Sn | i	 d d ƒ d i
 | ƒ Sn d S(   sF   
    Fetches the head revision number from all of gungame's files
    R   t   updates   Included Addonst   includeds   Custom Addonst   customiÿÿÿÿ(   t   LoadedAddonss   	i   s	   %s (v%s)
s   
s   None
i    t    N(   R.   R/   s   				s   				(   t   GunGameInfoR   t   __setattr__t   gungame_infot   addons.loadedR0   t
   addon_typet   infoR   t   insertt   join(   R7   R0   R*   t   addont	   addonlist(    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyR4   ›   s    Tc      
   C€  sñ   d } |  d j o t d ƒ } n t d |  ƒ } x³ | i d ƒ D]¢ } d | i ƒ  j o qC n yu | i ƒ  i } i ƒ  } z6 | ~ } t | i ƒ  i	 d ƒ d i	 ƒ  d ƒ } Wd | ~ QX| | j o
 | } n WqC qC qC XqC Wd	 | S(
   s3   Function used to get the current version of GunGamei    s   addons/eventscripts/gungame51s1   addons/eventscripts/gungame51/scripts/included/%ss   *.pyR/   s   $Rev: i   Ns   5.1.%s(
   t   NoneR   t	   walkfilest   splitallt   opent   __exit__t	   __enter__t   intt   readt   split(   R:   t   revisiont   basepatht	   file_pathR*   t   _[2]t   pyfileR   (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pyR   È   s"     %5iÿÿÿÿ(%   R   t
   __future__R    t   osR   R   R   R!   t   __file__t   parentt   rsplitR   R   t	   ExceptionR   t   listR	   t	   AddonInfoR   R<   R   R   R#   R%   R,   t	   old_filest   old_filet   isfilet   removet   isdirt   rmtreet   servert   queuecmdR   R4   R   R2   (    (    (    sQ   /home/saberrider/srcds/css/cstrike/addons/eventscripts/gungame51/core/__init__.pys   <module>   s@   /				 	-/