403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/bugzilla/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/bugzilla/base.pyc
]Ic
@sddkZddkZyddkZWnej
oddkZnXddkZddkZddkZddkZei	dZ
dZdeiefZ
defdYZdefdYZd	efd
YZdZdefd
YZdfdYZdeifdYZdeiefdYZdefdYZdefdYZeZdS(iNtbugzillas0.5.1s Python-urllib2/%s bugzilla.py/%st
BugzillaErrorcBseZdZRS(s)Error raised in the Bugzilla client code.(t__name__t
__module__t__doc__(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRst
NeedSyncErrorcBseZdZRS(sMMust save data from this class to the bugzilla server before using this.
    (RRR(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR stNeedParamErrorcBseZdZRS(s#A necessary parameter was left out.(RRR(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR%scCsVg}xI|D]A}t|tod|jo|i|q
|idq
W|S(sr is a raw xmlrpc response. 
    If it represents an error, None is returned.
    Otherwise, r is returned.
    This is mostly used for XMLRPC Multicall handling.tbug_idN(t
isinstancetdicttappendtNone(trawlisttresulttr((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytreplace_getbug_errors_with_None)stBugzillaBasec	BseZdZdbdbdbeiiddZdZdZ	dZ
dZdZe
e
eeZdbdZd	d
gZdbdZdZd
ZdZdbdbdZdZdZdZdZedZe
ddddZedZe
ddddZe
ddddZdZ edZ!e
dd dd!Z"d"Z#d#Z$d$Z%d%Z&d&Z'd'Z(ed(Z)ed)Z*ed*Z+d+Z,d,Z-d-Z.d.Z/d/Z0d0Z1d1Z2d2Z3d3Z4d4Z5d5Z6d6Z7d7d7d7d8d9Z8ed7d7d7d:Z9d7eeed;Z:d<Z;d=Z<d>Z=d7ed?Z>d@Z?dAZ@dBZAdCZBdDZCdEZDdFZEdcZFdddedfdgdhfZGdVZHedWZIdbdbdbdXZJdbdbdYZKdZZLd[ZMd\ZNd]ZOd^ZPd7d7d_ZQd`ZRdaZSRS(islAn object which represents the data and methods exported by a Bugzilla
    instance. Uses xmlrpclib to do its thing. You'll want to create one thusly:
    bz=Bugzilla(url='https://bugzilla.redhat.com/xmlrpc.cgi',user=u,password=p)

    You can get authentication cookies by calling the login() method. These
    cookies will be stored in a MozillaCookieJar-style file specified by the
    'cookiefile' attribute (which defaults to ~/.bugzillacookies). Once you
    get cookies this way, you will be considered logged in until the cookie
    expires.

    You may also specify 'user' and 'password' in a bugzillarc file, either
    /etc/bugzillarc or ~/.bugzillarc. The latter will override the former.
    The format works like this:
      [bugzilla.yoursite.com]
      user = username
      password = password
    You can also use the [DEFAULT] section to set defaults that apply to 
    any site without a specific section of its own.
    Be sure to set appropriate permissions on bugzillarc if you choose to
    store your password in it!

    This is an abstract class; it must be implemented by a concrete subclass
    which actually connects the methods provided here to the appropriate
    methods on the bugzilla instance.

    :kwarg url: base url for the bugzilla instance
    :kwarg user: usename to connect with
    :kwarg password: password for the connecting user
    :kwarg cookiefile: Location to save the session cookies so you don't have
        to keep giving the library your username and password.  This defaults
        to ~/.bugzillacookies.  If set to None, the library won't save the
        cookies persistently.
    s~/.bugzillacookiescCs|pd|_|pd|_d|_|o
d|_n
t|_t|_||_t|_t	|_
|i|o|i|ndS(Nt(
tusertpasswordturlRt_cookiefiletTruet_persist_cookiet
cookiefilet
user_agenttFalset	logged_intinit_private_datatconnect(tselfRRRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt__init__Zs	
					
cCs
|`dS(N(R(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt__del__qscCs[d|_d|_d|_d|_d|_d|_d|_t|_	t|_
dS(s<initialize private variables used by this bugzilla instance.N(Rt_proxyt
_transportt_openert
_querydatat_querydefaultst	_productst
_bugfieldsR	t_componentst_components_details(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRts							cCs|iS(s`cookiefile is the file that bugzilla session cookies are loaded
        and saved from.
        (R(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_getcookiefilescCsr||ijodS|`||_ti|i}|ip{t|_ti\}|_ti	|y|i
|iWqVtj
o)}ti
d|it|fqVXnt|_tii|io|i|initid}y|i
|iWn5tj
o)}tid|it|fnXti|||_|i|i_dS(Ns.Couldn't initialize temporary cookiefile%s: %si?s%Couldn't initialize cookiefile %s: %s(RRt	cookielibtMozillaCookieJarRRttempfiletmkstemptostclosetsavet	ExceptiontlogtwarntstrRtpathtexiststloadtumaskterrort
_cookiejartfilename(RRtcjtfhtet	old_umask((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_setcookiefiles4	
	
	 		
	cCs4|ipti|ind|_d|_dS(N(RR/tremoveRRRR;(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_delcookiefiles
	cCs*|ptiid}n||_dS(sDeprecated: Set self.cookiefile instead. It's a property that will
        take care of these details.

        Read the given (Mozilla-style) cookie file and fill in the
        cookiejar, allowing us to use saved credentials to access Bugzilla.

        :kwarg cookiefile: Location to save the session cookies so you don't
            have to keep giving the library your username and password.  This
            defaults to ~/.bugzillacookies.
        s~/.bugzillacookiesN(R/R6t
expanduserR(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytinitcookiefiless/etc/bugzillarcs
~/.bugzillarcc
Cs>ddk}|p
|i}ng}|D]}|tii|q+~}|i}|i|}|pdSd}tid|i	xKt
|idD]1}||i	jotid||}qqW|pdSxO|i|D]>\}	}
|	d
jo%tid	|	t
||	|
qqWdS(s$Read bugzillarc file(s) into memory.iNRs(Searching for config section matching %scSs)tt|t|p
t||S((tcmptlen(tatb((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt<lambda>ssFound matching section: %sRRsSetting '%s' from configfile(suserspassword(tConfigParsert
configpathR/R6RDtSafeConfigParsertreadR3tdebugRtsortedtsectionstitemstsetattr(RRLRKt_[1]tptcRtsectiontstktv((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
readconfigs,
-
cCs|idot|_n
t|_|i|i_|i|i_ti||i|_	t
i|i}t
i||_
d|ifg|i
_||_|i|io%|iotid|indS(sRConnect to the bugzilla instance with the given url.
        
        This will also read any available config files (see readconfig()),
        which may set 'user' and 'password'.

        If 'user' and 'password' are both set, we'll run login(). Otherwise
        you'll have to login() yourself before some methods will work.
        thttpss
User-agents)user and password present - doing login()N(t
startswithtSafeCookieTransportR"tCookieTransportRR;t	cookiejart	xmlrpclibtServerProxyR!turllib2tHTTPCookieProcessortbuild_openerR#t
addheadersRR[RRR3tinfotlogin(RRthandler((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRs
	

cCs|idS(s,Disconnect from the given bugzilla instance.N(R(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
disconnectscCs
tdS(s"IMPLEMENT ME: backend login methodN(tNotImplementedError(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_loginscCs|o
||_n|o
||_n|ip
tdn|ip
tdny;|i|i|i}t|_tidd|_Wnti	j
o}t
}nX|S(sAttempt to log in using the given username and password. Subsequent
        method calls will use this username and password. Returns False if 
        login fails, otherwise returns some kind of login info - typically
        either a numeric userid, or a dict of user info. It also sets the 
        logged_in attribute to True, if successful.

        If user is not set, the value of Bugzilla.user will be used. If *that*
        is not set, ValueError will be raised. 

        This method will be called implicitly at the end of connect() if user
        and password are both set. So under most circumstances you won't need
        to call this yourself.
        smissing usernamesmissing passwords0login successful - dropping password from memoryR(RRt
ValueErrorRlRRR3RgRatFaultR(RRRRtf((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRhs 





	

cCs
tdS(s"IMPLEMENT ME: backend login methodN(Rk(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_logout%scCs3|i|id|_d|_t|_dS(shLog out of bugzilla. Drops server connection and user info, and
        destroys authentication cookies.RN(RpRjRRRR(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytlogout)s


		cCs
tdS(s*IMPLEMENT ME: Get bugfields from Bugzilla.N(Rk(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
_getbugfields4scCs
tdS(s*IMPLEMENT ME: Get queryinfo from Bugzilla.N(Rk(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
_getqueryinfo7scCsn|p|ioUy|i|_Wqgtij
o,}|idjo
g|_qc|qgXn|iS(sCalls getBugFields, which returns a list of fields in each bug
        for this bugzilla instance. This can be used to set the list of attrs
        on the Bug object.tClient(R'RrRaRnt	faultCode(Rt
force_refreshRo((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetbugfields;s
tfgetcCs
|iS((Rw(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJKstfdelcCst|ddS(R'N(RSR(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJLscCsH|p|io|io|i\|_|_n|i|ifS(sCalls getQueryInfo, which returns a (quite large!) structure that
        contains all of the query data and query defaults for the bugzilla
        instance. Since this is a weighty call - takes a good 5-10sec on
        bugzilla.redhat.com - we load the info in this private method and the
        user instead plays with the querydata and querydefaults attributes of
        the bugzilla object.(R$R%Rs(RRv((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetqueryinfoNscCs|idS(i(Rz(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJ]scCst|ddS(R$N(RSR(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJ^scCs|idS(i(Rz(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJ_scCst|ddS(R%N(RSR(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJ`scCs
tdS(s-IMPLEMENT ME: Get product info from Bugzilla.N(Rk(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_getproductsdscCs,|p|io|i|_n|iS(snGet product data: names, descriptions, etc.
        The data varies between Bugzilla versions but the basic format is a 
        list of dicts, where the dicts will have at least the following keys:
        {'id':1,'name':"Some Product",'description':"This is a product"}

        Any method that requires a 'product' can be given either the 
        id or the name.(R&R{(RRv((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetproductshscCs
|iS((R|(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJuscCst|ddS(R&N(RSR(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRJvscCs2x+|iD] }|d|jo	|dSq
WdS(s3Convert a product ID (int) to a product name (str).tidtnameN(tproducts(Rt	productidRU((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_product_id_to_namews
cCs2x+|iD] }|d|jo	|dSq
WdS(s3Convert a product name (str) to a product ID (int).R~R}N(R(RtproductRU((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_product_name_to_id}s
cCs
tdS(s1IMPLEMENT ME: get component details for a productN(Rk(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_getcomponentsdetailsscCs
tdS(s.IMPLEMENT ME: Get component dict for a productN(Rk(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_getcomponentsscCs
tdS(sIMPLEMENT ME: Add a componentN(Rk(Rtdata((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
_addcomponentscCs
tdS(sIMPLEMENT ME: Edit a componentN(Rk(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_editcomponentscCs<|p||ijo|i||i|<n|i|S(s?Return a dict of components:descriptions for the given product.(R(R(RRRv((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
getcomponentsscCsw|p||ijoU|i|}t}x)|D]!}|d}|d=|||<q6W||i|<n|i|S(sReturns a dict of dicts, containing detailed component information
        for the given product. The keys of the dict are component names. For 
        each component, the value is a dict with the following keys: 
        description, initialowner, initialqacontact, initialcclistt	component(R)RR	(RRRvtclisttcdicttitemR~((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetcomponentsdetailss	
cCs|i||}||S(sGet details for a single component. Returns a dict with the
        following keys: 
        description, initialowner, initialqacontact, initialcclist(R(RRRRvtd((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetcomponentdetailsscCs|i|dS(smA method to create a component in Bugzilla. Takes a dict, with the
        following elements:

        product: The product to create the component in
        component: The name of the component to create
        initialowner: The bugzilla login (email address) of the initial owner
        of the component
        initialqacontact: The bugzilla login of the initial QA contact
        initialcclist: The initial list of users to be CC'ed on new bugs for
        the component.
        desription: A one sentence summary of the component

        product, component, description and initalowner are mandatory.
        N(R(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytaddcomponentscCs|i|dS(sA method to edit a component in Bugzilla. Takes a dict, with
            mandatory elements of product. component, and initialowner.
            All other elements are optional and use the same names as the
            addcomponent() method.N(R(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
editcomponentscCs
tdS(sAIMPLEMENT ME: Return a dict of full bug info for the given bug idN(Rk(RR}((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_getbugscCs
tdS(sYIMPLEMENT ME: Return a list of full bug dicts, one for each of the 
        given bug idsN(Rk(Rtidlist((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_getbugsscCs
tdS(sQIMPLEMENT ME: Return a short dict of simple bug info for the given
        bug idN(Rk(RR}((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
_getbugsimplescCs
tdS(sYIMPLEMENT ME: Return a list of short bug dicts, one for each of the
        given bug idsN(Rk(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_getbugssimplescCs
tdS(s@IMPLEMENT ME: Query bugzilla and return a list of matching bugs.N(Rk(Rtquery((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_queryscCs3tidt|td|d|i|S(sPReturn a Bug object with the full complement of bug data
        already loaded.s
getbug(%s)RR	(R3ROR5t_BugR(RR}((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetbugscCstd|d|i|S(s<Return a Bug object given bug id, populated with simple infoRR	(RR(RR}((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetbugsimplescCsEg}|i|D]*}||otd|d|pdq~S(sReturn a list of Bug objects with the full complement of bug data
        already loaded. If there's a problem getting the data for a given id,
        the corresponding item in the returned list will be None.RR	N(RRR(RRRTRI((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetbugsscCsEg}|i|D]*}||otd|d|pdq~S(sReturn a list of Bug objects for the given bug ids, populated with
        simple info. As with getbugs(), if there's a problem getting the data
        for a given bug ID, the corresponding item in the returned list will
        be None.RR	N(RRR(RRRTRI((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
getbugssimplescCsA|i|}g}|dD]}|td|d|q~S(sQuery bugzilla and return a list of matching bugs.
        query must be a dict with fields like those in in querydata['fields'].
        Returns a list of Bug objects.
        Also see the _query() method for details about the underlying
        implementation.
        tbugsRR	(RR(RRRRTRI((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRsRtallwordssubstrcCs6h|d6|d6|d6|d6|d6}|i|S(sConvenience method - query for bugs filed against the given
        product, version, and component whose comments match the given string.
        matchtype specifies the type of match to be done. matchtype may be
        any of the types listed in querydefaults['long_desc_type_list'], e.g.:
        ['allwordssubstr','anywordssubstr','substring','casesubstring',
         'allwords','anywords','regexp','notregexp']
        Return value is the same as with query().
        RtversionRt	long_desctlong_desc_type(R(RRRRtstringt	matchtypetq((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytsimplequerys	cCs
tdS(s/IMPLEMENT ME: add a comment to the given bug IDN(Rk(RR}tcommenttprivatet	timestamptworktimetbz_gid((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_addcommentscCs
tdS(s0IMPLEMENT ME: Set the status of the given bug IDN(Rk(RR}tstatusRRt
private_in_ittnomail((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
_setstatussc		Cs
tdS(s$IMPLEMENT ME: close the given bug IDN(Rk(	RR}t
resolutiontdupeidtfixedinRt	isprivateRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt	_closebugscKs
tdS(s2IMPLEMENT ME: set the assignee of the given bug IDN(Rk(RR}R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_setassigneescCs
tdS(sIMPLEMENT ME: update the deps (blocked/dependson) for the given bug.
        blocked, dependson: list of bug ids/aliases
        action: 'add' or 'delete'
        N(Rk(RR}tblockedt	dependsontaction((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_updatedepsscCs
tdS(sIMPLEMENT ME: Update the CC list using the action and account list
        specified.
        cclist must be a list (not a tuple!) of addresses.
        action may be 'add', 'delete', or 'overwrite'.
        comment specifies an optional comment to add to the bug.
        if mail is True, email will be generated for this change.
        Note that using 'overwrite' may result in up to three XMLRPC calls
        (fetch list, remove each element, add new elements). Avoid if possible.
        N(Rk(RR}tcclistRRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt	_updatecc!s
cCs
tdS(sIMPLEMENT ME: Update the whiteboard given by 'which' for the given
        bug. performs the given action (which may be 'append',' prepend', or 
        'overwrite') using the given text.N(Rk(RR}ttexttwhichR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_updatewhiteboard,scCs
tdS(sUpdates the flags associated with a bug report.
        data should be a hash of {'flagname':'value'} pairs, like so:
        {'needinfo':'?','fedora-cvs':'+'}
        You may also add a "nomail":1 item, which will suppress email if set.N(Rk(RR}tflags((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_updateflags1scCsPd}d}|i|}x.|o&|ti|}|i|}qW|S(sReturn the contents of the file-like object fh in a form
        appropriate for attaching to a bug in bugzilla. This is the default
        encoding method, base64.iR(RNtbase64t	b64encode(RR>t	chunksizeRtchunk((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_attachment_encode:scKs
tdS(sIMPLEMENT ME: attach a file to the given bug.
        attachdata MUST contain the following keys:
            data:        File data, encoded in the bugzilla-preferred format.
                         attachfile() will encode it with _attachment_encode().
            description: Short description of this attachment.
            filename:    Filename for the attachment.
        The following optional keys may also be added:
            comment:   An optional comment about this attachment.
            isprivate: Set to True if the attachment should be marked private.
            ispatch:   Set to True if the attachment is a patch.
            contenttype: The mime-type of the attached file. Defaults to
                         application/octet-stream if not set. NOTE that text
                         files will *not* be viewable in bugzilla unless you 
                         remember to set this to text/plain. So remember that!
        Returns (attachment_id,mailresults).
        N(Rk(RR}t
attachdata((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_attachfileKscKst|tot|}n$t|do
|}n
td||d<d|jotii|i|d<nd|jod|d<n|i	||d<|i
||\}}|S(sAttach a file to the given bug ID. Returns the ID of the attachment
        or raises xmlrpclib.Fault if something goes wrong.
        attachfile may be a filename (which will be opened) or a file-like
        object, which must provide a 'read' method. If it's not one of these,
        this method will raise a TypeError.
        description is the short description of this attachment.
        Optional keyword args are as follows:
            filename:  this will be used as the filename for the attachment.
                       REQUIRED if attachfile is a file-like object with no
                       'name' attribute, otherwise the filename or .name
                       attribute will be used.
            comment:   An optional comment about this attachment.
            isprivate: Set to True if the attachment should be marked private.
            ispatch:   Set to True if the attachment is a patch.
            contenttype: The mime-type of the attached file. Defaults to
                         application/octet-stream if not set. NOTE that text
                         files will *not* be viewable in bugzilla unless you 
                         remember to set this to text/plain. So remember that!
        RNs/attachfile must be filename or file-like objecttdescriptionR<tcontenttypesapplication/octet-streamR(RR5topenthasattrt	TypeErrorR/R6tbasenameR~RR(RR}t
attachfileRtkwargsRotattachidtmailresults((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR^s
	


cCs'|iidd}|d|}|S(s,Returns the URI for the given attachment ID.s
xmlrpc.cgisattachment.cgis?id=%i(Rtreplace(RRtatt_uri((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_attachment_uriscCs|i|}titi|i}|i|}|idid}g}|D]'}|ii	do||qZqZ~\}|id\}	}
|
id|_
|S(sdGet the contents of the attachment with the given attachment ID.
        Returns a file-like object.scontent-dispositiont;s	filename=t=t"(RRcReRdR;RtheaderstsplittstripR]R~(RRRtopenertatttdispRTtit
filename_parmtdummyR<((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytopenattachments>RRRt
short_descRtrep_platformtbug_severitytop_systbug_file_loctsummaryRtplatformtseverityRt
bug_statuscKs
tdS(sIMPLEMENT ME: Raw xmlrpc call for createBug() 
        Doesn't bother guessing defaults or checking argument validity. 
        Returns bug_idN(Rk(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
_createbugscKs8xX|iD]M\}}||ijo1||jo$||jo|i|||<q
q
WxV|iD]K}||jp||o,|djod||<qtd|qeqeW|o^|d|idjotd|dn|d|idjotd	|dqn|i|}t|d
|S(s
Create a bug with the given info. Returns a new Bug object.
        data should be given as keyword args - remember that you can also
        populate a dict and call createbug(**dict) to fill in keyword args.
        The arguments are as follows. Note that some are required, some are
        defaulted, and some are completely optional.

        The Bugzilla 3.2 docs say the following:

        "Clients that want to be able to interact uniformly with multiple
        Bugzillas should always set both the params marked Required and those 
        marked Defaulted, because some Bugzillas may not have defaults set for 
        Defaulted parameters, and then this method will throw an error if you 
        don't specify them."

        REQUIRED:
          product: Name of Bugzilla product. 
            Ex: Red Hat Enterprise Linux
          component: Name of component in Bugzilla product. 
            Ex: anaconda
          version: Version in the list for the Bugzilla product. 
            Ex: 4.5
            See querydata['product'][<product>]['versions'] for values.
          summary: One line summary describing the bug report.

        DEFAULTED:
          platform: Hardware type where this bug was experienced.  
            Ex: i386
            See querydefaults['rep_platform_list'] for accepted values.
          severity: Bug severity.  
            Ex: medium
            See querydefaults['bug_severity_list'] for accepted values.
          priority: Bug priority.
            Ex: medium
            See querydefaults['priority_list'] for accepted values.
          op_sys: Operating system bug occurs on. 
            Ex: Linux
            See querydefaults['op_sys_list'] for accepted values.
          description: A detailed description of the bug report.

        OPTIONAL: 
          alias: Give the bug a (string) alias name.
            Alias can't be merely numerical.
            Alias can't contain spaces or commas.
            Alias can't be more than 20 chars long.
            Alias has to be unique.
          assigned_to: Bugzilla username to assign this bug to.
          qa_contact: Bugzilla username of QA contact for this bug.
          cc: List of Bugzilla usernames to CC on this bug.
          status: Status to place the new bug in. Defaults to NEW.

        Important custom fields (used by RH Bugzilla and maybe others):
        DEFAULTED: 
          bug_file_loc: URL pointing to additional information for bug report. 
            Ex: http://username.fedorapeople.org/logs/crashlog.txt
          reporter: Bugzilla username to use as reporter. 
        OPTIONAL: 
          blocked: List of bug ids this report blocks.
          dependson: List of bug ids this report depends on.
        Rshttp://s%required field missing or empty: '%s'Rtop_sys_listsinvalid value for op_sys: %sRtrep_platform_lists"invalid value for rep_platform: %sR(t
field_aliasestcreatebug_requiredtpopRt
querydefaultsRmRR(Rt
check_argsRtnewfieldtoldfieldRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt	createbugs$?



cCs
tdS(s)IMPLEMEMT ME: Get a list of Bugzilla userN(Rk(Rtidstnamestmatch((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt	_getusersscCs
tdS(s$IMPLEMEMT ME: Create a Bugzilla userN(Rk(RtemailR~R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_createuserscCs
tdS(s.IMPLEMEMT ME: Update Bugzilla user permissionsN(Rk(RRRtgroup((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_updatepermsscCs
tdS(s[IMPLEMENT ME: Add a bugzilla user

        Deprecated.  User _createuser() instead
        N(Rk(RRR~((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_addusersc
CsY|id|gdd}t|d|dd|dd|dd|dd	|d	S(
sReturn a bugzilla User for the given username

        :arg username: The username used in bugzilla.
        :raises xmlrpclib.Fault: Code 51 if the username does not exist
        :returns: User record for the username
        RtusersituseridR}t	real_nameRR~t	can_login(Rt_User(Rtusernametrawuser((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetuser#scCsgg}|id|dD]E}|t|d|dd|dd|dd|dd|dq~S(	sReturn a list of Users from bugzilla.

        :userlist: List of usernames to lookup
        :returns: List of User records
        RRRR}RRR~R(RR(RtuserlistRTR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgetusers/scCsgg}|id|dD]E}|t|d|dd|dd|dd|dd|dq~S(	sReturn a bugzilla User for the given list of patterns

        :arg pattern: List of patterns to match against.
        :returns: List of User records
        RRRR}RRR~R(RR(RtpatternRTR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytsearchusers:scCs"|i|||}|i|S(sReturn a bugzilla User for the given username

        :arg email: The email address to use in bugzilla
        :kwarg name: Real name to associate with the account
        :kwarg password: Password to set for the bugzilla account
        :raises xmlrpclib.Fault: Code 501 if the username already exists
            Code 500 if the email address isn't valid
            Code 502 if the password is too short
            Code 503 if the password is too long
        :return: User record for the username
        (RR(RRR~RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
createuserEscCs|i|||dS(sMA method to update the permissions (group membership) of a bugzilla
        user.  Deprecated.  Use User.updateperms(action, group) instead.

        :arg user: The e-mail address of the user to be acted upon
        :arg action: either add or rem
        :arg groups: list of groups to be added to (i.e. ['fedora_contrib'])
        N(R(RRRtgroups((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytupdatepermsTscCs|i||dS(sDeprecated: Use createuser() instead.

        A method to create a user in Bugzilla. Takes the following:

        user: The email address of the user to create
        name: The full name of the user to create
        N(R(RRR~((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytadduser^sN(	sproducts	componentsversions
short_descscommentsrep_platformRsop_syssbug_file_loc(ssummarys
short_desc(sdescriptionscomment(splatformsrep_platform(RR(sstatuss
bug_status(TRRRRR/R6RDRR RR*RARCtpropertyRRERLR[RRjRlRhRpRqRrRsRRwt	bugfieldsRzt	querydataRR{R|RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
RR
RR(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR8s!					#				!					
																		
									$				b						
tCookieResponsecBs eZdZdZdZRS(sFake HTTPResponse object that we can fill with headers we got elsewhere.
    We can then pass it to CookieJar.extract_cookies() to make it pull out the
    cookies from the set of headers we have.cCs
||_dS(N(R(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRlscCs|iS(N(R(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRgos(RRRRRg(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRhs	R_cBs/eZdZdZdZdZddZRS(s8A subclass of xmlrpclib.Transport that supports cookies.thttpcCs%|idjo tidti|_n|iotidtid|i|ii|tid|it}xX|iD]J\}}|i	do.tid||f|i
||gqqWx5|D]\}}|i||qWntiddS(Ns,send_cookies(): creating in-memory cookiejars(send_cookies(): using existing cookiejars$cookie_request headers currently: %sscookie_request headers now: %stCookiessending cookie: %s=%ss1send_cookies(): cookiejar empty. Nothing to send.(R`RR3ROR+t	CookieJartheader_itemstadd_cookie_headertlistR]R
t	putheader(Rt
connectiontcookie_requestt
cookielistthRZ((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytsend_cookiesxs$


	
ic	Cs|i|}|o|idnd|i||f}tid|ti|}|i||||i|||i	|||i
||i|||i\}}	}
t
|
}|ii||tid|iit|idoYy|ii|iiWqdtj
o,}tid|iit|fqdXn|djo ti||||	|
n||_y|ii}
Wntj
o
d}
nX|i|i|
S(Nis	%s://%s%ssrequest_url is %sscookiejar now contains: %sR1s Couldn't write cookiefile %s: %si( tmake_connectiontset_debugleveltschemeR3RORctRequesttsend_requestt	send_hostR tsend_user_agenttsend_contenttgetreplyRR`textract_cookiest_cookiesRR1R<R2R:R5Rat
ProtocolErrortverboset_conntsocktAttributeErrorRt_parse_responsetgetfile(RthostRitrequest_bodyR-Rtrequest_urlRterrcodeterrmsgRtcookie_responseR?R/((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytrequests@
	#

	N(RRRRR`R#R R9(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR_rs
	R^cBseZdZdZeiZRS(s-SafeTransport subclass that supports cookies.R\(RRRR#R_R9(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR^sRcBseZdZd	d	edZedZedZedZ	dZ
dZee
eZdZ
dZRS(
sGContainer object for a bugzilla User.

    :arg bugzilla: Bugzilla instance that this User belongs to.
    :arg name: name that references a user
    :kwarg userid: id in bugzilla for a user
    :kwarg real_name: User's real name
    :kwarg email: User's email address
    :kwarg can_login: If set True, the user can login
    cCsC||_||_||_||_||_||_t|_dS(N(Rt_User__namet
_User__useridRt_User__emailt_User__can_loginRt_name_dirty(RRR~RRRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRs						cCs|iS(N(R;(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRscCs|iS(N(R<(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRscCs|iS(N(R=(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRscCs|iS(N(R:(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt_namescCst|_||_dS(N(RR>R:(Rtvalue((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt	_set_names	cCsGt|_|iid|idh|id6|id6|id6dS(sUpdate Bugzilla with these values.

        :raises xmlrpclib.Fault: Code 304 if you aren't allowed to edit
            the user
        RtupdateR~RRN(Rt_name__dirtyRt_updateRR~RR(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRBs	"cCs7|iotdn|ii|i||dS(sA method to update the permissions (group membership) of a bugzilla
        user.

        :arg action: either add or rem
        :arg groups: list of groups to be added to (i.e. ['fedora_contrib'])
        s;name has been changed.  run update() before updating perms.N(R>RRRR~(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRs
N(RRRRRRRRRRR?RAR~RBR(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRs				
RcBseZdZdZdZdZdZdZdZde	e	e	dZ
ddddd	Ze	dddd
Zddde	e	e	dZ
d
ZdZddZddZddZddZddZddZddZddZddZRS(soA container object for a bug report. Requires a Bugzilla instance - 
    every Bug is on a Bugzilla, obviously.
    Optional keyword args:
        dict=DICT   - populate attributes with the result of a getBug() call
        bug_id=ID   - if dict does not contain bug_id, this is required before
                      you can read any attributes or make modifications to this
                      bug.
        autorefresh - automatically refresh the data in this bug after calling
                      a method that modifies the bug. Defaults to True. You can
                      call refresh() to do this manually.
    cKs||_t|_d|jo>|do3tid|di|ii|dnd|jo-tid|dt|d|dnd|jo|d|_nt	|dp-t	|do|i
|_qtdn|i
idd	|i|_
dS(
NR	sBug(%s)RsBug(%i)tautorefreshR}sBug object needs a bug_ids
xmlrpc.cgisshow_bug.cgi?id=%i(RRRER3ROtkeyst__dict__RBRSRR}RRRR(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyRs 		


cCsd|ijo
|i}n^d|ijo
|i}nAd|ijo
|i}n$tidd}ti|id|ijo0d|ijo|ii|i	|_
qnd|i|i|i
|fS(	s1Return a simple string representation of this bugtshort_short_descRRsWeird; this bug has no summary?s[ERROR: SUMMARY MISSING]tassigned_totassigned_to_ids#%-6s %-10s - %s - %s(
RGRHRRR3R4RORt
_getuserforidRJRIRR(Rtdesc((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt__str__3s



 cCs d|i|iit|fS(Ns<Bug #%i on %s at %#x>(RRRR}(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt__repr__HscCs|d|ijo[|iio$||iijotd|n|i||ijo|i|Sntd|dS(NRs"field %s not in bugzilla.bugfieldss Bug object has no attribute '%s'(RGRRR0trefresh(RR~((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt__getattr__Ls 
cCs)|ii|i}|ii|dS(s!Refresh all the data in this Bug.N(RRRRGRB(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyROWscCs|idS(sAn alias for refresh()N(RO(R((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytreload\sRcCs&|ii|i|||||dS(s Update the status for this bug report. 
        Valid values for status are listed in querydefaults['bug_status_list']
        Commonly-used values are ASSIGNED, MODIFIED, and NEEDINFO.
        To change bugs to CLOSED, use .close() instead.
        See Bugzilla._setstatus() for details.N(RRR(RRRRRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt	setstatus`sc
CsS|p|p|p
tdn|ii|id|d|d|d|}|S(sSet any of the assigned_to, reporter, or qa_contact fields to a new
        bugzilla account, with an optional comment, e.g.
        setassignee(reporter='sadguy@brokencomputer.org',
                    assigned_to='wwoods@redhat.com')
        setassignee(qa_contact='wwoods@redhat.com',comment='wwoods QA ftw')
        You must set at least one of the three assignee fields, or this method
        will throw a ValueError.
        Returns [bug_id, mailresults].s8You must set one of assigned_to, reporter, or qa_contactRItreportert
qa_contactR(RmRRR(RRIRSRTRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytsetassigneeis
	
cCs&|ii|i|||||dS(sPAdd the given comment to this bug. Set private to True to mark this
        comment as private. You can also set a timestamp for the comment, in
        "YYYY-MM-DD HH:MM:SS" form. Worktime is undocumented upstream.
        If bz_gid is set, and the entire bug is not already private to that
        group, this comment will be private.N(RRR(RRRRRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
addcommentzsic	Cs,|ii|i|||||||dS(sAClose this bug. 
        Valid values for resolution are in bz.querydefaults['resolution_list']
        For bugzilla.redhat.com that's:
        ['NOTABUG','WONTFIX','DEFERRED','WORKSFORME','CURRENTRELEASE',
         'RAWHIDE','ERRATA','DUPLICATE','UPSTREAM','NEXTRELEASE','CANTFIX',
         'INSUFFICIENT_DATA']
        If using DUPLICATE, you need to set dupeid to the ID of the other bug.
        If using WORKSFORME/CURRENTRELEASE/RAWHIDE/ERRATA/UPSTREAM/NEXTRELEASE
          you can (and should) set 'new_fixed_in' to a string representing the 
          version that fixes the bug.
        You can optionally add a comment while closing the bug. Set 'isprivate'
          to True if you want that comment to be private.
        If you want to suppress sending out mail for this bug closing, set
          nomail=True.
        N(RRR(RRRRRRRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR0scCs|ii|i|dS(sUpdates the bugzilla flags.
        The flags values are a hash of {'flagname': 'value'} pairs.
        Each product seems to have different flags available, so this can be
        error-prone unless the error code is understood.
        N(RRR(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytupdateflagsscCs |ii|i|||dS(sActually does the updateWhiteboard call to perform the given action
        (append,prepend,overwrite) with the given text on the given whiteboard
        for the given bug.N(RRR(RRRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
_dowhiteboardsRcCst|d|S(sGet the current value of the whiteboard specified by 'which'.
        Known whiteboard names: 'status','internal','devel','qa'.
        Defaults to the 'status' whiteboard.s
%s_whiteboard(tgetattr(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
getwhiteboardscCs|i||ddS(suAppend the given text (with a space before it) to the given 
        whiteboard. Defaults to using status_whiteboard.R
N(RX(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytappendwhiteboardscCs|i||ddS(sxPrepend the given text (with a space following it) to the given
        whiteboard. Defaults to using status_whiteboard.tprependN(RX(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytprependwhiteboardscCs|i||ddS(sqOverwrites the contents of the given whiteboard with the given text.
        Defaults to using status_whiteboard.t	overwriteN(RX(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt
setwhiteboardscCs>|i|}|o|i||n|i||dS(s$Adds the given tag to the given bug.N(RZR[R_(RttagRt
whiteboard((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytaddtagscCs|i|iS(sQGet a list of tags (basically just whitespace-split the given
        whiteboard)(RZR(RR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytgettagsscCs9|i|}|i||idi||dS(s)Removes the given tag from the given bug.t N(RcRBR_tjoin(RR`Rttags((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytdeltags
cCs |ii|i|d|dS(sAdds the given email addresses to the CC list for this bug.
        cclist: list of email addresses (strings)
        comment: optional comment to add to the bugtaddN(RRR(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytaddccscCs |ii|i|d|dS(s@Removes the given email addresses from the CC list for this bug.tdeleteN(RRR(RRR((s1/usr/lib/python2.6/site-packages/bugzilla/base.pytdeleteccs(RRRRRMRNRPRORQRRRRURVR0RWRXRZR[R]R_RbRcRgRiRk(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyR	s,										(RaRcR+tImportErrortClientCookieR/RR-tloggingt	getLoggerR3Rt__version__RR2RRRRtobjectRRt	TransportR_t
SafeTransportR^RRtBug(((s1/usr/lib/python2.6/site-packages/bugzilla/base.pyt<module>s4	3
ME

Youez - 2016 - github.com/yon3zu
LinuXploit