ó
j4Vdc           @   sw   d  Z  d d l m Z m Z d d l m Z m Z d Z d „  Z d	 d
 „ Z	 e	 d	 ƒ Z
 e d k rs e	 d ƒ GHn  d S(   s  
Current Fabric version constant plus version pretty-print method.

This functionality is contained in its own module to prevent circular import
problems with ``__init__.py`` (which is loaded by setup.py during installation,
which in turn needs access to this version information.)
iÿÿÿÿ(   t   Popent   PIPE(   t   abspatht   dirnamei   i   i    t   finalc          C   s_   t  t t ƒ ƒ }  y4 t d |  d t d t d t ƒ} | j ƒ  d SWn t k
 rZ d  SXd  S(   Ns)   cd "%s" && git log -1 --format=format:%%ht   shellt   stdoutt   stderri    (	   R   R   t   __file__R    t   TrueR   t   communicatet   OSErrort   None(   t   loct   p(    (    s\   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/version.pyt   git_sha   s    
	t   shortc   
      C   sý  i  } d t  d t  d f } t  d } t  d } | d k } t  d } d j g  | j ƒ  D] } | d ^ q[ ƒ } | | d	 <| }	 | s | r§ |	 d
 t | ƒ 7}	 n  | sÓ |	 | 7}	 | rÓ |	 t | ƒ 7}	 qÓ n  |	 | d <| }	 | r |	 d
 t | ƒ 7}	 n  | s<| r+|	 d | d t | ƒ 7}	 q<|	 d | 7}	 n  |	 | d <| }	 | ri|	 d
 t | ƒ 7}	 n  | s¥| r”|	 d | d t | ƒ 7}	 q¯|	 d | 7}	 n
 |	 d 7}	 |	 | d <y | |  SWn1 t k
 rø|  d k rå| St d |  ƒ ‚ n Xd S(   sÖ  
    Return a version string for this package, based on `VERSION`.

    Takes a single argument, ``form``, which should be one of the following
    strings:

    * ``branch``: just the major + minor, e.g. "0.9", "1.0".
    * ``short`` (default): compact, e.g. "0.9rc1", "0.9.0". For package
      filenames or SCM tag identifiers.
    * ``normal``: human readable, e.g. "0.9", "0.9.1", "0.9 beta 1". For e.g.
      documentation site headers.
    * ``verbose``: like ``normal`` but fully explicit, e.g. "0.9 final". For
      tag commit messages, or anywhere that it's important to remove ambiguity
      between a branch and the first final release within that branch.
    * ``all``: Returns all of the above, as a dict.
    s   %s.%si    i   i   i   R   i   t    t   brancht   .R   t    s    pre-t   normals    finalt   verboset   alls#   "%s" is not a valid form specifier.N(   t   VERSIONt   joint   splitt   strt   KeyErrort	   TypeError(
   t   formt   versionsR   t   tertiaryt   type_R   t   type_numt   xt   firstst   v(    (    s\   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/version.pyt   get_version   sN    


,





t   __main__R   N(   i   i   i    R   i    (   t   __doc__t
   subprocessR    R   t   os.pathR   R   R   R   R&   t   __version__t   __name__(    (    (    s\   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/version.pyt   <module>   s   	F