Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 762e4b4e451f9de4722602c03fda2c9b > files > 220

python-fedora-0.3.25.1-1.fc14.1.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Existing Services &mdash; python-fedora v0.3.25.1 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.3.25.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within python-fedora v0.3.25.1 documentation"
          href="_static/opensearch.xml"/>
    <link rel="top" title="python-fedora v0.3.25.1 documentation" href="index.html" />
    <link rel="next" title="Fedora Services" href="service.html" />
    <link rel="prev" title="Fedora Client" href="client.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="service.html" title="Fedora Services"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="client.html" title="Fedora Client"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">python-fedora v0.3.25.1 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="existing-services">
<h1>Existing Services<a class="headerlink" href="#existing-services" title="Permalink to this headline">¶</a></h1>
<p>There are many Services in Fedora.  Many of these have an interface that we
can query and get back information as <a class="reference internal" href="glossary.html#term-json"><em class="xref std std-term">JSON</em></a> data.  There is
documentation here about both the services and the client modules that can
access them.</p>
<div class="section" id="fas">
<span id="fedora-account-system"></span><span id="id1"></span><h2>Fedora Account System<a class="headerlink" href="#fas" title="Permalink to this headline">¶</a></h2>
<p>FAS is the Fedora Account System.  It holds the account data for all of our
contributors.</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<dl class="class">
<dt id="fedora.client.AccountSystem">
<em class="property">class </em><tt class="descclassname">fedora.client.</tt><tt class="descname">AccountSystem</tt><big>(</big><em>base_url='https://admin.fedoraproject.org/accounts/'</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem" title="Permalink to this definition">¶</a></dt>
<dd><p>An object for querying the Fedora Account System.</p>
<p>The Account System object provides a python API for talking to the Fedora
Account System.  It abstracts the http requests, cookie handling, and
other details so you can concentrate on the methods that are important to
your program.</p>
<dl class="method">
<dt id="fedora.client.AccountSystem.get_config">
<tt class="descname">get_config</tt><big>(</big><em>username</em>, <em>application</em>, <em>attribute</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.get_config" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the config entry for the key values.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>username</strong> &#8211; Username of the person</li>
<li><strong>application</strong> &#8211; Application for which the config is set</li>
<li><strong>attribute</strong> &#8211; Attribute key to lookup</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first">if the server returns an exception</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The unicode string that describes the value.  If no entry
matched the username, application, and attribute then None is
returned.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.get_configs_like">
<tt class="descname">get_configs_like</tt><big>(</big><em>username</em>, <em>application</em>, <em>pattern=u'*'</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.get_configs_like" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the config entries that match the keys and the pattern.</p>
<p>Note: authentication on the server will prevent anyone but the user
or a fas admin from viewing or changing their configs.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>username</strong> &#8211; Username of the person</li>
<li><strong>application</strong> &#8211; Application for which the config is set</li>
<li><strong>pattern</strong> &#8211; A pattern to select values for.  This accepts * as a
wildcard character. Default=&#8217;*&#8217;</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first">if the server returns an exception</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dict mapping <tt class="docutils literal"><span class="pre">attribute</span></tt> to <tt class="docutils literal"><span class="pre">value</span></tt>.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.group_by_id">
<tt class="descname">group_by_id</tt><big>(</big><em>group_id</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a group object based on its id</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.group_by_name">
<tt class="descname">group_by_name</tt><big>(</big><em>groupname</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_by_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a group object based on its name</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.group_data">
<tt class="descname">group_data</tt><big>(</big><em>force_refresh=None</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Return administrators/sponsors/users and group type for all groups</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>force_refresh</strong> &#8211; If true, the returned data will be queried from the
database, as opposed to memcached.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">if the query failed on the server</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">A dict mapping group names to the group type and the
user IDs of the administrator, sponsors, and users of the group.</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.8.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.group_members">
<tt class="descname">group_members</tt><big>(</big><em>groupname</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.group_members" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of people approved for a group.</p>
<p>This method returns a list of people who are in the requested group.
The people are all approved in the group.  Unapproved people are not
shown.  The format of data is:</p>
<div class="highlight-python"><pre>\[{'username': 'person1', 'role_type': 'user'},
\{'username': 'person2', 'role_type': 'sponsor'}]</pre>
</div>
<p>role_type can be one of &#8216;user&#8217;, &#8216;sponsor&#8217;, or &#8216;administrator&#8217;.</p>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.2.</span></p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return a Bunch instead of a DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.people_by_groupname">
<tt class="descname">people_by_groupname</tt><big>(</big><em>groupname</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_by_groupname" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of persons for the given groupname.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>groupname</strong> &#8211; Name of the group to look up</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">A list of person objects from the group.  If the group
contains no entries, then an empty list is returned.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.people_by_id">
<tt class="descname">people_by_id</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Deprecated</em> Use people_by_key() instead.</p>
<p>Returns a dict relating user IDs to human_name, email, username,
and bugzilla email</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return a Bunch instead of a DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.people_by_key">
<tt class="descname">people_by_key</tt><big>(</big><em>key=u'username'</em>, <em>search=u'*'</em>, <em>fields=None</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_by_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a dict of people</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>key</strong> &#8211; Key by this field.  Valid values are &#8216;id&#8217;, &#8216;username&#8217;, or
&#8216;email&#8217;.  Default is &#8216;username&#8217;</li>
<li><strong>search</strong> &#8211; Pattern to match usernames against.  Defaults to the
&#8216;*&#8217; wildcard which matches everyone.</li>
<li><strong>fields</strong> &#8211; <p>Limit the data returned to a specific list of fields.
The default is to retrieve all fields.
Valid fields are:</p>
<blockquote>
<div><ul>
<li>username</li>
<li>certificate_serial</li>
<li>locale</li>
<li>creation</li>
<li>telephone</li>
<li>status_change</li>
<li>id</li>
<li>password_changed</li>
<li>privacy</li>
<li>comments</li>
<li>latitude</li>
<li>email</li>
<li>status</li>
<li>gpg_keyid</li>
<li>internal_comments</li>
<li>postal_address</li>
<li>unverified_email</li>
<li>ssh_key</li>
<li>passwordtoken</li>
<li>ircnick</li>
<li>password</li>
<li>emailtoken</li>
<li>longitude</li>
<li>facsimile</li>
<li>human_name</li>
<li>last_seen</li>
<li>bugzilla_email</li>
</ul>
</div></blockquote>
<p>Note that for most users who access this data, many of these
fields will be set to None due to security or privacy settings.</p>
</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a dict relating the key value to the fields.</p>
</td>
</tr>
</tbody>
</table>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return a Bunch instead of a DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.people_query">
<tt class="descname">people_query</tt><big>(</big><em>constraints=None</em>, <em>columns=None</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.people_query" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of dicts representing database rows</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>constraints</strong> &#8211; A dictionary specifying WHERE constraints on columns</li>
<li><strong>columns</strong> &#8211; A list of columns to be selected in the query</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first">if the query failed on the server (most likely
because  the server was given a bad query)</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A list of dicts representing database rows (the keys of
the dict are the columns requested)</p>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.12.1.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.person_by_id">
<tt class="descname">person_by_id</tt><big>(</big><em>person_id</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.person_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a person object based on its id</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.person_by_username">
<tt class="descname">person_by_username</tt><big>(</big><em>username</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.person_by_username" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a person object based on its username</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.set_config">
<tt class="descname">set_config</tt><big>(</big><em>username</em>, <em>application</em>, <em>attribute</em>, <em>value</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.set_config" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a config entry in FAS for the user.</p>
<p>Note: authentication on the server will prevent anyone but the user
or a fas admin from viewing or changing their configs.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>username</strong> &#8211; Username of the person</li>
<li><strong>application</strong> &#8211; Application for which the config is set</li>
<li><strong>attribute</strong> &#8211; The name of the config key that we&#8217;re setting</li>
<li><strong>value</strong> &#8211; The value to set this to</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first last">if the server returns an exception</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.user_data">
<tt class="descname">user_data</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.user_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Return user data for all users in FAS</p>
<p>Note: If the user is not authorized to see password hashes,
&#8216;*&#8217; is returned for the hash.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">if the query failed on the server</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">A dict mapping user IDs to a username, password hash,
SSH public key, email address, and status.</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.8.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.user_gencert">
<tt class="descname">user_gencert</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.user_gencert" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a cert for a user</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.user_id">
<tt class="descname">user_id</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.user_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dict relating user IDs to usernames</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.AccountSystem.verify_password">
<tt class="descname">verify_password</tt><big>(</big><em>username</em>, <em>password</em><big>)</big><a class="headerlink" href="#fedora.client.AccountSystem.verify_password" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether the username and password pair are valid.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>username</strong> &#8211; username to try authenticating</li>
<li><strong>password</strong> &#8211; password for the user</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">True if the username/password are valid.  False otherwise.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="pkgdb">
<span id="package-database"></span><span id="id2"></span><h2>Package Database<a class="headerlink" href="#pkgdb" title="Permalink to this headline">¶</a></h2>
<p>The Package Database holds information about packages in Fedora.  It currently
has a developer-centric view of packages that concentrates on who the owner is
of a particular package.</p>
<p>Plans to add an end-user view to packages is ongoing.</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<dl class="class">
<dt id="fedora.client.PackageDB">
<em class="property">class </em><tt class="descclassname">fedora.client.</tt><tt class="descname">PackageDB</tt><big>(</big><em>base_url='https://admin.fedoraproject.org/pkgdb/'</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB" title="Permalink to this definition">¶</a></dt>
<dd><p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Added <tt class="xref py py-meth docutils literal"><span class="pre">PackageDB.add_comaintainers()</span></tt>
Added <tt class="xref py py-meth docutils literal"><span class="pre">PackageDB.change_owner()</span></tt></p>
<dl class="method">
<dt id="fedora.client.PackageDB.add_comaintainers">
<tt class="descname">add_comaintainers</tt><big>(</big><em>owner</em>, <em>comaintainers</em>, <em>pkg_pattern</em>, <em>collectn_name</em>, <em>collectn_ver=None</em>, <em>if_comaint=False</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.add_comaintainers" title="Permalink to this definition">¶</a></dt>
<dd><p>Add comaintainers to all packagelistings that the owner either
is the owner or has approveacls on.  Then email comaintainers/owners
on those packages that the maintainer has changed the acls.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>owner</strong> &#8211; the owner&#8217;s username</li>
<li><strong>comaintainers</strong> &#8211; a list of new comaintainers</li>
<li><strong>pkg_pattern</strong> &#8211; a simple pattern for package names</li>
<li><strong>collectn_name</strong> &#8211; limit packages to branches for this distribution.</li>
<li><strong>collectn_ver</strong> &#8211; If given, limit information to this particular
version of a distribution.</li>
<li><strong>if_comaint</strong> &#8211; Boolean.  If True, then process packagelistings for
which owner is also a co-maintainer (i.e., has approveacls).</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.21.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.add_package">
<tt class="descname">add_package</tt><big>(</big><em>pkg</em>, <em>owner=None</em>, <em>description=None</em>, <em>branches=None</em>, <em>cc_list=None</em>, <em>comaintainers=None</em>, <em>groups=None</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.add_package" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a package to the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>pkg</strong> &#8211; Name of the package to edit</li>
<li><strong>owner</strong> &#8211; If set, make this person the owner of both branches</li>
<li><strong>description</strong> &#8211; If set, make this the description of both branches</li>
<li><strong>branches</strong> &#8211; List of branches to operate on</li>
<li><strong>cc_list</strong> &#8211; If set, list or tuple of usernames to watch the
package.</li>
<li><strong>comaintainers</strong> &#8211; If set, list or tuple of usernames to comaintain
the package.</li>
<li><strong>groups</strong> &#8211; If set, list or tuple of group names that can commit to
the package.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first last">If the server returns an error</p>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.13.</span></p>
</dd></dl>

<dl class="attribute">
<dt id="fedora.client.PackageDB.branches">
<tt class="descname">branches</tt><a class="headerlink" href="#fedora.client.PackageDB.branches" title="Permalink to this definition">¶</a></dt>
<dd><p>Return collection branch information from the packagedb.</p>
<p>This method caches the branch information from the packagedb in
self._branches.  It returns that information when called.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>refresh</strong> &#8211; If refresh is set to True, contact the server even if
the information was previously cached</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">dictionary of branches keyed by their shortname</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.canonical_branch_name">
<tt class="descname">canonical_branch_name</tt><big>(</big><em>branch</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.canonical_branch_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Change a branch abbreviation into a name and version.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>branch</strong> &#8211; branch abbreviation</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body">tuple</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">tuple of branch name and branch version.</td>
</tr>
</tbody>
</table>
<p>Example:
&gt;&gt;&gt; name, version = canonical_branch_name(&#8216;FC-6&#8217;)
&gt;&gt;&gt; name
Fedora
&gt;&gt;&gt; version
6</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.change_owner">
<tt class="descname">change_owner</tt><big>(</big><em>owner</em>, <em>new_owner</em>, <em>pkg_pattern</em>, <em>collectn_name</em>, <em>collectn_ver=None</em>, <em>if_comaint=False</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.change_owner" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the owner of all packagelistings that the owner either is
the owner or has approveacls on.  Then email comaintainers/owners
on those packages that the owner has changed the owner.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>owner</strong> &#8211; the current owner&#8217;s username</li>
<li><strong>new_owner</strong> &#8211; the new owner&#8217;s username</li>
<li><strong>pkg_pattern</strong> &#8211; a simple pattern for package names</li>
<li><strong>collectn_name</strong> &#8211; limit packages to branches for this distribution.</li>
<li><strong>collectn_ver</strong> &#8211; If given, limit information to this
particular version of a distribution.</li>
<li><strong>if_comaint</strong> &#8211; Boolean.  If True, then process packagelistings for
which owner is also a co-maintainer (i.e., has approveacls).</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.21.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.clone_branch">
<tt class="descname">clone_branch</tt><big>(</big><em>pkg</em>, <em>branch</em>, <em>master</em>, <em>email_log=True</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.clone_branch" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a branch&#8217;s permissions from a pre-existing branch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>pkg</strong> &#8211; Name of the package to branch</li>
<li><strong>branch</strong> &#8211; Branch to clone to.  Allowed branch names are listed in
<tt class="xref py py-data docutils literal"><span class="pre">COLLECTIONMAP</span></tt></li>
<li><strong>master</strong> &#8211; Short branch name to clone from.  Allowed branch names
are listed in <tt class="xref py py-data docutils literal"><span class="pre">COLLECTIONMAP</span></tt></li>
<li><strong>email_log</strong> &#8211; If False, do not email a copy of the log.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first last">If the server returns an exceptiom</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.edit_package">
<tt class="descname">edit_package</tt><big>(</big><em>pkg</em>, <em>owner=None</em>, <em>description=None</em>, <em>branches=None</em>, <em>cc_list=None</em>, <em>comaintainers=None</em>, <em>groups=None</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.edit_package" title="Permalink to this definition">¶</a></dt>
<dd><p>Edit a package.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>pkg</strong> &#8211; Name of the package to edit</li>
<li><strong>owner</strong> &#8211; If set, make this person the owner of both branches</li>
<li><strong>description</strong> &#8211; If set, make this the description of both branches</li>
<li><strong>branches</strong> &#8211; List of branches to operate on</li>
<li><strong>cc_list</strong> &#8211; If set, list or tuple of usernames to watch the
package.</li>
<li><strong>comaintainers</strong> &#8211; If set, list or tuple of usernames to comaintain
the package.</li>
<li><strong>groups</strong> &#8211; If set, list or tuple of group names that can commit to
the package.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first last">If the server returns an error</p>
</td>
</tr>
</tbody>
</table>
<p>This method takes information about a package and either edits the
package to reflect the changes to information.</p>
<p>Note: This method will be going away in favor of methods that do
smaller chunks of work:</p>
<ol class="arabic simple">
<li>A method to add a new branch</li>
<li>A method to edit an existing package</li>
<li>A method to edit an existing branch</li>
</ol>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.13.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_bugzilla_acls">
<tt class="descname">get_bugzilla_acls</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_bugzilla_acls" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the package attributes used by bugzilla.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Return type:</th><td class="field-body">Bunch</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><cite>Bunch</cite> contains information needed to setup bugzilla
for every collection.  It looks like this:
data[collctn][pkg][attribute] where attribute is one of:
:owner: FAS username for the owner
:qacontact: if the package hasa special qacontact, their userid is listed here
:summary: Short description of the package
:cclist: list of FAS userids that are watching the package<dl class="docutils">
<dt>Example::</dt>
<dd><div class="first last highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;Fedora&#39;</span><span class="p">][</span><span class="s">&#39;bzr&#39;</span><span class="p">][</span><span class="s">&#39;owner&#39;</span><span class="p">]</span>
<span class="go">&#39;toshio&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;Fedora&#39;</span><span class="p">][</span><span class="s">&#39;bzr&#39;</span><span class="p">][</span><span class="s">&#39;qacontact&#39;</span><span class="p">]</span>
<span class="go">None</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;Fedora&#39;</span><span class="p">][</span><span class="s">&#39;bzr&#39;</span><span class="p">][</span><span class="s">&#39;summary&#39;</span><span class="p">]</span>
<span class="go">&#39;Friendly distributed version control system&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;Fedora&#39;</span><span class="p">][</span><span class="s">&#39;bzr&#39;</span><span class="p">][</span><span class="s">&#39;cclist&#39;</span><span class="p">]</span>
<span class="go">{&#39;groups&#39;: [], &#39;people&#39;: [&#39;hno&#39;, &#39;shahms&#39;, &#39;toshio&#39;]}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="go">[&#39;Fedora OLPC&#39;, &#39;Fedora&#39;, &#39;Fedora EPEL&#39;]</span>
</pre></div>
</div>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.15.</span></p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return Bunch instead of DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_collection_list">
<tt class="descname">get_collection_list</tt><big>(</big><em>eol=True</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_collection_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve a list of all collections.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>eol</strong> &#8211; Default True.  If set to False, do not return collections
marked eol.</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">list of collections</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_critpath_pkgs">
<tt class="descname">get_critpath_pkgs</tt><big>(</big><em>collctn_list=None</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_critpath_pkgs" title="Permalink to this definition">¶</a></dt>
<dd><p>Return names of packages marked critical path.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>collctn_list</strong> &#8211; When set to a list of Collection names, only
retrieve packages which are marked critpath in any of the
collections.  Defaults to retrieving critpath packages in all
non-EOL releases</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body">Bunch</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">Keys of the returned dict are collection simple names.  The
values are lists of package names that are marked critpath</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.17.</span></p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return Bunch instead of DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_notify_acls">
<tt class="descname">get_notify_acls</tt><big>(</big><em>collctn_name=None</em>, <em>collctn_ver=None</em>, <em>eol=False</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_notify_acls" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the package attibutes used by notify</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>collctn_name</strong> &#8211; Limit the packages to those in collection with
this name.  for instance, &#8216;Fedora&#8217;, &#8216;Fedora EPEL&#8217;, &#8216;Fedora OLPC&#8217;.</li>
<li><strong>collctn_ver</strong> &#8211; If collctn_name is specified, this allows you to
also limit to a specific version of a collection.  If collctn_name
isn&#8217;t specified, this option does nothing.</li>
<li><strong>eol</strong> &#8211; If eol is set to True, include eol distributions in the
notify list.  Default: False</li>
<li><strong>role_list</strong> &#8211; Note, this will not do anything until pkgdb-0.5.
List of roles that the user must have the acls for in order to be
included.  Valid roles are: owner, comaintainer, committer,
bzwatcher, and vcswatcher</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Bunch</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><cite>Bunch</cite> keyed on package name.  Each entry has a list
of people to be notified for this package.</p>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.15.</span></p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return Bunch instead of DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_owners">
<tt class="descname">get_owners</tt><big>(</big><em>package</em>, <em>collctn_name=None</em>, <em>collctn_ver=None</em>, <em>collection=None</em>, <em>collection_ver=None</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_owners" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the ownership information for a package.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>package</strong> &#8211; Name of the package to retrieve package information about.</li>
<li><strong>collctn_name</strong> &#8211; Limit the returned information to this collection
(&#8216;Fedora&#8217;, &#8216;Fedora EPEL&#8217;, Fedora OLPC&#8217;, etc)</li>
<li><strong>collctn_ver</strong> &#8211; If collection is specified, further limit to this
version of the collection.</li>
<li><strong>collection</strong> &#8211; old/deprecated argument; use collctn_name</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Kward collection_ver:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first">old/deprecated argument; use collctn_ver</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first">If the server returns an error</p>
</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">Bunch</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">dict of ownership information for the package</p>
</td>
</tr>
</tbody>
</table>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.17: </span>Rename collection and collection_ver to collctn_name and collctn_ver</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return Bunch instead of DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_package_info">
<tt class="descname">get_package_info</tt><big>(</big><em>pkg</em>, <em>branch=None</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_package_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Get information about the package.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>pkg</strong> &#8211; Name of the package</li>
<li><strong>branch</strong> &#8211; If given, restrict information returned to this branch
Allowed branches are listed in <tt class="xref py py-data docutils literal"><span class="pre">COLLECTIONMAP</span></tt></li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first">If the server returns an exceptiom</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Package ownership information</p>
</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">Bunch</p>
</td>
</tr>
</tbody>
</table>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return Bunch instead of DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_package_list">
<tt class="descname">get_package_list</tt><big>(</big><em>collctn=None</em>, <em>collectn=None</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_package_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve a list of all package names in a collection.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>collctn</strong> &#8211; Collection to look for packages in.  This is a collctn
shortname like &#8216;devel&#8217; or &#8216;F-13&#8217;.  If unset, return packages in
all collections</li>
<li><strong>collectn</strong> &#8211; <em>Deprecated</em>.  Please use collctn instead</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">list of package names present in the collection.</p>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.15.</span></p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.17: </span>Rename collectn to collctn</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.get_vcs_acls">
<tt class="descname">get_vcs_acls</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.get_vcs_acls" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the acls for the version control system.</p>
<p>Note: the return values from this function will be changing when the
PackageDB updates to 0.5.x.  The return data will look like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">data</span><span class="p">[</span><span class="n">pkg</span><span class="p">][</span><span class="n">branch</span><span class="p">]</span><span class="o">.</span><span class="n">people</span>
<span class="n">data</span><span class="p">[</span><span class="n">pkg</span><span class="p">][</span><span class="n">branch</span><span class="p">]</span><span class="o">.</span><span class="n">groups</span>
</pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Return type:</th><td class="field-body">Bunch</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><cite>Bunch</cite> representing the vcs acls for every person.
It looks like this: data[pkg][branch][&#8216;commit&#8217;].people list of
users who can commit to the package.  Example:<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;bzr&#39;</span><span class="p">][</span><span class="s">&#39;devel&#39;</span><span class="p">][</span><span class="s">&#39;commit&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">people</span>
<span class="go">[&#39;toshio&#39;, &#39;hno&#39;, &#39;shahms&#39;, &#39;toshio&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;bzr&#39;</span><span class="p">][</span><span class="s">&#39;devel&#39;</span><span class="p">][</span><span class="s">&#39;commit&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">groups</span>
<span class="go">[&#39;provenpackager&#39;]</span>
</pre></div>
</div>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.15.</span></p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.21: </span>Return Bunch instead of DictContainer</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.mass_branch">
<tt class="descname">mass_branch</tt><big>(</big><em>branch</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.mass_branch" title="Permalink to this definition">¶</a></dt>
<dd><p>Branch all unblocked packages for a new release.</p>
<p>Mass branching always works against the devel branch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>branch</strong> &#8211; Branch name to create branches for.  Names are listed in
<tt class="xref py py-data docutils literal"><span class="pre">COLLECTIONMAP</span></tt></td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Raises AppError:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">If the server returns an exceptiom.  The &#8216;extras&#8217;
attribute will contain a list of unbranched packages if some of the
packages were branched</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.orphan_packages">
<tt class="descname">orphan_packages</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.orphan_packages" title="Permalink to this definition">¶</a></dt>
<dd><p>List the packages which are orphaned</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">List of pkgs which are orphaned in any non-EOL release.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.remove_user">
<tt class="descname">remove_user</tt><big>(</big><em>username</em>, <em>pkg_name</em>, <em>collctn_list=None</em>, <em>collectn_list=None</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.remove_user" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove user from a package</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>username</strong> &#8211; Name of user to remove from the package</li>
<li><strong>pkg_name</strong> &#8211; Name of the package</li>
<li><strong>collctn_list</strong> &#8211; list of collection simple names like
&#8216;F-10&#8217;,&#8217;devel&#8217;.  Default: None which means user removed from all
collections associated with the package.</li>
<li><strong>collectn_list</strong> &#8211; <em>Deprecated</em> Use collctn_list instead.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">status code from the request</p>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.12.</span></p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.3.17: </span>Rename collectn_list to collctn_list</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.set_critpath">
<tt class="descname">set_critpath</tt><big>(</big><em>pkg_list=None</em>, <em>critpath=True</em>, <em>collctn_list=None</em>, <em>reset=False</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.set_critpath" title="Permalink to this definition">¶</a></dt>
<dd><p>Mark packages as being in the critical path.</p>
<p>Critical path packages are subject to more testing or stringency of
criteria for updating when a release occurs.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>pkg_list</strong> &#8211; List of package names to set as critical path.
Default: all packages within <cite>collectn_list</cite></li>
<li><strong>critpath</strong> &#8211; Boolean.  True (default) means this package is in the
critical path.  False means that it should be taken out</li>
<li><strong>collctn_list</strong> &#8211; List of collection shortnames that this change
will be applied on.  The default is all non-EOL collections.</li>
<li><strong>reset</strong> &#8211; If True, clear the critpath flag from all packages in
collectn_list before setting critpath on the packages in pkg_list.
Default is False</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.17.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.PackageDB.user_packages">
<tt class="descname">user_packages</tt><big>(</big><em>username</em>, <em>acls=None</em>, <em>eol=False</em><big>)</big><a class="headerlink" href="#fedora.client.PackageDB.user_packages" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve information about the packages a user owns</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>username</strong> &#8211; user whose packages we want</li>
<li><strong>acls</strong> &#8211; list of acls that the user must have on the package.
The list can include &#8216;owner&#8217;, &#8216;approveacls&#8217;, &#8216;commit&#8217;,
&#8216;watchbugzilla&#8217;, &#8216;watchcommits&#8217;.  Default is to select for all
acls.</li>
<li><strong>eol</strong> &#8211; If True, then include ownership of packages in End of Life
distributions.  If False, only include ownership of packages in
active releases.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">packages that the user has acls on</p>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.14.</span></p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="bodhi-the-update-server">
<span id="bodhi"></span><h2>Bodhi, the Update Server<a class="headerlink" href="#bodhi-the-update-server" title="Permalink to this headline">¶</a></h2>
<p>Bodhi is used to push updates from the build system to the download
repositories.  It lets packagers send packages to the testing repository or to
the update repository.</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
<dl class="class">
<dt id="fedora.client.BodhiClient">
<em class="property">class </em><tt class="descclassname">fedora.client.</tt><tt class="descname">BodhiClient</tt><big>(</big><em>base_url='https://admin.fedoraproject.org/updates/'</em>, <em>useragent='Fedora Bodhi Client/0.5.1'</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="fedora.client.BodhiClient.candidates">
<tt class="descname">candidates</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.candidates" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a list list of update candidates.</p>
<p>This method is a generator that returns a list of koji builds that
could potentially be pushed as updates.</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.comment">
<tt class="descname">comment</tt><big>(</big><em>update</em>, <em>comment</em>, <em>karma=0</em>, <em>email=None</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.comment" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a comment to an update.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>update</strong> &#8211; The title of the update comment on.</li>
<li><strong>comment</strong> &#8211; The text of the comment.</li>
<li><strong>karma</strong> &#8211; The karma of this comment (-1, 0, 1)</li>
<li><strong>email</strong> &#8211; Whether or not to trigger email notifications</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.delete">
<tt class="descname">delete</tt><big>(</big><em>update</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Delete an update.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>update</strong> &#8211; The title of the update to delete</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.get_koji_session">
<tt class="descname">get_koji_session</tt><big>(</big><em>login=True</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.get_koji_session" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an authenticated koji session</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.get_releases">
<tt class="descname">get_releases</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.get_releases" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of bodhi releases.</p>
<p>This method returns a dictionary in the following format:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span><span class="s">&quot;releases&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span><span class="s">&quot;dist_tag&quot;</span><span class="p">:</span> <span class="s">&quot;dist-f12&quot;</span><span class="p">,</span> <span class="s">&quot;id_prefix&quot;</span><span class="p">:</span> <span class="s">&quot;FEDORA&quot;</span><span class="p">,</span>
     <span class="s">&quot;locked&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span> <span class="s">&quot;name&quot;</span><span class="p">:</span> <span class="s">&quot;F12&quot;</span><span class="p">,</span> <span class="s">&quot;long_name&quot;</span><span class="p">:</span> <span class="s">&quot;Fedora 12&quot;</span><span class="p">}]}</span>
</pre></div>
</div>
</dd></dl>

<dl class="attribute">
<dt id="fedora.client.BodhiClient.koji_session">
<tt class="descname">koji_session</tt><a class="headerlink" href="#fedora.client.BodhiClient.koji_session" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an authenticated koji session</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.latest_builds">
<tt class="descname">latest_builds</tt><big>(</big><em>package</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.latest_builds" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a list of the latest builds for this package.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>package</strong> &#8211; package name to find builds for.</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">a dictionary of the release dist tag to the latest build.</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.3.2.</span></p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.masher">
<tt class="descname">masher</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.masher" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the status of bodhi&#8217;s masher</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.parse_file">
<tt class="descname">parse_file</tt><big>(</big><em>input_file</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.parse_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse an update template file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>input_file</strong> &#8211; The filename of the update template.</td>
</tr>
</tbody>
</table>
<p>Returns an array of dictionaries of parsed update values which
can be directly passed to the <tt class="docutils literal"><span class="pre">save</span></tt> method.</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.push">
<tt class="descname">push</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.push" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of requests</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.push_updates">
<tt class="descname">push_updates</tt><big>(</big><em>updates</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.push_updates" title="Permalink to this definition">¶</a></dt>
<dd><p>Push a list of updates.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>updates</strong> &#8211; A list of update titles to <tt class="docutils literal"><span class="pre">push</span></tt>.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.query">
<tt class="descname">query</tt><big>(</big><em>release=None</em>, <em>status=None</em>, <em>type_=None</em>, <em>bugs=None</em>, <em>request=None</em>, <em>mine=None</em>, <em>package=None</em>, <em>username=None</em>, <em>limit=10</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.query" title="Permalink to this definition">¶</a></dt>
<dd><p>Query bodhi for a list of updates.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>release</strong> &#8211; The release that you wish to query updates for.</li>
<li><strong>status</strong> &#8211; The update status (<tt class="docutils literal"><span class="pre">pending</span></tt>, <tt class="docutils literal"><span class="pre">testing</span></tt>, <tt class="docutils literal"><span class="pre">stable</span></tt>,
<tt class="docutils literal"><span class="pre">obsolete</span></tt>)</li>
<li><strong>type</strong> &#8211; The type of this update: <tt class="docutils literal"><span class="pre">security</span></tt>, <tt class="docutils literal"><span class="pre">bugfix</span></tt>,
<tt class="docutils literal"><span class="pre">enhancement</span></tt>, and <tt class="docutils literal"><span class="pre">newpackage</span></tt>.</li>
<li><strong>bugs</strong> &#8211; A list of Red Hat Bugzilla ID&#8217;s</li>
<li><strong>request</strong> &#8211; An update request to query for
<tt class="docutils literal"><span class="pre">testing</span></tt>, <tt class="docutils literal"><span class="pre">stable</span></tt>, <tt class="docutils literal"><span class="pre">unpush</span></tt>, <tt class="docutils literal"><span class="pre">obsolete</span></tt> or None.</li>
<li><strong>mine</strong> &#8211; If True, only query the users updates.  Default: False.</li>
<li><strong>package</strong> &#8211; A package name or a name-version-release.</li>
<li><strong>limit</strong> &#8211; The maximum number of updates to display.  Default: 10.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.request">
<tt class="descname">request</tt><big>(</big><em>update</em>, <em>request</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.request" title="Permalink to this definition">¶</a></dt>
<dd><p>Request an update state change.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>update</strong> &#8211; The title of the update</li>
<li><strong>request</strong> &#8211; The request (<tt class="docutils literal"><span class="pre">testing</span></tt>, <tt class="docutils literal"><span class="pre">stable</span></tt>, <tt class="docutils literal"><span class="pre">obsolete</span></tt>)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.save">
<tt class="descname">save</tt><big>(</big><em>builds=''</em>, <em>type_=''</em>, <em>bugs=''</em>, <em>notes=''</em>, <em>request='testing'</em>, <em>close_bugs=True</em>, <em>suggest_reboot=False</em>, <em>inheritance=False</em>, <em>autokarma=True</em>, <em>stable_karma=3</em>, <em>unstable_karma=-3</em>, <em>edited=''</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.save" title="Permalink to this definition">¶</a></dt>
<dd><p>Save an update.</p>
<p>This entails either creating a new update, or editing an existing one.
To edit an existing update, you must specify the update title in
the <tt class="docutils literal"><span class="pre">edited</span></tt> keyword argument.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>builds</strong> &#8211; A list of koji builds for this update.</li>
<li><strong>type_</strong> &#8211; The type of this update: <tt class="docutils literal"><span class="pre">security</span></tt>, <tt class="docutils literal"><span class="pre">bugfix</span></tt>,
<tt class="docutils literal"><span class="pre">enhancement</span></tt>, and <tt class="docutils literal"><span class="pre">newpackage</span></tt>.</li>
<li><strong>bugs</strong> &#8211; A list of Red Hat Bugzilla ID&#8217;s associated with this
update.</li>
<li><strong>notes</strong> &#8211; Details as to why this update exists.</li>
<li><strong>request</strong> &#8211; Request for this update to change state, either to
<tt class="docutils literal"><span class="pre">testing</span></tt>, <tt class="docutils literal"><span class="pre">stable</span></tt>, <tt class="docutils literal"><span class="pre">unpush</span></tt>, <tt class="docutils literal"><span class="pre">obsolete</span></tt> or None.</li>
<li><strong>close_bugs</strong> &#8211; Close bugs when update is stable</li>
<li><strong>suggest_reboot</strong> &#8211; Suggest that the user reboot after update.</li>
<li><strong>inheritance</strong> &#8211; Follow koji build inheritance, which may result in
this update being pushed out to additional releases.</li>
<li><strong>autokarma</strong> &#8211; Allow bodhi to automatically change the state of this
update based on the <tt class="docutils literal"><span class="pre">karma</span></tt> from user feedback.  It will
push your update to <tt class="docutils literal"><span class="pre">stable</span></tt> once it reaches the <tt class="docutils literal"><span class="pre">stable_karma</span></tt>
and unpush your update when reaching <tt class="docutils literal"><span class="pre">unstable_karma</span></tt>.</li>
<li><strong>stable_karma</strong> &#8211; The upper threshold for marking an update as
<tt class="docutils literal"><span class="pre">stable</span></tt>.</li>
<li><strong>unstable_karma</strong> &#8211; The lower threshold for unpushing an update.</li>
<li><strong>edited</strong> &#8211; The update title of the existing update that we are
editing.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.testable">
<tt class="descname">testable</tt><big>(</big><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.testable" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a list of installed testing updates.</p>
<p>This method is a generate that yields packages that you currently
have installed that you have yet to test and provide feedback for.</p>
</dd></dl>

<dl class="method">
<dt id="fedora.client.BodhiClient.update_str">
<tt class="descname">update_str</tt><big>(</big><em>update</em>, <em>minimal=False</em><big>)</big><a class="headerlink" href="#fedora.client.BodhiClient.update_str" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a string representation of a given update dictionary.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>update</strong> &#8211; An update dictionary, acquired by the <tt class="docutils literal"><span class="pre">list</span></tt> method.</li>
<li><strong>minimal</strong> &#8211; Return a minimal one-line representation of the update.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Existing Services</a><ul>
<li><a class="reference internal" href="#fas">Fedora Account System</a><ul>
</ul>
</li>
<li><a class="reference internal" href="#pkgdb">Package Database</a><ul>
</ul>
</li>
<li><a class="reference internal" href="#bodhi-the-update-server">Bodhi, the Update Server</a><ul>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="client.html"
                        title="previous chapter">Fedora Client</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="service.html"
                        title="next chapter">Fedora Services</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/existing.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="service.html" title="Fedora Services"
             >next</a> |</li>
        <li class="right" >
          <a href="client.html" title="Fedora Client"
             >previous</a> |</li>
        <li><a href="index.html">python-fedora v0.3.25.1 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2007-2011 Red Hat, Inc..
      Last updated on Nov 02, 2011.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>