ó
ø7Tc           @@  sä  d  Z  d d l m 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 d l
 m Z y
 e Z Wn e k
 r e Z n Xd e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e j f d „  ƒ  YZ d e f d „  ƒ  YZ e j d i d d 6e j ƒ Z e j d ƒ Z e j d ƒ Z e j d ƒ Z e j d ƒ Z e j d e j ƒ Z e j d e j ƒ Z e j d e j ƒ Z e j d e j ƒ Z  e j d e j ƒ Z! e j d ƒ Z" e j d ƒ Z# e j d ƒ Z$ e j d e j ƒ Z% e j d e j ƒ Z& e j d  ƒ Z' e j d! ƒ Z( e j d" e j ƒ Z) e j d# e j ƒ Z* e j d$ e j ƒ Z+ e j d% e j ƒ Z, e j d& e j ƒ Z- e j d' ƒ Z. d( e f d) „  ƒ  YZ/ d* „  Z0 d S(+   sA   This module implements facilities to deal with Debian changelogs.i    (   t   absolute_importN(   t   debian_supportt   ChangelogParseErrorc           B@  s&   e  Z d  Z e Z d „  Z d „  Z RS(   s0   Indicates that the changelog could not be parsedc         C@  s   | |  _  d  S(   N(   t   _line(   t   selft   line(    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   __init__2   s    c         C@  s   d |  j  S(   Ns   Could not parse changelog: (   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   __str__5   s    (   t   __name__t
   __module__t   __doc__t   Truet   is_user_errorR   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   .   s   	t   ChangelogCreateErrorc           B@  s   e  Z d  Z RS(   s`   Indicates that changelog could not be created, as all the information
    required was not given(   R   R	   R
   (    (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   8   s   t   VersionErrorc           B@  s&   e  Z d  Z e Z d „  Z d „  Z RS(   sB   Indicates that the version does not conform to the required formatc         C@  s   | |  _  d  S(   N(   t   _version(   R   t   version(    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   A   s    c         C@  s   d |  j  S(   Ns   Could not parse version: (   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   D   s    (   R   R	   R
   R   R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   <   s   	t   Versionc           B@  s   e  Z d  Z RS(   s)   Represents a version of a Debian package.(   R   R	   R
   (    (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   I   s   t   ChangeBlockc           B@  sÚ   e  Z d  Z d d d d d d d d d d d „
 Z d „  Z d „  Z e e e ƒ Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z e d
 „  ƒ Z e d „  ƒ Z d „  Z e j d k rÉ e Z d „  Z n e Z d „  Z RS(   s=   Holds all the information about one block from the changelog.s   utf-8c         C@  s˜   d  |  _ |  j | ƒ | |  _ | |  _ | p1 d |  _ | p@ d |  _ | |  _ | |  _ | |  _	 g  |  _
 |	 ps i  |  _ |
 |  _ t |  _ d |  _ d  S(   Nt   unknownt    s     (   t   Nonet   _raw_versiont   _set_versiont   packaget   distributionst   urgencyt   urgency_commentt   _changest   authort   datet	   _trailingt   other_pairst	   _encodingt   Falset   _no_trailert   _trailer_separator(   R   R   R   R   R   R   t   changesR   R   R    t   encoding(    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   P   s    									c         C@  s"   | d  k	 r t | ƒ |  _ n  d  S(   N(   R   t   strR   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   b   s    c         C@  s   t  |  j ƒ S(   N(   R   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   _get_versionf   s    c         C@  sw   i  } xj t  j ƒ  D]\ \ } } | d j ƒ  | d j ƒ  } t j | ƒ } | d  k re d | } n  | | | <q W| S(   Ni    i   s   XS-%s(   R    t   itemst   uppert   lowert   xbcs_ret   matchR   (   R   t	   norm_dictt   keyt   valuet   m(    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   other_keys_normalisedk   s    c         C@  s   |  j  S(   N(   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR%   u   s    c         C@  s   |  j  j | ƒ d  S(   N(   R   t   append(   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   add_trailing_linex   s    c         C@  sº   |  j  d  k r | g |  _  n˜ |  j  } | j ƒ  t } xS t t | ƒ ƒ D]? } t j | | ƒ } | d  k rJ | j | | ƒ t	 } PqJ qJ W| j ƒ  | s­ | j
 | ƒ n  | |  _  d  S(   N(   R   R   t   reverseR"   t   ranget   lent	   blanklineR-   t   insertR   R3   (   R   t   changeR%   t   addedt   iR1   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt
   add_change{   s    	

c         C@  s‡   t  j d ƒ j |  j ƒ } g  } x_ | j | ƒ D]N } | j d ƒ } x6 t j d | ƒ D]" } | j t | j d ƒ ƒ ƒ qY Wq1 W| S(   Nt    i    s   \d+(	   t   sixt   ut   joinR   t   finditert   groupt   reR3   t   int(   R   t   type_reR%   t   bugsR-   t   closes_list(    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   _get_bugs_closed_generic   s    $c         C@  s   |  j  t ƒ S(   N(   RI   t   closes(   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   bugs_closed˜   s    c         C@  s   |  j  t ƒ S(   N(   RI   t   closeslp(   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   lp_bugs_closedœ   s    c         C@  sâ  d } |  j  d  k r$ t d ƒ ‚ n  | |  j  d 7} |  j d  k rS t d ƒ ‚ n  | d |  j d 7} |  j d  k r† t d ƒ ‚ n  | |  j d 7} |  j d  k rµ t d	 ƒ ‚ n  | d
 |  j |  j 7} x1 |  j j ƒ  D]  \ } } | d | | f 7} qÝ W| d 7} |  j	 ƒ  d  k r,t d ƒ ‚ n  x" |  j	 ƒ  D] } | | d 7} q9W|  j
 s¼|  j d  k rxt d ƒ ‚ n  |  j d  k r–t d ƒ ‚ n  | d |  j |  j |  j d 7} n  x |  j D] } | | d 7} qÆW| S(   NR   s   Package not specifiedR>   s   Version not specifiedt   (s   ) s   Distribution not specifieds   ; s   Urgency not specifieds   urgency=s   , %s=%ss   
s   Changes not specifieds   Author not specifieds   Date not specifieds    -- (   R   R   R   R   R   R   R   R    R)   R%   R#   R   R   R$   R   (   R   t   blockR/   R0   R:   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   _format    s<    
	#t   3c         C@  s   t  |  ƒ j |  j ƒ S(   N(   R'   t   encodeR!   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt	   __bytes__Ä   s    c         C@  s   t  |  ƒ j |  j ƒ S(   N(   t   unicodeRR   R!   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   É   s    N(   R   R	   R
   R   R   R   R(   t   propertyR   R2   R%   R4   R=   RI   RK   RM   RP   t   sysR   RS   t   __unicode__(    (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   M   s(   					
						!s?   ^(\w%(name_chars)s*) \(([^\(\) \t]+)\)((\s+%(name_chars)s+)+)\;s   [-+0-9a-z.]t
   name_charss   ^\s*$s	   ^\s\s+.*$sm   ^ -- (.*) <(.*)>(  ?)((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\(\)]\))?\s*)$sr   ^ --(?: (.*) <(.*)>(  ?)((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\(\)]\))?))?\s*$s   ^([-0-9a-z]+)=\s*(.*\S)$s   ^([-0-9a-z]+)((\s+.*)?)$s	   ^X[BCS]+-s   ^(;;\s*)?Local variables:s   ^vim:s   ^\$\w+:.*\$s   ^\# s	   ^/\*.*\*/s5   closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*s   lp:\s+\#\d+(?:,\s*\#\d+)*sW   ^(\w+\s+\w+\s+\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}\s+[\w\s]*\d{4})\s+(.*)\s+(<|\()(.*)(\)|>)s:   ^(\w+\s+\w+\s+\d{1,2},?\s*\d{4})\s+(.*)\s+(<|\()(.*)(\)|>)s%   ^(\w[-+0-9a-z.]*) \(([^\(\) 	]+)\)\;?s"   ^([\w.+-]+)(-| )(\S+) Debian (\S+)s#   ^Changes from version (.*) to (.*):s$   ^Changes for [\w.+-]+-[\w.+-]+:?\s*$s   ^Old Changelog:\s*$s   ^(?:\d+:)?\w[\w.+~-]*:?\s*$t	   Changelogc           B@  sÓ  e  Z d  Z d% d% e e d d „ Z d „  Z d% e e d% d „ Z d „  Z	 d „  Z
 e e	 e
 d d ƒZ e d	 „  ƒ Z e d
 „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z d „  Z d „  Z e e e d d ƒZ d „  Z e e d d ƒZ d „  Z d „  Z e j d k r)e Z d „  Z n e Z d „  Z d „  Z d „  Z d „  Z e d „  e ƒ Z  d „  Z! e d „  e! ƒ Z" d „  Z# d „  Z$ e d  „  e$ ƒ Z% d! „  Z& e d" „  e& ƒ Z' d# „  Z( d$ „  Z) RS(&   s#   Represents a debian/changelog file.s   utf-8c         C@  se   | |  _  g  |  _ g  |  _ | d k	 ra y# |  j | d | d | d | ƒWqa t k
 r] qa Xn  d S(   s£  Initializer.

        Args:
          file: The contents of the changelog, either as a str, unicode object,
              or an iterator of lines (each of which is either a str or unicode)
          max_blocks: The maximum number of blocks to parse from the input.
              (Default: no limit)
          allow_empty_author: Whether to allow an empty author in the trailer
              line of a change block.  (Default: False)
          strict: Whether to raise an exception if there are errors.  (Default:
              use a warning)
          encoding: If the input is a str or iterator of str, the encoding to
              use when interpreting the input.
        t
   max_blockst   allow_empty_authort   strictN(   R!   t   _blockst   initial_blank_linesR   t   parse_changelogR   (   R   t   fileRZ   R[   R\   R&   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR   ÷   s    			c         C@  s&   | r t  | ƒ ‚ n t j | ƒ d  S(   N(   R   t   warningst   warn(   R   t   messageR\   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   _parse_error  s    c   #      C@  s¦  d } d } d } d }	 d }
 | p* |  j  } | d  k rM |  j d | ƒ d  Sg  |  _ g  |  _ t d | ƒ } g  } | } d  } t | t ƒ r¡ | j | ƒ } n  t | t	 j
 ƒ rî t | j ƒ  ƒ d k rß |  j d | ƒ d  S| j ƒ  } n  xH| D]@} t | t	 j ƒ s| j | ƒ } n  | j d	 ƒ } | | k sF| | k r¥t j | ƒ } t j | ƒ } | d  k	 rG| d  k	 r•t |  j ƒ | k r•d  S| j d
 ƒ | _ | j d ƒ | _ | j d ƒ j ƒ  | _ | j d d
 ƒ d
 } i  } i  } x?| j d ƒ D].} | j ƒ  } t j | ƒ } | d  k rJ|  j d | | ƒ qn  | j d
 ƒ } | j d ƒ } | j ƒ  | k r—|  j d | j ƒ  | ƒ n  | | | j ƒ  <| j ƒ  d k r't j | ƒ } | d  k rë|  j d | | ƒ q1| j d
 ƒ | _ | j d ƒ } | d  k	 r1| | _ q1q| | | <qW| | _ | } q5| d  k	 r‰| | k rr|  j j | ƒ q¢|  j d j  | ƒ q5t! j | ƒ } t" j | ƒ } t# j | ƒ } t$ j | ƒ } t% j | ƒ } | d  k	 sì| d  k	 r| | k r|  j d j  | ƒ | } |
 } qõ n  | d  k	 sB| d  k	 sB| d  k	 r{| | k ra|  j j | ƒ qõ |  j d j  | ƒ qõ n  t& j | ƒ d  k	 s#t' j | ƒ d  k	 s#t( j | ƒ d  k	 s#t) j | ƒ d  k	 s#t* j | ƒ d  k	 s#t+ j | ƒ d  k	 s#t, j | ƒ d  k	 s#t- j | ƒ d  k	 rU| | k rU|  j d j  | ƒ | } |
 } qõ n  |  j d | | f | ƒ | | k rŽ|  j j | ƒ q5|  j d j  | ƒ qõ | | k s½| |	 k ràt. j | ƒ }  t/ j | ƒ }! t0 j | ƒ }" t j | ƒ } |  d  k	 r| j | ƒ |	 } q5|! d  k	 rÓ|! j d ƒ d k re|  j d | | ƒ |! j d ƒ | _1 n  d |! j d
 ƒ |! j d ƒ f | _2 |! j d ƒ | _3 | | _4 |  j j | ƒ g  } t d | ƒ } | } q5|" d  k	 r6| sÿ|  j d | | ƒ qõ n  | | _4 |  j j | ƒ g  } t d | ƒ } | } q5| d  k	 rR| j | ƒ q5t# j | ƒ } t$ j | ƒ } t% j | ƒ } | d  k	 s£| d  k	 s£| d  k	 r¶| j | ƒ qõ n  |  j d | | f | ƒ | j | ƒ qõ | |
 k r| | k r|  j d j  | ƒ q5| j | ƒ qõ t5 sõ t6 d | ƒ ‚ qõ W| | k rQ| |
 k si| |
 k r¢| | k r¢|  j d | | ƒ | | _4 t7 | _8 |  j j | ƒ n  d  S(   Ns   first headings   next heading of EOFs   start of change datas   more change data or trailers   slurp to ends   Empty changelog file.R&   i    s   
i   i   i   t   ;t   ,s$   Invalid key-value pair after ';': %ss   Repeated key-value: %sR   s!   Badly formatted urgency value: %siÿÿÿÿs(   Unexpected line while looking for %s: %ss     s    Badly formatted trailer line: %ss   %s <%s>i   s   Unknown state: %ss   Found eof where expected %s(9   R!   R   Rd   R]   R^   R   t
   isinstancet   bytest   decodeR?   t   string_typesR7   t   stript
   splitlinest	   text_typet   rstript   toplineR-   R8   RC   R   R   t   lstripR   t   splitt   keyvalueR+   t   value_reR   R   R    R3   R4   t   emacs_variablest   vim_variablest   cvs_keywordt   commentst   more_commentst   old_format_re1t   old_format_re2t   old_format_re3t   old_format_re4t   old_format_re5t   old_format_re6t   old_format_re7t   old_format_re8R:   t   endlinet   endline_nodetailsR$   R   R   R   R"   t   AssertionErrorR   R#   (#   R   R`   RZ   R[   R\   R&   t   first_headingt   next_heading_or_eoft   start_of_change_datat   more_changes_or_trailert   slurp_to_endt   current_blockR%   t   statet	   old_stateR   t	   top_matcht   blank_matcht   pairst   all_keysR    t   pairt   kv_matchR/   R0   t	   val_matcht   commentt   emacs_matcht	   vim_matcht	   cvs_matcht   comments_matcht   more_comments_matcht   change_matcht	   end_matcht   end_no_details_match(    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR_     s>   										"								c         C@  s   |  j  d j S(   s,   Return a Version object for the last versioni    (   R]   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   get_versionÏ  s    c         C@  s   t  | ƒ |  j d _ d S(   sw   Set the version of the last changelog block

        version can be a full version string, or a Version object
        i    N(   R   R]   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   set_versionÓ  s    t   docs'   Version object for last changelog blockc         C@  s
   |  j  j S(   N(   R   t   full_version(   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   <lambda>Þ  s    c         C@  s
   |  j  j S(   N(   R   t   epoch(   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR    ß  s    c         C@  s
   |  j  j S(   N(   R   t   debian_revision(   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR    à  s    c         C@  s
   |  j  j S(   N(   R   R¢   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR    á  s    c         C@  s
   |  j  j S(   N(   R   t   upstream_version(   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR    â  s    c         C@  s   |  j  d j S(   s4   Returns the name of the package in the last version.i    (   R]   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   get_packageä  s    c         C@  s   | |  j  d _ d  S(   Ni    (   R]   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   set_packageè  s    s'   Name of the package in the last versionc         C@  s   g  |  j  D] } | j ^ q
 S(   s@   Returns a list of version objects that the package went through.(   R]   R   (   R   RO   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   get_versionsî  s    s0   List of version objects the package went throughc         C@  s   g  |  j  D] } | j ^ q
 S(   N(   R]   R   (   R   RO   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   _raw_versionsõ  s    c         C@  sh   g  } | j  t j d ƒ j |  j ƒ ƒ x' |  j D] } | j  t j | ƒ ƒ q2 Wt j d ƒ j | ƒ S(   Ns   
R   (   R3   R?   R@   RA   R^   R]   Rm   (   R   t   piecesRO   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyRP   ø  s
    "RQ   c         C@  s   t  |  ƒ j |  j ƒ S(   N(   R'   RR   R!   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyRS     s    c         C@  s   t  |  ƒ j |  j ƒ S(   N(   RT   RR   R!   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR     s    c         C@  s   t  |  j ƒ S(   N(   t   iterR]   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   __iter__
  s    c         C@  s   t  |  j ƒ S(   N(   R7   R]   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   __len__  s    c         C@  s   | |  j  d _ d  S(   Ni    (   R]   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   set_distributions  s    c         C@  s   |  j  d j S(   Ni    (   R]   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR      s    c         C@  s   | |  j  d _ d  S(   Ni    (   R]   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   set_urgency  s    c         C@  s   |  j  d j S(   Ni    (   R]   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR      s    c         C@  s   |  j  d j | ƒ d  S(   Ni    (   R]   R=   (   R   R:   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR=     s    c         C@  s   | |  j  d _ d  S(   Ni    (   R]   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt
   set_author  s    c         C@  s   |  j  d j S(   Ni    (   R]   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR      s    c         C@  s   | |  j  d _ d  S(   Ni    (   R]   R   (   R   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   set_date   s    c         C@  s   |  j  d j S(   Ni    (   R]   R   (   R   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyR    "  s    c         K@  sC   | j  d |  j ƒ t |   } | j d ƒ |  j j d | ƒ d  S(   NR&   R   i    (   t
   setdefaultR!   R   R4   R]   R9   (   R   t   kwargsRO   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt	   new_block$  s    c         C@  s   | j  |  j ƒ  ƒ d  S(   N(   t   writeR   (   R   R`   (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   write_to_open_file*  s    N(*   R   R	   R
   R   R"   R   R   Rd   R_   Rœ   R   RU   R   RŸ   R¡   t   debian_versionR¢   R£   R¤   R¥   R   R¦   t   versionsR§   RP   RV   R   RS   RW   Rª   R«   R¬   R   R­   R   R=   R®   R   R¯   R   R²   R´   (    (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyRY   ó   sV   	¶																						c          C@  sa  t  j }  t j d ƒ } d |  k rx | j |  d ƒ } | rx d |  k r_ | j d ƒ |  d <n  | j d ƒ |  d <qx n  d |  k s d |  k ró d |  k ró | j |  d ƒ } | rð d |  k r× | j d ƒ |  d <n  | j d ƒ |  d <qð qó n  d |  k r|  d } nd d |  k r%|  d } nK y+ t j d d	 t j t  j	 ƒ  ƒ j
 ƒ } Wn t t f k
 rod } n Xd |  k r‰|  d } nÎ d |  k r¢|  d } nµ d } t  j j d
 ƒ rít d
 ƒ } z | j ƒ  j ƒ  } Wd | j ƒ  Xn  | st j ƒ  } n  | rBt j t  j	 ƒ  ƒ j } | s/d } qBd | | f } n  | rQ| } n d } | | f S(   sù  Get the maintainer information in the same manner as dch.

    This function gets the information about the current user for
    the maintainer field using environment variables of gecos
    informations as approriate.

    It uses the same methods as dch to get the information, namely
    DEBEMAIL, DEBFULLNAME, EMAIL, NAME, /etc/mailname and gecos.

    :returns: a tuple of the full name, email pair as strings.
        Either of the pair may be None if that value couldn't
        be determined.
    s   ^(.*)\s+<(.*)>$t   DEBEMAILt   DEBFULLNAMEi   i   t   EMAILt   NAMEs   ,.*R   s   /etc/mailnameNs   %s@%s(   t   ost   environRD   t   compileR-   RC   t   subt   pwdt   getpwuidt   getuidt   pw_gecost   KeyErrort   AttributeErrorR   t   patht   existst   opent   readlineRk   t   closet   sockett   getfqdnt   pw_name(   t   envt   regext	   match_objt
   maintainert   emailt   addrt   ft   user(    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   get_maintainer.  sX    	+
		(1   R
   t
   __future__R    R»   R¿   RD   RÊ   Ra   RV   R?   t   debianR   t   StandardErrort   _base_exception_classt	   NameErrort	   ExceptionR   R   R   R   t   objectR   R½   t
   IGNORECASERo   R8   R:   R   R‚   Rr   Rs   R,   Rt   Ru   Rv   Rw   Rx   RJ   RL   Ry   Rz   R{   R|   R}   R~   R   R€   RY   RÕ   (    (    (    s4   /usr/lib/python2.7/dist-packages/debian/changelog.pyt   <module>   sf   


						ÿ <