[Python-modules-commits] [python-fedora] 01/09: Import python-fedora_0.8.0.orig.tar.gz

Sergio Durigan Junior sergiodj-guest at moszumanska.debian.org
Tue Jul 19 23:50:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

sergiodj-guest pushed a commit to branch master
in repository python-fedora.

commit 91f9079733044796c022325313868b95346c236b
Author: Sergio Durigan Junior <sergiodj at sergiodj.net>
Date:   Tue Jul 5 00:03:22 2016 -0400

    Import python-fedora_0.8.0.orig.tar.gz
---
 MANIFEST.in                                     |   2 +-
 NEWS                                            | 142 ++++-
 PKG-INFO                                        |   7 +-
 README => README.rst                            | 172 +++---
 doc/api.rst                                     |   2 +-
 doc/client.rst                                  |  29 +-
 doc/existing.rst                                |  31 +-
 doc/flask_fas_openid.rst                        |   1 -
 fedora/accounts/__init__.py                     |   3 -
 fedora/accounts/fas2.py                         |  12 -
 fedora/client/__init__.py                       |  20 +-
 fedora/client/baseclient.py                     |  26 +-
 fedora/client/bodhi.py                          | 566 ++++++++++++++++--
 fedora/client/fas2.py                           |  55 +-
 fedora/client/openidbaseclient.py               | 313 +++++-----
 fedora/client/openidproxyclient.py              |  44 +-
 fedora/client/pkgdb.py                          | 731 ------------------------
 fedora/client/proxyclient.py                    |  36 +-
 fedora/client/wiki.py                           |  38 +-
 fedora/compat25/__init__.py                     |  13 -
 fedora/django/__init__.py                       |   2 -
 fedora/django/auth/models.py                    |  14 +-
 fedora/release.py                               |  10 +-
 fedora/tg/identity/jsonfasprovider1.py          |   2 +-
 fedora/tg/identity/jsonfasprovider2.py          |  16 +-
 fedora/tg/utils.py                              |  15 +-
 fedora/tg/widgets.py                            |  13 +-
 fedora/tg2/utils.py                             |  16 +-
 fedora/urlutils.py                              |   8 +-
 fedora/wsgi/csrf.py                             |  10 +-
 fedora/wsgi/faswho/faswhoplugin.py              |   8 +-
 flask_fas.py                                    | 204 -------
 flask_fas_openid.py                             |  75 ++-
 python-fedora.spec                              | 313 ----------
 python_fedora.egg-info/PKG-INFO                 |   7 +-
 python_fedora.egg-info/SOURCES.txt              |  87 ++-
 python_fedora.egg-info/entry_points.txt         |  10 +-
 python_fedora.egg-info/requires.txt             |   6 +-
 python_fedora.egg-info/top_level.txt            |   3 +-
 releaseutils.py                                 |  12 +-
 setup.py                                        |  25 +-
 tests/__init__.py                               |   0
 tests/functional/__init__.py                    |   0
 tests/functional/functional_test_utils.py       |  31 +
 tests/functional/test_openidbaseclient.py       |  62 ++
 tests/test_urlutils.py                          |  53 ++
 translations/{python-fedora.pot => af.po}       |  29 +-
 translations/{python-fedora.pot => am.po}       |  29 +-
 translations/{python-fedora.pot => anp.po}      |  29 +-
 translations/{python-fedora.pot => ar.po}       |  29 +-
 translations/{python-fedora.pot => as.po}       |  29 +-
 translations/{python-fedora.pot => ast.po}      |  29 +-
 translations/{python-fedora.pot => bal.po}      |  29 +-
 translations/{python-fedora.pot => be.po}       |  29 +-
 translations/{python-fedora.pot => bg.po}       |  29 +-
 translations/{python-fedora.pot => bn.po}       |  29 +-
 translations/{python-fedora.pot => bn_IN.po}    |  29 +-
 translations/{python-fedora.pot => bo.po}       |  29 +-
 translations/{python-fedora.pot => br.po}       |  29 +-
 translations/{python-fedora.pot => brx.po}      |  29 +-
 translations/{python-fedora.pot => bs.po}       |  29 +-
 translations/ca.po                              |  96 ++--
 translations/cs.po                              |  38 +-
 translations/{python-fedora.pot => cy.po}       |  29 +-
 translations/da.po                              |  74 ++-
 translations/de.po                              |  76 ++-
 translations/{python-fedora.pot => de_CH.po}    |  29 +-
 translations/{python-fedora.pot => el.po}       |  29 +-
 translations/{python-fedora.pot => en_GB.po}    |  29 +-
 translations/{python-fedora.pot => eo.po}       |  29 +-
 translations/es.po                              |  76 ++-
 translations/{python-fedora.pot => et.po}       |  29 +-
 translations/{python-fedora.pot => eu.po}       |  29 +-
 translations/{python-fedora.pot => fa.po}       |  29 +-
 translations/{python-fedora.pot => fi.po}       |  29 +-
 translations/fr.po                              |  77 ++-
 translations/{python-fedora.pot => gl.po}       |  29 +-
 translations/{python-fedora.pot => gu.po}       |  29 +-
 translations/{python-fedora.pot => he.po}       |  29 +-
 translations/{python-fedora.pot => hi.po}       |  29 +-
 translations/{python-fedora.pot => hr.po}       |  29 +-
 translations/hu.po                              |  70 ++-
 translations/{python-fedora.pot => ia.po}       |  29 +-
 translations/id.po                              |  15 +-
 translations/{python-fedora.pot => ilo.po}      |  29 +-
 translations/{python-fedora.pot => is.po}       |  29 +-
 translations/it.po                              |  75 ++-
 translations/ja.po                              |  63 +-
 translations/{python-fedora.pot => ka.po}       |  29 +-
 translations/{python-fedora.pot => kk.po}       |  29 +-
 translations/{python-fedora.pot => km.po}       |  29 +-
 translations/{python-fedora.pot => kn.po}       |  29 +-
 translations/{python-fedora.pot => ko.po}       |  29 +-
 translations/{python-fedora.pot => kw.po}       |  29 +-
 translations/{python-fedora.pot => kw at kkcor.po} |  29 +-
 translations/{python-fedora.pot => kw at uccor.po} |  29 +-
 translations/{python-fedora.pot => kw_GB.po}    |  29 +-
 translations/{python-fedora.pot => ky.po}       |  29 +-
 translations/{python-fedora.pot => lv.po}       |  29 +-
 translations/{python-fedora.pot => mai.po}      |  29 +-
 translations/{python-fedora.pot => mk.po}       |  29 +-
 translations/{python-fedora.pot => ml.po}       |  29 +-
 translations/{python-fedora.pot => mn.po}       |  29 +-
 translations/{python-fedora.pot => mr.po}       |  29 +-
 translations/{python-fedora.pot => ms.po}       |  29 +-
 translations/nb.po                              |  15 +-
 translations/{python-fedora.pot => nds.po}      |  29 +-
 translations/{python-fedora.pot => ne.po}       |  29 +-
 translations/nl.po                              |  82 ++-
 translations/{python-fedora.pot => nn.po}       |  29 +-
 translations/{python-fedora.pot => nso.po}      |  29 +-
 translations/{python-fedora.pot => or.po}       |  29 +-
 translations/{python-fedora.pot => pa.po}       |  29 +-
 translations/pl.po                              |  83 ++-
 translations/pt.po                              |  48 +-
 translations/pt_BR.po                           |  75 ++-
 translations/python-fedora.pot                  |  24 +-
 translations/{python-fedora.pot => ro.po}       |  29 +-
 translations/ru.po                              |  44 +-
 translations/{python-fedora.pot => si.po}       |  29 +-
 translations/{python-fedora.pot => sk.po}       |  29 +-
 translations/{python-fedora.pot => sl.po}       |  29 +-
 translations/{python-fedora.pot => sq.po}       |  29 +-
 translations/{python-fedora.pot => sr.po}       |  29 +-
 translations/{id.po => sr at latin.po}             |  17 +-
 translations/sv.po                              |  74 ++-
 translations/{python-fedora.pot => ta.po}       |  29 +-
 translations/{python-fedora.pot => te.po}       |  29 +-
 translations/{python-fedora.pot => tg.po}       |  29 +-
 translations/th.po                              |  62 +-
 translations/tr.po                              |  48 +-
 translations/{python-fedora.pot => tw.po}       |  29 +-
 translations/uk.po                              |  82 ++-
 translations/{python-fedora.pot => ur.po}       |  29 +-
 translations/{python-fedora.pot => vi.po}       |  29 +-
 translations/{python-fedora.pot => wba.po}      |  29 +-
 translations/{python-fedora.pot => yo.po}       |  29 +-
 translations/zh_CN.po                           |  55 +-
 translations/{python-fedora.pot => zh_HK.po}    |  29 +-
 translations/zh_TW.po                           |  40 +-
 translations/{python-fedora.pot => zu.po}       |  29 +-
 141 files changed, 3185 insertions(+), 3528 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
index 8a6059f..f7a740f 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,7 +1,7 @@
 include setup.py
 include releaseutils.py
 include *.spec
-include COPYING AUTHORS NEWS
+include COPYING AUTHORS NEWS README.rst
 recursive-include doc *
 include fedora/tg/templates/genshi/*.html
 include fedora/tg2/templates/mako/*.mak
diff --git a/NEWS b/NEWS
index 03eeefa..0a5aff2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,146 @@ NEWS
 ====
 
 :Authors: Toshio Kuratomi, Luke Macken, Ricky Elrod, Patrick Uiterwijk, Ralph Bean
-:Date: 6 Aug 2014
-:Version: 0.3.x
+:Date: 21 Apr 2016
+:Version: 0.8.x
+
+
+-----
+0.8.0
+-----
+
+* Removed python 2.5 compatibility code
+* Various python 3 fixes
+* Documentation fixes
+* OpenID endpoint check
+* Cookie clearing on login in openidbaseclient
+* Removed flask_fas backwards compatibility module
+
+-----
+0.7.1
+-----
+
+* Fix a regression in BodhiClient config parsing introduced in 0.7.0.
+
+-----
+0.7.0
+-----
+
+* Removed the pkgdb1 client.  The server has been gone for over a year now.
+* Removed the flask_fas server component in favor of flask_fas_openid.
+* Updated flask_fas_openid to forward along ssh and gpg public key information.
+* Python3 compat enhancements from Craig Rodrigues and Ville Skyttä.
+
+-----
+0.6.4
+-----
+
+* Bodhi2Client query: document new _before query params
+* Also perform request retries for failed POST requests.
+
+-----
+0.6.3
+-----
+
+* Adjust download URL for pypi.
+
+-----
+0.6.2
+-----
+
+* Force the Bodhi2 url in the BodhiClient shim (for /usr/bin/bodhi).
+
+-----
+0.6.1
+-----
+
+* Fix a bug in the BodhiClient where the Bodhi2Client would try to use the old
+  Bodhi1 base url.
+* Raise an AuthError if no username or password is provided to the openid login
+  function.
+
+-----
+0.6.0
+-----
+
+* Cache session cookies between use for clients using OpenID.
+* Retry failed requests for clients using OpenID
+* Remove Bodhi server version detection code.
+* Python3 support for the BodhiClient.
+* Drop support for python-requests-1.x
+
+-----
+0.5.6
+-----
+
+* Python2.6 fix for string formatting in the BodhiClient.
+
+-----
+0.5.5
+-----
+
+* Consistent exception handling in the Bodhi2Client.
+* More adjustments to bodhi server version detection.
+
+-----
+0.5.4
+-----
+
+* Adjust usage of python-six to be compatible with older versions on rhel7.
+* More updates to detection of the bodhi server version.
+
+-----
+0.5.3
+-----
+
+* Better bodhi compatibility with 'fedpkg update'.
+
+-----
+0.5.2
+-----
+
+* Better version checking against the bodhi server.
+
+-----
+0.5.1
+-----
+
+* Typofix in the BodhiClient
+
+-----
+0.5.0
+-----
+
+* Bodhi2 compatibility!
+
+* Ensure that the OpenIdBaseClient returns a munch object like the old
+  BaseClient did.
+
+* Minor fixes to some python3 compatibility.
+
+-----
+0.4.0
+-----
+
+* Port most modules to a python2/python3 compatible codebase!  Hooray!
+
+* Deprecate the wiki client (it will be removed in the next major release).
+
+* Switch over to using zanata for translations.
+
+------
+0.3.37
+------
+
+* Make the fedora_session file unhidden
+
+* Instead of returning the JSON returned by fedoauth/ipsilon we return
+  the response from the application when we sent to it the data returned
+  by fedoauth/ipsilon.
+
+* Update OpenIdProxyClient to allow specifying headers when sending a request
+
+* Update bugzilla exception list.
 
 
 ------
diff --git a/PKG-INFO b/PKG-INFO
index 0adf61d..83258ca 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,11 @@
 Metadata-Version: 1.1
 Name: python-fedora
-Version: 0.3.36
+Version: 0.8.0
 Summary: Python modules for interacting with Fedora Services
 Home-page: https://fedorahosted.org/python-fedora
-Author: Toshio Kuratomi, Luke Macken, Ricky Elrod
-Author-email: tkuratom at redhat.com
+Author: Toshio Kuratomi, Luke Macken, Ricky Elrod, Ralph Bean, Patrick Uiterwijk
+Author-email: admin at fedoraproject.org
 License: LGPLv2+
-Download-URL: https://fedorahosted.org/releases/p/y/python-fedora/
 Description: UNKNOWN
 Keywords: Fedora Python Webservices
 Platform: UNKNOWN
diff --git a/README b/README.rst
similarity index 65%
rename from README
rename to README.rst
index cc59677..bd3c724 100644
--- a/README
+++ b/README.rst
@@ -2,9 +2,9 @@
 Python Fedora Module
 ====================
 
-:Author: Toshio Kuratomi
-:Date: 10 April 2013
-:Version: 0.3.x
+:Author: Patrick Uiterwijk
+:Date: 21 April 2016
+:Version: 0.8.x
 
 The Fedora module provides a python API for building `Fedora Services`_ and
 clients that connect to them.  It has functions and classes that help to build
@@ -27,10 +27,10 @@ Public License Version 2 or later.
 Dependencies
 ------------
 
-``python-fedora`` requires the ``bunch``, ``kitchen``, and ``requests`` python
+``python-fedora`` requires the ``munch``, ``kitchen``, and ``requests`` python
 modules.  It used to use ``pycurl``, but was updated to use ``requests`` as of
 version ``0.3.32``.
-The ``flask_fas_openid`` module requires the ``python-openid`` and 
+The ``flask_fas_openid`` module requires the ``python-openid`` and
 ``python-openid-teams`` modules.
 
 ----------
@@ -38,18 +38,18 @@ Installing
 ----------
 
 ``python-fedora`` is found in rpm form in Fedora proper.  Sometimes a new
-version will be placed in the Fedora Infrastructure yum repository for testing
+version will be placed in the Fedora Infrastructure ``yum`` repository for testing
 within Infrastructure before being released to the general public.  Installing
 from the yum repository should be as easy as::
 
-	# yum install python-fedora
+	$ yum install python-fedora
 
 If you want to install from a checkout of the development branch, follow these
 procedures::
 
-    # git clone https://github.com/fedora-infra/python-fedora.git
-    # cd python-fedora
-    # ./setup.py install
+    $ git clone https://github.com/fedora-infra/python-fedora.git
+    $ cd python-fedora
+    $ ./setup.py install
 
 See the configuration notes in each section for information on configuring
 your application after install.
@@ -72,7 +72,7 @@ servre to retrieve information about users.
 Note: This API is not feature complete. If you'd like to help add methods,
 document the existing methods, or otherwise aid in development of this API
 please contact us on the infrastructure list: infrastructure at lists.fedoraproject.org
-or on IRC: lmacken, abadger1999, and ricky in #fedora-admin, irc.freenode.net.
+or on IRC: lmacken, abadger1999, and ricky in ``#fedora-admin``, ``irc.freenode.net``
 
 Using the general API requires instantiating an ``AccountSystem`` object. You
 then use methods on the ``AccountSystem`` to get and set information on the
@@ -87,8 +87,8 @@ interpreter or, for instance, by running::
 Here's an example of using the ``AccountSystem``::
 
 	from fedora.accounts.fas2 import AccountSystem
-	from fedora.client import AuthError,
-x
+	from fedora.client import AuthError
+
 	# Get an AccountSystem object.  All AccountSystem methods need to be
 	# authenticated so you might as well give username and password here.
 	fas = AccountSystem(username='foo', password='bar')
@@ -143,10 +143,12 @@ Building the docs
 -----------------
 
 You'll need to install python-sphinx for this::
-  yum install python-sphinx
+
+    yum install python-sphinx
 
 Then run this command::
-  python setup.py build_sphinx
+
+    python setup.py build_sphinx
 
 ------------
 Translations
@@ -154,16 +156,17 @@ Translations
 
 The strings in python-fedora has mainly error messages.  These are translated
 so we should make sure that translators are able to translate them when
-necessary.  You will need babel, setuptools, and transifex-client to run these
+necessary.  You will need babel, setuptools, and zanata-client to run these
 commands::
-  yum install babel setuptools transifex-client
 
-Much information about using transifex for translations can be found in the
-`transifex user's guide`_.  The information in this section is largely from
-experimenting with the information in the `transifex client documentation`_
+    yum install babel setuptools zanata-client
 
-.. _`transifex user's guide`: http://help.transifex.net/user-guide/index.html
-.. ~`transifex client documentation`: http://help.transifex.net/user-guide/client/index.html
+Much information about using zanata for translations can be found in the
+`zanata user's guide`_.  The information in this section is largely from
+experimenting with the information in the `zanata client documentation`_
+
+.. _`zanata user's guide`: http://zanata.readthedocs.org
+.. _`zanata client documentation`: http://zanata-client.readthedocs.org/en/latest/
 
 Updating the POT File
 =====================
@@ -171,51 +174,40 @@ Updating the POT File
 When you make changes that change the translatable strings in the package, you
 should update the POT file.  Use the following distutils command (provided by
 python-babel) to do that::
-  ./setup.py extract_messages -o translations/python-fedora.pot
-  tx push -s
+
+    ./setup.py extract_messages -o translations/python-fedora.pot
+    zanata-cli push
 
 Then commit your changes to source control.
 
 Updating the PO Files
 =====================
 
-Transifex.net will merge the strings inside the pot file with the already
+`fedora.zanata.org <https://fedora.zanata.org/>`_ will merge the strings inside the pot file with the already
 translated strings.  To merge these, we just need to pull revised versions of
 the po files::
-  tx pull -a
-
-Then commit the changes to source control
 
-Note that if you see a status message from transifex like this::
-  Pulling new translations for resource python-fedora.python-fedorapot (source: translations/python-fedora.pot)
-   -> fr: translations/fr.po
+    zanata-cli pull
 
-it means that transifex has created a brand new po file for you.  You need to
-add the new file to source control before committing.
+Then commit the changes to source control (look for any brand new PO files that
+zanata may have created).
 
 Creating a new PO File
 ======================
 
-The easiest way to create a new po file for a new language is in transifex's
+The easiest way to create a new po file for a new language is in 's
 web UI.
 
-* Visit this link:
-  https://www.transifex.net/projects/p/python-fedora/resource/python-fedorapot/
-* Login with a transifex.net username and password
-* Scroll down to the add translation button below the statistics on current
-  translations
-* Select a language from the dropdown and hit the translate online button
+* Visit `this <https://fedora.zanata.org/iteration/view/python-fedora>`_
 
-This will start a translation for your language.  In the future you can
-continue to use the transifex online translation editor or you can download
-the .po file, translate on your computer, and then reupload.
 
 Compiling Message Catalogs
 ==========================
 
 Message catalogs can be compiled for testing and should always be compiled
 just prior to release.  Do this with the following script::
-  python releaseutils.py build_catalogs
+
+    python releaseutils.py build_catalogs
 
 Compiled message catalogs should not be committed to source control.
 
@@ -234,75 +226,89 @@ Release
    develop branch.
 
 1) Checkout a copy of the repository and setup git flow::
-     git clone git at github.com:fedora-infra/python-fedora.git
-     cd python-fedora
-     git flow init
 
-2) Create a release branch for all of our work
+        git clone https://github.com/fedora-infra/python-fedora.git
+        cd python-fedora
+        git flow init
+
+2) Create a release branch for all of our work::
 
-     git flow release start $VERSION
+        git flow release start $VERSION
 
 3) Download new translations and verify they are valid by compiling them::
-     tx pull -a
-     python releaseutils.py build_catalogs
-     # If everything checks out
-     git commit -m 'Merge new translations from transifex.net'
 
-4) Make sure that the NEWS file is accurate (use git log if needed).
+        zanata-cli pull
+        python releaseutils.py build_catalogs
+        # If everything checks out
+        git commit -m 'Merge new translations from fedora.zanata.org'
+
+4) Make sure that the NEWS file is accurate (use ``git log`` if needed).
 
 5) Update python-fedora.spec and fedora/release.py with the new version
-   information.
-     # Make edits to python-fedora.spec and release.py
-     git commit
+   information.::
+
+        # Make edits to python-fedora.spec and release.py
+        git commit
 
 6) Make sure the docs are proper and publish them::
-     # Build docs and check for errors
-     python setup.py build_sphinx
-     # pypi
-     python setup.py upload_docs
+
+        # Build docs and check for errors
+        python setup.py build_sphinx
+        # pypi
+        python setup.py upload_docs
 
 7) Push the release branch to the server::
-     # Update files
-     git flow release publish $VERSION
+
+        # Update files
+        git flow release publish $VERSION
 
 8) Go to a temporary directory and checkout a copy of the release::
-     cd ..
-     git clone git at github.com:fedora-infra/python-fedora.git release
-     cd release
-     git checkout release/$VERSION
+
+        cd ..
+        git clone https://github.com/fedora-infra/python-fedora.git release
+        cd release
+        git checkout release/$VERSION
 
 9) Create the tarball in this clean checkout::
-     python setup.py sdist
+
+        python setup.py sdist
 
 10) copy the dist/python-fedora-VERSION.tar.gz and python-fedora.spec files to
     where you build Fedora RPMS.  Do a test build::
-     cp dist/python-fedora-*.tar.gz python-fedora.spec /srv/git/python-fedora/
-     pushd /srv/git/python-fedora/
-     fedpkg switch-branch master
-     make mockbuild
+
+        cp dist/python-fedora-*.tar.gz python-fedora.spec /srv/git/python-fedora/
+        pushd /srv/git/python-fedora/
+        fedpkg switch-branch master
+        make mockbuild
 
 11) Make sure the build completes.  Run rpmlint on the results.  Install and
     test the new packages::
-     rpmlint *rpm
-     sudo rpm -Uvh *noarch.rpm
-     [test]
+
+        rpmlint *rpm
+        sudo rpm -Uvh *noarch.rpm
+        [test]
 
 12) When satisfied that the build works, create a fresh tarball and upload to
     pypi::
-     popd   # Back to the release directory
-     python setup.py sdist upload --sign
+
+        popd   # Back to the release directory
+        python setup.py sdist upload --sign
 
 13) copy the same tarball to fedorahosted.  The directory to upload to is
     slightly different for fedorahosted admins vs normal fedorahosted users:
     Admin::
-      scp dist/python-fedora*tar.gz* fedorahosted.org:/srv/web/releases/p/y/python-fedora/
+
+        scp dist/python-fedora*tar.gz* fedorahosted.org:/srv/web/releases/p/y/python-fedora/
+
     Normal contributor::
-      scp dist/python-fedora*tar.gz* fedorahosted.org:python-fedora
+
+        scp dist/python-fedora*tar.gz* fedorahosted.org:python-fedora
 
 14) mark the release as finished in git::
-     cd ../python-fedora
-     git flow release finish $VERSION
-     git push --all
-     git push --tags
+
+        cd ../python-fedora
+        git flow release finish $VERSION
+        git push --all
+        git push --tags
 
 15) Finish building and pushing packages for Fedora.
diff --git a/doc/api.rst b/doc/api.rst
index ede5900..e81d835 100644
--- a/doc/api.rst
+++ b/doc/api.rst
@@ -15,7 +15,7 @@ Client
 .. automodule:: fedora.client
     :members: FedoraServiceError, ServerError, AuthError, AppError,
         FedoraClientError, FASError, CLAError, BodhiClientException,
-        PackageDBError, DictContainer
+        DictContainer
 
 Generic Clients
 ===============
diff --git a/doc/client.rst b/doc/client.rst
index 6dfbbab..16b7c85 100644
--- a/doc/client.rst
+++ b/doc/client.rst
@@ -45,13 +45,13 @@ method on the server.  Here's some code that illustrates the process::
     client = BaseClient('https://admin.fedoraproject.org/pkgdb')
     try:
         collectionData = client.send_request('/collections', auth=False)
-    except ServerError, e:
-        print '%s' % e
-    except AppError, e:
-        print '%s: %s' % (e.name, e.message)
+    except ServerError as e:
+        print('%s' % e)
+    except AppError as e:
+        print('%s: %s' % (e.name, e.message))
 
     for collection in collectionData['collections']:
-        print collection['name'], collection['version']
+        print('%s %s' % (collection['name'], collection['version'])
 
 BaseClient Constructor
 ~~~~~~~~~~~~~~~~~~~~~~
@@ -78,7 +78,7 @@ can catch in order to prompt for a new username and password::
     while (count < MAX_RETRIES):
         try:
             collectionData = client.send_request('/collections', auth=True)
-        except AuthError, e:
+        except AuthError as e:
             client.password = getpass.getpass('Retype password for %s: ' % username)
         else:
             # data retrieved or we had an error unrelated to username/password
@@ -273,19 +273,20 @@ Here's an example of the exceptions in action::
     for retry in range(0, MAXRETRIES):
         try:
             collectionData = client.send_request('/collections', auth=True)
-        except AuthError, e:
-            client.username = raw_input('Username: ').strip()
+        except AuthError as e:
+            from six.moves import input
+            client.username = input('Username: ').strip()
             client.password = getpass.getpass('Password: ')
             continue
-        except ServerError, e:
-            print 'Error talking to the server: %s' % e
+        except ServerError as e:
+            print('Error talking to the server: %s' % e)
             break
-        except AppError, e:
-            print 'The server issued the following exception: %s: %s' % (
-                    e.name, e.message)
+        except AppError as e:
+            print('The server issued the following exception: %s: %s' % (
+                  e.name, e.message))
 
         for collection in collectionData['collections']:
-            print collection[0]['name'], collection[0]['version']
+            print('%s %s' % (collection[0]['name'], collection[0]['version']))
 
 ----------------
 OpenIdBaseClient
diff --git a/doc/existing.rst b/doc/existing.rst
index cb2a2f8..3c33a22 100644
--- a/doc/existing.rst
+++ b/doc/existing.rst
@@ -43,26 +43,6 @@ fas from a multithreaded webserver.
     :members:
     :undoc-members:
 
-.. _`Package-Database`:
-.. _`Pkgdb`:
-
-----------------
-Package Database
-----------------
-
-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.
-
-Plans to add an end-user view to packages is ongoing.
-
-.. toctree::
-    :maxdepth: 2
-
-.. autoclass:: fedora.client.PackageDB
-    :members:
-    :undoc-members:
-
 .. _`Bodhi`:
 
 ------------------------
@@ -73,9 +53,18 @@ 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.
 
+pythyon-fedora currently supports both the old Bodhi1 interface and the new
+Bodhi2 interface.  By using ``fedora.client.BodhiCLient``, the correct one
+should be returned to you depending on what is running live on Fedora
+Infrastructure servers.
+
 .. toctree::
     :maxdepth: 2
 
-.. autoclass:: fedora.client.BodhiClient
+.. autoclass:: fedora.client.Bodhi2Client
+    :members:
+    :undoc-members:
+
+.. autoclass:: fedora.client.Bodhi1Client
     :members:
     :undoc-members:
diff --git a/doc/flask_fas_openid.rst b/doc/flask_fas_openid.rst
index 14a1c05..2725e8c 100644
--- a/doc/flask_fas_openid.rst
+++ b/doc/flask_fas_openid.rst
@@ -72,7 +72,6 @@ authentication::
     # This is a sample application.
 
     import flask
-    from flask.ext.fas import FAS, fas_login_required
     from flask_fas_openid import fas_login_required, cla_plus_one_required, FAS
 
     # Set up Flask application
diff --git a/fedora/accounts/__init__.py b/fedora/accounts/__init__.py
deleted file mode 100644
index e22d917..0000000
--- a/fedora/accounts/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-'''
-Classes for interacting with the account system.
-'''
diff --git a/fedora/accounts/fas2.py b/fedora/accounts/fas2.py
deleted file mode 100644
index f5ba8be..0000000
--- a/fedora/accounts/fas2.py
+++ /dev/null
@@ -1,12 +0,0 @@
-'''This is for compatibility.
-
-The canonical location for this module from 0.3 on is fedora.client.fas2
-'''
-import warnings
-
-warnings.warn('fedora.accounts.fas2 has moved to fedora.client.fas2.  This'
-              ' location will disappear in 0.4', DeprecationWarning,
-              stacklevel=2)
-
-# pylint: disable-msg=W0401,W0614
-from fedora.client.fas2 import *
diff --git a/fedora/client/__init__.py b/fedora/client/__init__.py
index e7be3f1..595e685 100644
--- a/fedora/client/__init__.py
+++ b/fedora/client/__init__.py
@@ -30,7 +30,7 @@ fedora.client is used to interact with Fedora Services.
 '''
 import warnings
 
-from bunch import Bunch
+from munch import Munch
 
 
 class FedoraClientError(Exception):
@@ -78,6 +78,9 @@ class ServerError(FedoraServiceError):
     def __str__(self):
         return 'ServerError(%s, %s, %s)' % (self.filename, self.code, self.msg)
 
+    def __repr__(self):
+        return 'ServerError(%r, %r, %r)' % (self.filename, self.code, self.msg)
+
 
 class AuthError(FedoraServiceError):
 
@@ -105,15 +108,19 @@ class AppError(FedoraServiceError):
         return 'AppError(%s, %s, extras=%s)' % (
             self.name, self.message, self.extras)
 
+    def __repr__(self):
+        return 'AppError(%r, %r, extras=%r)' % (
+            self.name, self.message, self.extras)
+
 
 
 # Backwards compatibility
-class DictContainer(Bunch):
+class DictContainer(Munch):
     def __init__(self, *args, **kwargs):
         warnings.warn(
-            'DictContainer is deprecated.  Use the Bunch class'
+            'DictContainer is deprecated.  Use the Munch class'
             ' from python-bunch instead.', DeprecationWarning, stacklevel=2)
-        Bunch.__init__(self, *args, **kwargs)
+        Munch.__init__(self, *args, **kwargs)
 
 
 # We want people to be able to import fedora.client.*Client directly
@@ -124,14 +131,13 @@ from fedora.client.baseclient import BaseClient
 from fedora.client.openidproxyclient import OpenIdProxyClient
 from fedora.client.openidbaseclient import OpenIdBaseClient
 from fedora.client.fas2 import AccountSystem, FASError, CLAError
-from fedora.client.pkgdb import PackageDB, PackageDBError
 from fedora.client.bodhi import BodhiClient, BodhiClientException
 from fedora.client.wiki import Wiki
 # pylint: enable-msg=W0611
 
 __all__ = ('FedoraServiceError', 'ServerError', 'AuthError', 'AppError',
            'FedoraClientError', 'LoginRequiredError', 'DictContainer',
-           'FASError', 'CLAError', 'BodhiClientException', 'PackageDBError',
+           'FASError', 'CLAError', 'BodhiClientException',
            'ProxyClient', 'FasProxyClient', 'BaseClient', 'OpenIdProxyClient',
-           'OpenIdBaseClient', 'AccountSystem', 'PackageDB', 'BodhiClient',
+           'OpenIdBaseClient', 'AccountSystem', 'BodhiClient',
            'Wiki')
diff --git a/fedora/client/baseclient.py b/fedora/client/baseclient.py
index 7bd64b3..15b8d96 100644
--- a/fedora/client/baseclient.py
+++ b/fedora/client/baseclient.py
@@ -20,24 +20,25 @@
 
 .. moduleauthor:: Luke Macken <lmacken at redhat.com>
 .. moduleauthor:: Toshio Kuratomi <tkuratom at redhat.com>
+.. moduleauthor:: Ralph Bean <rbean at redhat.com>
 '''
 
 import os
 import stat
 from os import path
 import logging
-import cPickle as pickle
-import Cookie
 import warnings
 
 from kitchen.text.converters import to_bytes
+from six.moves import cPickle as pickle
+from six.moves import http_cookies as Cookie
 
 from fedora import __version__
 
 log = logging.getLogger(__name__)
 
 b_SESSION_DIR = path.join(path.expanduser('~'), '.fedora')
-b_SESSION_FILE = path.join(b_SESSION_DIR, '.fedora_session')
+b_SESSION_FILE = path.join(b_SESSION_DIR, 'fedora_session')
 
 from fedora.client import AuthError, ProxyClient
 
@@ -115,13 +116,11 @@ class BaseClient(ProxyClient):
         session_file = None
         if path.isfile(b_SESSION_FILE):
             try:
-                session_file = file(b_SESSION_FILE, 'r')
-                saved_session = pickle.load(session_file)
+                with open(b_SESSION_FILE, 'rb') as session_file:
+                    saved_session = pickle.load(session_file)
             except (IOError, EOFError):
                 self.log.info('Unable to load session from %(file)s' %
                               {'file': b_SESSION_FILE})
-            if session_file:
-                session_file.close()
 
         return saved_session
 
@@ -133,16 +132,15 @@ class BaseClient(ProxyClient):
         # Make sure the directory exists
         if not path.isdir(b_SESSION_DIR):
             try:
-                os.mkdir(b_SESSION_DIR, 0755)
-            except OSError, e:
+                os.mkdir(b_SESSION_DIR, 0o755)
+            except OSError as e:
                 self.log.warning('Unable to create %(dir)s: %(error)s' %
                                  {'dir': b_SESSION_DIR, 'error': to_bytes(e)})
 
         try:
-            session_file = file(b_SESSION_FILE, 'w')
-            os.chmod(b_SESSION_FILE, stat.S_IRUSR | stat.S_IWUSR)
-            pickle.dump(save, session_file)
-            session_file.close()
+            with open(b_SESSION_FILE, 'wb') as session_file:
+                os.chmod(b_SESSION_FILE, stat.S_IRUSR | stat.S_IWUSR)
+                pickle.dump(save, session_file)
         except Exception as e:  # pylint: disable-msg=W0703
             # If we can't save the file, issue a warning but go on.  The
             # session just keeps you from having to type your password over
@@ -361,7 +359,7 @@ class BaseClient(ProxyClient):
         # Remove empty params
         # pylint: disable-msg=W0104
         [auth_params.__delitem__(key)
-            for key, value in auth_params.items() if not value]
+            for key, value in list(auth_params.items()) if not value]
         # pylint: enable-msg=W0104
 
         session_id, data = super(BaseClient, self).send_request(
diff --git a/fedora/client/bodhi.py b/fedora/client/bodhi.py
index f6d45ec..3d7752c 100644
--- a/fedora/client/bodhi.py
+++ b/fedora/client/bodhi.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright 2007-2012  Red Hat, Inc.
+# Copyright 2007-2015  Red Hat, Inc.
 # This file is part of python-fedora
 #
 # python-fedora is free software; you can redistribute it and/or
@@ -22,24 +22,516 @@ This module provides a client interface for bodhi.
 
 .. moduleauthor:: Luke Macken <lmacken at redhat.com>
 .. moduleauthor:: Toshio Kuratomi <tkuratom at redhat.com>
+.. moduleauthor:: Ralph Bean <rbean at redhat.com>
 """
 
+import os
+import datetime
+import functools
+import getpass
 import logging
+import textwrap
+import warnings
+import re
 
-from textwrap import wrap
-from os.path import join, expanduser, exists
+import six
 
-from fedora.client import BaseClient, FedoraClientError
+from fedora.client import OpenIdBaseClient, FedoraClientError, BaseClient
+import fedora.client.openidproxyclient
 
-__version__ = '0.5.1'
+__version__ = '2.0.0'
 log = logging.getLogger(__name__)
 
+BODHI1_BASE_URL = 'https://admin.fedoraproject.org/updates/'
+BODHI2_BASE_URL = 'https://bodhi.fedoraproject.org/'
+BODHI1_STG_BASE_URL = 'https://admin.stg.fedoraproject.org/updates/'
+BODHI2_STG_BASE_URL = 'https://bodhi.stg.fedoraproject.org/'
+STG_OPENID_API = 'https://id.stg.fedoraproject.org/api/v1/'
+
+# We default to Bodhi2 now
+BASE_URL = BODHI2_BASE_URL
+STG_BASE_URL = BODHI2_STG_BASE_URL
... 11634 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-fedora.git



More information about the Python-modules-commits mailing list