ó ú4Pc@@sºdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl m Z y e Z Wnek reZ nXde fd„ƒYZde fd„ƒYZd e fd „ƒYZd e jfd „ƒYZd efd„ƒYZejdidd6ejƒZejdƒZejdƒZejdƒZejdƒZejdejƒZejdejƒZejdejƒZejdejƒZ ejdejƒZ!ejdƒZ"ejdƒZ#ejdƒZ$ejdƒZ%ejdƒZ&ejd ejƒZ'ejd!ejƒZ(ejd"ejƒZ)ejd#ejƒZ*ejd$ejƒZ+ejd%ƒZ,d&efd'„ƒYZ-d(„Z.dS()sAThis module implements facilities to deal with Debian changelogs.i(tabsolute_importN(tdebian_supporttChangelogParseErrorcB@s&eZdZeZd„Zd„ZRS(s0Indicates that the changelog could not be parsedcC@s ||_dS(N(t_line(tselftline((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__init__2scC@s d|jS(NsCould not parse changelog: (R(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__str__5s(t__name__t __module__t__doc__tTruet is_user_errorRR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR.s tChangelogCreateErrorcB@seZdZRS(s`Indicates that changelog could not be created, as all the information required was not given(RR R (((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR 8st VersionErrorcB@s&eZdZeZd„Zd„ZRS(sBIndicates that the version does not conform to the required formatcC@s ||_dS(N(t_version(Rtversion((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRAscC@s d|jS(NsCould not parse version: (R(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRDs(RR R R R RR(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR<s tVersioncB@seZdZRS(s)Represents a version of a Debian package.(RR R (((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRIst ChangeBlockc B@s³eZdZd d d d d d d d d dd„ Zd„Zd„ZeeeƒZd„Z d„Z d„Z d„Z d „Z ejd kr¢e Zd „Zne Zd „ZRS(s=Holds all the information about one block from the changelog.sutf-8c C@s˜d|_|j|ƒ||_||_|p1d|_|p@d|_||_||_||_ g|_ | psi|_ | |_ t |_d|_dS(Ntunknownts (tNonet _raw_versiont _set_versiontpackaget distributionsturgencyturgency_commentt_changestauthortdatet _trailingt other_pairst _encodingtFalset _no_trailert_trailer_separator( RRRRRRtchangesRRR tencoding((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRPs          cC@s"|dk rt|ƒ|_ndS(N(RtstrR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRbs cC@s t|jƒS(N(RR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt _get_versionfscC@swi}xjtjƒD]\\}}|djƒ|djƒ}tj|ƒ}|dkred|}n|||( ?)((\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 ChangelogcB@sÓeZdZd%d%eedd„Zd„Zd%eed%d„Zd„Z d„Z e e e ddƒZ e d „ƒZ e d „ƒZe d „ƒZe d „ƒZe d „ƒZd„Zd„Ze eeddƒZd„Ze eddƒZd„Zd„Zej dkr)eZd„ZneZd„Zd„Zd„Zd„Ze 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.sutf-8cC@se||_g|_g|_|dk ray#|j|d|d|d|ƒWqatk r]qaXndS(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_blockstallow_empty_authortstrictN(R!t_blockstinitial_blank_linesRtparse_changelogR(RtfileRKRLRMR&((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRãs      cC@s&|rt|ƒ‚n tj|ƒdS(N(Rtwarningstwarn(RtmessageRM((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt _parse_errorþsc#C@s¦d}d}d}d} d} |p*|j}|dkrM|jd|ƒdSg|_g|_td|ƒ} g} |} d}t|tƒr¡|j|ƒ}nt|t j ƒrît |j ƒƒdkrß|jd|ƒdS|j ƒ}nxH|D]@}t|t jƒs|j|ƒ}n|jd ƒ}| |ksF| |kr¥tj|ƒ}tj|ƒ}|dk rG|dk r•t |jƒ|kr•dS|jd ƒ| _|jd ƒ| _|jd ƒjƒ| _|jd d ƒd }i}i}x?|jdƒD].}|j ƒ}tj|ƒ}|dkrJ|jd||ƒqn|jd ƒ}|jd ƒ}|jƒ|kr—|jd|jƒ|ƒn|||jƒ<|jƒdkr'tj|ƒ}|dkrë|jd||ƒq1|jd ƒ| _|jd ƒ}|dk r1|| _q1q|||isUnknown state: %ssFound eof where expected %s(9R!RRURNRORt isinstancetbytestdecodetsixt string_typesR7tstript splitlinest text_typetrstripttoplineR-R8tgroupRRtlstripRtsplittkeyvalueR+tvalue_reRRR R3R4temacs_variablest vim_variablest cvs_keywordtcommentst more_commentstold_format_re1told_format_re2told_format_re3told_format_re4told_format_re5told_format_re6told_format_re7told_format_re8R:tendlinetendline_nodetailsR$RRRR"tAssertionErrorR R#(#RRQRKRLRMR&t first_headingtnext_heading_or_eoftstart_of_change_datatmore_changes_or_trailert slurp_to_endt current_blockR%tstatet old_stateRt top_matcht blank_matchtpairstall_keysR tpairtkv_matchR/R0t val_matchtcommentt emacs_matcht vim_matcht cvs_matchtcomments_matchtmore_comments_matcht change_matcht end_matchtend_no_details_match((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRPs>                                "                cC@s|jdjS(s,Return a Version object for the last versioni(RNR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt get_version»scC@st|ƒ|jd_dS(swSet the version of the last changelog block version can be a full version string, or a Version object iN(RRNR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt set_version¿stdocs'Version object for last changelog blockcC@s |jjS(N(Rt full_version(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytÊscC@s |jjS(N(Rtepoch(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“ËscC@s |jjS(N(Rtdebian_revision(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“ÌscC@s |jjS(N(RR•(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“ÍscC@s |jjS(N(Rtupstream_version(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“ÎscC@s|jdjS(s4Returns the name of the package in the last version.i(RNR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt get_packageÐscC@s||jd_dS(Ni(RNR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt set_packageÔss'Name of the package in the last versioncC@sg|jD]}|j^q S(s@Returns a list of version objects that the package went through.(RNR(RR@((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt get_versionsÚss0List of version objects the package went throughcC@sg|jD]}|j^q S(N(RNR(RR@((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt _raw_versionsáscC@shg}|jtjdƒj|jƒƒx'|jD]}|jtj|ƒƒq2Wtjdƒj|ƒS(Ns R(R3R[tutjoinRORNR_(RtpiecesR@((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRAäs "RBcC@st|ƒj|jƒS(N(R'RCR!(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRDîscC@st|ƒj|jƒS(N(RERCR!(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRóscC@s t|jƒS(N(titerRN(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__iter__öscC@s t|jƒS(N(R7RN(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt__len__ùscC@s||jd_dS(Ni(RNR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytset_distributionsüscC@s|jdjS(Ni(RNR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“þscC@s||jd_dS(Ni(RNR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt set_urgencyscC@s|jdjS(Ni(RNR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“scC@s|jdj|ƒdS(Ni(RNR=(RR:((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR=scC@s||jd_dS(Ni(RNR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt set_authorscC@s|jdjS(Ni(RNR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“ scC@s||jd_dS(Ni(RNR(RR((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytset_date scC@s|jdjS(Ni(RNR(R((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyR“scK@sC|jd|jƒt|}|jdƒ|jjd|ƒdS(NR&Ri(t setdefaultR!RR4RNR9(RtkwargsR@((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyt new_blocks  cC@s|j|jƒƒdS(N(twriteR(RRQ((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytwrite_to_open_filesN(*RR R RR"R RRURPRRRFRR’R”tdebian_versionR•R–R—R˜RR™tversionsRšRARGRRDRHRŸR R¡RR¢RR=R£RR¤RR§R©(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyRJßsV ¶                         cC@satj}tjdƒ}d|krx|j|dƒ}|rxd|kr_|jdƒ|d$tDEBEMAILt DEBFULLNAMEiitEMAILtNAMEs,.*Rs /etc/mailnameNs%s@%s(tostenvirontretcompileR-Rbtsubtpwdtgetpwuidtgetuidtpw_gecostKeyErrortAttributeErrorRtpathtexiststopentreadlineR]tclosetsockettgetfqdntpw_name(tenvtregext match_objt maintainertemailtaddrtftuser((s4/usr/lib/python2.7/dist-packages/debian/changelog.pytget_maintainersX         +        (/R t __future__RR°RµR²RÀRRRGR[tdebianRt StandardErrort_base_exception_classt NameErrort ExceptionRR RRtobjectRR³t IGNORECASERaR8R:RtRuReRfR,RgRhRiRjRkRlRmRnRoRpRqRrRsRJRË(((s4/usr/lib/python2.7/dist-packages/debian/changelog.pyts`            n           ÿ<