Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/debian/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/debian/changelog.pyc


}Nc@sjdZddlZddlZddlZddlZddlZddlZdefdYZdefdYZ	defdYZ
d	ejfd
YZdefdYZ
ejd
idd6ejZejdZejdZejdZejdZejdejZejdejZejdejZejdejZejdejZejdZejdZejdZejdZejdZejdejZejdejZ ejd ejZ!ejd!ejZ"ejd"ejZ#ejd#Z$d$efd%YZ%d&Z&dS('sAThis module implements facilities to deal with Debian changelogs.iNtChangelogParseErrorcBs&eZdZeZdZdZRS(s0Indicates that the changelog could not be parsedcCs
||_dS(N(t_line(tselftline((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__init__&scCsd|jS(NsCould not parse changelog: (R(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__str__)s(t__name__t
__module__t__doc__tTruet
is_user_errorRR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR"s	tChangelogCreateErrorcBseZdZRS(s`Indicates that changelog could not be created, as all the information
    required was not given(RRR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR,stVersionErrorcBs&eZdZeZdZdZRS(sBIndicates that the version does not conform to the required formatcCs
||_dS(N(t_version(Rtversion((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR5scCsd|jS(NsCould not parse version: (R
(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR8s(RRRR	R
RR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR0s	tVersioncBseZdZRS(s)Represents a version of a Debian package.(RRR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR=stChangeBlockcBseZdZddddddddddd
ZdZdZeeeZdZ	dZ
dZdZd	Z
d
ZRS(s=Holds all the information about one block from the changelog.sutf-8cCsd|_|j|||_||_|p1d|_|p@d|_||_||_||_	g|_
|	psi|_|
|_t
|_d|_dS(Ntunknownts  (tNonet_raw_versiont_set_versiontpackaget
distributionsturgencyturgency_commentt_changestauthortdatet	_trailingtother_pairst	_encodingtFalset_no_trailert_trailer_separator(RRRRRRtchangesRRRtencoding((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRDs	
								cCs"|dk	rt||_ndS(N(RtstrR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRVscCs
t|jS(N(RR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt_get_versionZscCswi}xjtjD]\\}}|dj|dj}tj|}|dkred|}n|||<qW|S(NiisXS-%s(Rtitemstuppertlowertxbcs_retmatchR(Rt	norm_dicttkeytvaluetm((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytother_keys_normalised_s
cCs|jS(N(R(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR#iscCs|jj|dS(N(Rtappend(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytadd_trailing_linelscCs|jdkr|g|_n|j}|jt}xStt|D]?}tj||}|dkrJ|j||t	}PqJqJW|j|s|j
|n||_dS(N(RRtreverseR trangetlent	blanklineR+tinsertR	R1(RtchangeR#taddedtiR/((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt
add_changeos	

cCsd}|jdkr$tdn||jd7}|jdkrStdn|d|jd7}|jdkrtdn||jd7}|jdkrtd	n|d
|j|j7}x1|jjD] \}}|d||f7}qW|d7}|j	dkr,td
nx"|j	D]}||d7}q9W|j
s|jdkrxtdn|jdkrtdn|d|j|j
|jd7}nx|jD]}||d7}qW|S(NRsPackage not specifiedt sVersion not specifiedt(s) sDistribution not specifieds; sUrgency not specifiedsurgency=s, %s=%ss
sChanges not specifiedsAuthor not specifiedsDate not specifieds -- (RRRRRRRRR'R#R!RRR"R(RtblockR-R.R8R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__unicode__s<
	#cCst|j|jS(N(tunicodetencodeR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRsN(RRRRRRR&tpropertyRR0R#R2R;R?R(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRAs					
				!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	^/\*.*\*/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	ChangelogcBseZdZd#d#eeddZdZd#eed#dZdZ	dZ
ee	e
ddZed	Z
ed
ZedZedZed
ZdZdZeeeddZdZeeddZdZdZdZdZdZdZedeZdZedeZdZ dZ!ede!Z"dZ#ed e#Z$d!Z%d"Z&RS($s#Represents a debian/changelog file.sutf-8cCse||_g|_g|_|dk	ray#|j|d|d|d|Wqatk
r]qaXndS(sInitializer.

        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_blockstallow_empty_authortstrictN(Rt_blockstinitial_blank_linesRtparse_changelogR(RtfileRERFRGR$((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRs			
cCs&|rt|n
tj|dS(N(Rtwarningstwarn(RtmessageRG((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt_parse_errorsc#Csd}d}d}d}	d}
|p*|j}|dkrM|jd|dSg|_g|_td|}g}|}
d}t|trt|j	dkr|jd|dS|j
}nxE|D]=}t|ts|j|}n|j
d	}|
|ks|
|kr~tj|}tj|}|dk	r |dk	rnt|j|krndS|jd
|_|jd|_|jdj|_|jd
d
d
}i}i}x?|jdD].}|j	}tj|}|dkr#|jd||qn|jd
}|jd}|j|krp|jd|j|n|||j<|jdkrtj|}|dkr|jd||q
|jd
|_|jd}|dk	r
||_q
q|||<qW||_|}
q|dk	rb|
|krK|jj|q{|jdj|qtj|}t j|}t!j|}t"j|}t#j|}|dk	s|dk	r|
|kr|jdj||
}|
}
qn|dk	s|dk	s|dk	rT|
|kr:|jj|q|jdj|qnt$j|dk	st%j|dk	st&j|dk	st'j|dk	st(j|dk	st)j|dk	st*j|dk	st+j|dk	r.|
|kr.|jdj||
}|
}
qn|jd|
|f||
|krg|jj|q|jdj|q|
|ks|
|	krt,j|} t-j|}!t.j|}"tj|}| dk	r|j||	}
q|!dk	r|!jddkr>|jd|||!jd|_/nd|!jd
|!jdf|_0|!jd|_1||_2|jj|g}td|}|}
q|"dk	r|s|jd||qn||_2|jj|g}td|}|}
q|dk	r+|j|qt!j|}t"j|}t#j|}|dk	s||dk	s||dk	r|j|qn|jd|
|f||j|q|
|
kr||kr|jdj|q|j|qt3st4d|
qW|
|kr*|
|
ksB|
|
kr{||kr{|jd|
|||_2t5|_6|jj|ndS(Ns
first headingsnext heading of EOFsstart of change datasmore change data or trailersslurp to endsEmpty changelog file.R$is
iiit;t,s$Invalid key-value pair after ';': %ssRepeated key-value: %sRs!Badly formatted urgency value: %sis(Unexpected line while looking for %s: %ss  s Badly formatted trailer line: %ss%s <%s>isUnknown state: %ssFound eof where expected %s(7RRRORHRIRt
isinstancet
basestringR5tstript
splitlinesR@tdecodetrstripttoplineR+R6tgroupRRtlstripRtsplittkeyvalueR)tvalue_reRRRR1R2temacs_variablest
vim_variablestcvs_keywordtcommentst
more_commentstold_format_re1told_format_re2told_format_re3told_format_re4told_format_re5told_format_re6told_format_re7told_format_re8R8tendlinetendline_nodetailsR"RRRR tAssertionErrorR	R!(#RRKRERFRGR$t
first_headingtnext_heading_or_eoftstart_of_change_datatmore_changes_or_trailertslurp_to_endt
current_blockR#tstatet	old_stateRt	top_matchtblank_matchtpairstall_keysRtpairtkv_matchR-R.t	val_matchtcommenttemacs_matcht	vim_matcht	cvs_matchtcomments_matchtmore_comments_matchtchange_matcht	end_matchtend_no_details_match((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRJs:		
						
		"					
	
		cCs|jdjS(s,Return a Version object for the last versioni(RHR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytget_versionscCst||jd_dS(swSet the version of the last changelog block

        version can be a full version string, or a Version object
        iN(RRHR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytset_versionstdocs'Version object for last changelog blockcCs
|jjS(N(Rtfull_version(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt<lambda>scCs
|jjS(N(Rtepoch(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs
|jjS(N(Rtdebian_revision(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs
|jjS(N(RR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs
|jjS(N(Rtupstream_version(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs|jdjS(s4Returns the name of the package in the last version.i(RHR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytget_packagescCs||jd_dS(Ni(RHR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytset_packagess'Name of the package in the last versioncCsg|jD]}|j^q
S(s@Returns a list of version objects that the package went through.(RHR(RR>((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytget_versionsss0List of version objects the package went throughcCsg|jD]}|j^q
S(N(RHR(RR>((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt
_raw_versionsscCsSg}|jdj|jx$|jD]}|jt|q)Wdj|S(Nu
u(R1tjoinRIRHR@(RtpiecesR>((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR?s
cCst|j|jS(N(R@RAR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs
t|jS(N(titerRH(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__iter__scCs
t|jS(N(R5RH(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__len__scCs||jd_dS(Ni(RHR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytset_distributionsscCs|jdjS(Ni(RHR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs||jd_dS(Ni(RHR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytset_urgencyscCs|jdjS(Ni(RHR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs|jdj|dS(Ni(RHR;(RR8((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR;scCs||jd_dS(Ni(RHR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt
set_authorscCs|jdjS(Ni(RHR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscCs||jd_dS(Ni(RHR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytset_datescCs|jdjS(Ni(RHR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRscKsC|jd|jt|}|jd|jjd|dS(NR$Ri(t
setdefaultRRR2RHR7(RtkwargsR>((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt	new_blocks
cCs|j|jdS(N(twriteR(RRK((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytwrite_to_open_filesN('RRRRR R	RRORJRRRBRRRtdebian_versionRRRRRRtversionsRR?RRRRRRRR;RRRRRR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRDsN																							cCsatj}tjd}d|krx|j|d}|rxd|kr_|jd|d<n|jd|d<qxnd|ksd|krd|kr|j|d}|rd|kr|jd|d<n|jd|d<qqnd|kr|d}ndd|kr%|d}nKy+tjdd	tjtj	j
}Wnttfk
rod}nXd|kr|d}nd|kr|d}nd}tjjd
rtd
}z|jj}Wd|jXn|stj}n|rBtjtj	j}|s/d}qBd||f}n|rQ|}nd}||fS(
sGet 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+<(.*)>$tDEBEMAILtDEBFULLNAMEiitEMAILtNAMEs,.*Rs
/etc/mailnameNs%s@%s(tostenvirontretcompileR+RYtsubtpwdtgetpwuidtgetuidtpw_gecostKeyErrortAttributeErrorRtpathtexiststopentreadlineRTtclosetsockettgetfqdntpw_name(tenvtregext	match_objt
maintainertemailtaddrtftuser((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytget_maintainersX	

+


		('RRRRRRLtdebian_supportt
StandardErrorRRRRtobjectRRt
IGNORECASERXR6R8RkRlR\R]R*R^R_R`RaRbRcRdReRfRgRhRiRjRDR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt<module>sR

f					2