ó
’3Rc           @   s<   d  Z  d d l Z d d l m Z d e f d „  ƒ  YZ d S(   s   Git commit class and helpersiÿÿÿÿN(   t   GitErrort	   GitCommitc           B   s,   e  Z d  Z e j d ƒ Z e d „  ƒ Z RS(   s   A git commits   [0-9a-f]{40}$c         C   s   t  j j |  ƒ r t St S(   s  
        Is I{value} a valid 40 digit SHA1?

        >>> GitCommit.is_sha1('asdf')
        False
        >>> GitCommit.is_sha1('deadbeef')
        False
        >>> GitCommit.is_sha1('17975594b2d42f2a3d144a9678fdf2c2c1dd96a0')
        True
        >>> GitCommit.is_sha1('17975594b2d42f2a3d144a9678fdf2c2c1dd96a0toolong')
        False

        @param value: the value to check
        @type value: C{str}
        @return: C{True} if I{value} is a 40 digit SHA1, C{False} otherwise.
        @rtype: C{bool}
        (   R   t   sha1_ret   matcht   Truet   False(   t   value(    (    s2   /usr/lib/python2.7/dist-packages/gbp/git/commit.pyt   is_sha1   s    (   t   __name__t
   __module__t   __doc__t   ret   compileR   t   staticmethodR   (    (    (    s2   /usr/lib/python2.7/dist-packages/gbp/git/commit.pyR      s   (   R
   R   t   gbp.git.errorsR    t   objectR   (    (    (    s2   /usr/lib/python2.7/dist-packages/gbp/git/commit.pyt   <module>   s   