[Python-modules-commits] [python-pygerrit2] 01/09: Import python-pygerrit2_2.0.4.orig.tar.gz

Filip Pytloun fpytloun-guest at moszumanska.debian.org
Wed Jan 10 18:33:01 UTC 2018


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

fpytloun-guest pushed a commit to branch master
in repository python-pygerrit2.

commit bf3416fa00505148a017ac9017021e356529f09b
Author: Filip Pytloun <filip at pytloun.cz>
Date:   Wed Jan 10 17:41:52 2018 +0100

    Import python-pygerrit2_2.0.4.orig.tar.gz
---
 AUTHORS                                 |  22 ++
 ChangeLog                               | 389 ++++++++++++++++++++++++++++++++
 LICENSE                                 |  22 ++
 MANIFEST.in                             |   1 +
 Makefile                                |  94 ++++++++
 PKG-INFO                                | 109 +++++++++
 README.md                               |  90 ++++++++
 README.rst                              |  86 +++++++
 docs/Makefile                           |  20 ++
 docs/conf.py                            | 168 ++++++++++++++
 docs/index.rst                          |  20 ++
 docs/make.bat                           |  36 +++
 example.py                              | 117 ++++++++++
 pygerrit2.egg-info/PKG-INFO             | 109 +++++++++
 pygerrit2.egg-info/SOURCES.txt          |  28 +++
 pygerrit2.egg-info/dependency_links.txt |   1 +
 pygerrit2.egg-info/not-zip-safe         |   1 +
 pygerrit2.egg-info/pbr.json             |   1 +
 pygerrit2.egg-info/requires.txt         |   2 +
 pygerrit2.egg-info/top_level.txt        |   1 +
 pygerrit2/__init__.py                   | 142 ++++++++++++
 pygerrit2/rest/__init__.py              | 359 +++++++++++++++++++++++++++++
 pygerrit2/rest/auth.py                  |  50 ++++
 requirements.txt                        |   2 +
 setup.cfg                               |  26 +++
 setup.py                                |  39 ++++
 test_requirements.txt                   |   3 +
 tox.ini                                 |  25 ++
 unittests.py                            | 241 ++++++++++++++++++++
 29 files changed, 2204 insertions(+)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..64a9e30
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,22 @@
+Alexander D. Kanevskiy <kad at kad.name>
+Andrey Devyatkin <andrey.a.devyatkin at gmail.com>
+Benjamin Foster <bfoster at phi.al>
+Chad Horohoe <chadh at wikimedia.org>
+Chris Packham <chris.packham at alliedtelesis.co.nz>
+Christopher Zee <christopher.xs.zee at gmail.com>
+David Pursehouse <david.pursehouse at gmail.com>
+David Pursehouse <david.pursehouse at sonyericsson.com>
+David Pursehouse <david.pursehouse at sonymobile.com>
+Ernst Sjostrand <ernst.sjostrand at sonymobile.com>
+Fabien Boucher <fabien.boucher at enovance.com>
+Gabriel Féron <feron.gabriel at gmail.com>
+George Peristerakis <gperiste at redhat.com>
+Jens Andersen <jens.andersen at gmail.com>
+Johannes Richter <johannes.richter at kernkonzept.com>
+Justin Simon <jls5177 at gmail.com>
+Marcin Płonka <mplonka at gmail.com>
+Nikki Heald <nicky at notnowlewis.com>
+Peter Theckanath <peter.xa.theckanath at sonymobile.com>
+Vasiliy Kleschov <vkleschov at cloudlinux.com>
+Vineet Naik <vineet at helpshift.com>
+dependabot[bot] <support at dependabot.com>
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..edb824d
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,389 @@
+CHANGES
+=======
+
+2.0.4
+-----
+
+* Add missing docstrings to silence pydocstyle errors
+* Replace pep257 with pydocstyle
+* Fix up various pydocstyle warnings, mostly about spacing
+* pylint: Remove useless subclassing/super() calls
+* pylint: Don't iterate over range(len()), use enumerate()
+* Minor pylint fixes, mostly spacing, indentation, capitalization, naming
+* Bump pyflakes from 1.5.0 to 1.6.0
+* Bump flake8 from 3.3.0 to 3.5.0
+* Exclude docs from analysis
+* Remove doc build; add generated docs folder
+
+2.0.3
+-----
+
+* Allow requests up to version 2.18.4
+* Fixes #11 Remove pypi downloads shields
+* Allow to use requests version 2.18.1
+* Fixes #10: Fix a bug preventing file upload in PUT and POST
+* Fixes #7: Be less strict about requests version
+* Upgrade requests to 2.16.0
+* Adapt to removal of Digest authentication in Gerrit 2.14
+* Update links to Gerrit 2.14
+* Upgrade requests to 2.14.2
+* Add support to return response code
+* Fix docs folder exclusion in tox config
+* Upgrade pyflakes and flake8 to latest versions
+* Remove debug logs
+* rest: use encoding from response instead of UTF-8
+* Upgrade requests to 2.13.0
+* Add back the ReStructured Text version of the README
+
+2.0.2
+-----
+
+* Fix MANIFEST.in with correct README file name
+* Upgrade flake8 to version 3.2.1
+* Upgrade requests to 2.12.1
+* Update Gerrit documentation link to latest major release
+* Upgrade flake8 and pyflakes to latest versions
+* Fix README reference in setup.cfg
+* Upgrade requests to 2.11.1
+* Convert README to markdown
+
+2.0.1
+-----
+
+* Upgrade requests to version 2.11.0
+* Revert "Don't use requests.session()"
+* Upgrade requests to 2.10.0
+* returning raw response for non-JSON Content-Type
+* making use of requests' json argument
+* merging request headers
+* Remove redundant pylint suppressions
+* Rewrite the README with better usage instructions
+* Update prerequisites
+* Add tox configuration
+* Use flake8 instead of pep8
+* GerritReview: dump json content with sorted keys
+* Example: Don't use 'self' in query when not authenticated
+* Python3 compatibility fixes
+
+2.0.0
+-----
+
+* Remove SSH support and rename to pygerrit2
+* Update Gerrit documentation link to latest version
+* Update link to Gerrit home page
+
+1.0.0
+-----
+
+* Use badges from shields.io
+* Upgrade pyflakes to 1.0.0
+* Upgrade PEP-8 to 1.7.0
+* Include event name in UnhandledEvent's \_\_repr\_\_ output
+* Upgrade Paramiko to 1.16.0
+* Upgrade requests to 2.9.1
+* Raise exception if the json content is invalid
+* Add missing docstring for Change#from\_json
+* Added from\_json method for Change model
+* Updated add\_comment() to support line ranges
+
+0.2.11
+------
+
+* Upgrade paramiko to version 1.15.2
+* Add keepalive support to GerritSSHClient
+
+0.2.10
+------
+
+* Don't use requests.session()
+* Don't set Content-Type on PUT/POST if there is no body
+* Add debug log of response content
+
+0.2.9
+-----
+
+* Upgrade requests to 2.7.0
+* Allow unicode characters in gerrit commands
+* Update requests to 2.5.1
+* Fix incorrect docstring
+* Upgrade pyflakes to 0.8.1
+* Be less strict about the pbr version used
+* Restructure docstrings for better html output
+* Bump pep8 to 1.5.7
+* Bump paramiko to 1.15.1 and pycrypto to 2.6.1
+* Bump requests to 2.4.3
+* Fix documentation build
+* Bump python requests version to 2.4.1
+
+0.2.8
+-----
+
+* Add inline review support
+* Replace deprecated assertEquals() with assertEqual()
+* Update PEP257 to 0.2.4
+* Update pyflakes to 0.7.3
+
+0.2.7
+-----
+
+* Add message formatter class
+* Upgrade requests to 2.3.0
+* Fix paramiko link in the README file
+
+0.2.6
+-----
+
+* Add support for ProxyCommand in GerritSSHClient
+* Upgrade paramiko to 1.14.0
+* Revert "Remove support for Gerrit over ssh"
+* Update the README
+* Upgdade requests to 2.2.1
+* Include full description in the setup config
+* Set Content-Type header on PUT and POST requests
+* Set HTTP headers to reduce data transfer time
+* Migrate setup to pbr
+* Stop using pylint
+* Remove support for Gerrit over ssh
+
+0.2.5
+-----
+
+* Version 0.2.5
+* Fix up usage of argparse in examples
+* Update examples to use argparse instead of optparse
+* Fix for hanging connections
+
+0.2.4
+-----
+
+* Version 0.2.4
+* Accept kwargs for request functions
+* Correct Gerrit documentation link
+* Add badges to the README
+* Fix README markup to work properly on Gitlab
+
+0.2.3
+-----
+
+* Version 0.2.3
+* Use find\_packages() in setup
+
+0.2.2
+-----
+
+* Bump version to 0.2.2
+* Release notes for 0.2.2
+* Add user in the Approval object
+* Add support for CurrentPatchSet
+* Include change status in Change object
+* Always set sortkey in Change object
+* Handle errors in REST API example
+* Simplify REST API error handling
+* Add username field in the account data
+* Add method to run a gerrit command from the client
+* Add method to get username and Gerrit version
+* Fix NameError in REST API example
+* Bump to requests 2.0.1 also in setup.py
+* Bump requests version up to 2.0.1
+
+0.2.1
+-----
+
+* Update change log for 0.2.1
+* Document the HTTP password configuration for REST API usage
+* Reword the prerequisites in the readme
+* Separate prerequisites and configuration in the readme
+
+0.2.0
+-----
+
+* Bump version to 0.2.0
+* Update change log for 0.2.0
+* Suppress pylint "Unable to import" error
+* Suppress pylint warning about catching too general exception
+* Fix pylint error in rest\_example.py
+* Change abandoned and restored events don't have a patchset field
+* Add myself to authors
+* Add an authors list that contributors can add themselves to
+* Fix indentation
+* Ensure errors in json parsing doesn't leave everything in a broken state
+* Reason is optional in abandon and restore changes
+* Return sortKey from query result, to allow resuming query
+* Update the README to mention the REST API
+* Avoid busy loop when receiving incoming stream data
+* Add more detailed examples of SSH interface usage in the README
+* Update the README notes about ssh configuration
+* Add support for Kerberos authentication in example script
+* Allow client to disable SSL certificate verification
+* Add REST API example
+* Refactor the authentication handling
+* Add MANIFEST to .gitignore
+* Add method to build url from endpoint
+
+0.1.1
+-----
+
+* Bump version to 0.1.1
+* Add changelog
+* Make get, put, post and delete REST methods public
+* Fix #10: Allow to manually specify ssh username and port
+* Completely refactor the stream event handling
+* Add missing \_\_repr\_\_ methods on ErrorEvent and UnhandledEvent
+* Fix initialisation of error event
+* Fix #11: correct handling of \`identityfile\` in the ssh config
+* Allow example script to continue if errors are received
+* Fix #9: Add a bit more detail in the documentation
+* Fix #8: Support the "topic-changed" stream event
+* Fix #7: Support the "reviewer-added" stream event
+* Fix #6: Support the "merge-failed" stream event
+* Fix #5: Move json parsing and error handling into the event factory
+* Improved logging in the example script
+* Fix #3: Don't treat unhandled event types as errors
+* Fix #4: Keep event's raw json data in the event object
+* Add \_\_repr\_\_ methods on event and model classes
+* Remove redundant \`exec\_command\` method
+* Fix #2: Establish SSH connection in a thread-safe way
+* Fix #1: Use select.select() instead of select.poll()
+* Fix authentication setup
+* Add handling of HTTP error status codes in responses
+* Add support for HTTP digest authentication
+* Initial implementation of Gerrit REST API interface
+* Disable W0142 'Used \* or \*\* magic' in the Pylint configuration
+
+0.1.0
+-----
+
+* Bump version to 0.1.0
+* Add Python trove classifiers to the setup
+* Include full license text in the license parameter of setup
+* Add long description in the setup
+* Add MANIFEST.in file
+* Improve formatting in the README file
+* Rename README to README.rst
+* Add make target and rules to ensure environment setup tools are OK
+* Add a make target to build the API documentation zip archive
+* Don't put copyright and license headers in Python module docstrings
+* Add a make target to build the source distribution
+* Add a make target to check for clean git status
+* Add a make target to check that the git is tagged properly
+* Add generation of package documentation
+* Separate test dependency installation into its own build target
+* Separate environment intialisation into its own build target
+* Make the shebangs consistent
+* Add pylint check in the Makefile
+* Fix pylint warnings
+* Add PEP-257 conformance check in the Makefile
+* Add a unit test to ensure dependency package version consistency
+* Separate package dependencies from verification/test dependencies
+* Bump paramiko dependency to version 1.11.0
+* Fix relative imports
+* Fix one more PEP-257 violation
+* Add a \`clean\` target in the Makefile
+* Add PEP-8 conformance check in the Makefile
+* Add pyflakes check in the Makefile
+* Add a Makefile to install dependencies and run unit tests
+* Only allow strings as query terms and commands
+* Don't hard code version in setup.py
+* Include command in GerritCommandResult
+* Don't open ssh connection until needed
+* Fix UnboundLocalError when stream-event connection fails
+* Add missing docstrings to conform to PEP-257
+* Explicitly depend on paramiko v1.7.6
+* Move requirements.txt to the root
+* Add requirements file
+
+0.0.7
+-----
+
+* Bump to version 0.0.7
+* Better error message in example script
+* Rename the readme and license files
+
+0.0.6
+-----
+
+* Bump to version 0.0.6
+* Better error handling in the example script
+* Move license to its own file and add basic documentation
+* Use correct URL in setup information
+* Handle socket connection error in SSH client
+* Python 2.6 style exception handling
+* Add Eclipse and Pydev project files
+
+0.0.5
+-----
+
+* Bump to version 0.0.5
+* Revert "Basic thread-safeness in the SSH client"
+* Encapsulate the SSH command results in a class
+* Update pylint config to work with version 0.26
+* Only add query result lines to returned data
+* Handle JSON errors in query results
+* Refactor getting the Gerrit version
+* Reduce nested \`if\` blocks in stream handling
+* Add pylint configuration file
+* More error handling improvements in stream
+* Handle exception when running ssh command
+* Fix pylint warnings in stream.py
+* Basic thread-safeness in the SSH client
+* More exception handling in stream
+
+0.0.4
+-----
+
+* Bump version to 0.0.4
+* Fix hostname in unit tests
+* Get Gerrit version during client initialisation
+* Add query functionality
+* Add \_\_str\_\_ on event base class
+* Move SSH client from stream class to main client class
+* Add license information
+* Simplify the unit test structure
+
+0.0.3
+-----
+
+* Bump version to 0.0.3
+* Add an example of how the Gerrit client class is used
+* Wait for thread to complete when stopping stream
+* Handle errors when reading event stream
+* Fix event registration from other module
+* Refactor event stream handling to use SSH client
+* Handle invalid port in ssh config
+* Add GerritSSHClient
+* Add initial stub of GerritClient class
+* Inject event name into event classes with decorator
+* Revert "GerritEventFactory should be a singleton"
+* GerritEventFactory should be a singleton
+* Pass input stream in the constructor of GerritStream
+* Add support for topic name in change attribute
+* Add event factory and refactor event dispatching
+* Events unit tests should also test event dispatching
+* Add helper methods for initialisation from json data
+* Add setup.py
+
+0.0.2
+-----
+
+* Tidy up docstrings to follow the PEP-257 docstring convention
+* Refactor into submodules
+* Add .settings to .gitignore
+* Remove check for supported approval types
+
+0.0.1
+-----
+
+* Add .gitignore
+* Add Makefile and script for unit tests
+* Add unit tests for event handling
+* Reason is missing in ChangeRestoredEvent
+* \`comment-added\` event can have multiple approvals
+* Add support for the \`draft-published\` event
+* Minor refactoring of unit tests
+* Fixing PEP-8 and pylint warnings
+* Python cleanup: inherit from object
+* Undefined variable in GerritCommentAddedEvent
+* Check for callable event handler on attach
+* Minor refactoring and adding initial unit tests
+* Initial version of class for handling Gerrit stream events
+* Initial empty commit
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..2258bd7
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License
+
+Copyright 2011 Sony Ericsson Mobile Communications. All rights reserved.
+Copyright 2012 Sony Mobile Communications. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..738616d
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1 @@
+include README.rst LICENSE requirements.txt
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..87d45a3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,94 @@
+# The MIT License
+#
+# Copyright 2013 Sony Mobile Communications. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+PWD := $(shell pwd)
+VERSION := $(shell git describe)
+
+VIRTUALENV := $(shell which virtualenv)
+ifeq ($(wildcard $(VIRTUALENV)),)
+  $(error virtualenv must be available)
+endif
+
+PIP := $(shell which pip)
+ifeq ($(wildcard $(PIP)),)
+  $(error pip must be available)
+endif
+
+REQUIRED_VIRTUALENV ?= 1.10
+VIRTUALENV_OK := $(shell expr `virtualenv --version | \
+    cut -f2 -d' '` \>= $(REQUIRED_VIRTUALENV))
+
+all: test
+
+test: clean unittests pyflakes pep8 pydocstyle
+
+sdist: valid-virtualenv test
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          python setup.py sdist"
+
+valid-virtualenv:
+ifeq ($(VIRTUALENV_OK),0)
+  $(error virtualenv version $(REQUIRED_VIRTUALENV) or higher is needed)
+endif
+
+pydocstyle: testenvsetup
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          git ls-files | grep \"\.py$$\" | grep -v docs | xargs pydocstyle"
+
+pep8: testenvsetup
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          git ls-files | grep \"\.py$$\" | grep -v docs | xargs flake8 --max-line-length 80"
+
+pyflakes: testenvsetup
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          git ls-files | grep \"\.py$$\" | grep -v docs | xargs pyflakes"
+
+unittests: testenvsetup
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          python unittests.py"
+
+testenvsetup: envsetup
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          pip install --upgrade -r test_requirements.txt"
+
+docenvsetup: envsetup
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          pip install --upgrade -r doc_requirements.txt"
+
+envsetup: envinit
+	bash -c "\
+          source ./pygerrit2env/bin/activate && \
+          pip install --upgrade -r requirements.txt"
+
+envinit:
+	bash -c "[ -e ./pygerrit2env/bin/activate ] || virtualenv --system-site-packages ./pygerrit2env"
+
+clean:
+	@find . -type f -name "*.pyc" -exec rm -f {} \;
+	@rm -rf pygerrit2env pygerrit2.egg-info build dist
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..7c03978
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,109 @@
+Metadata-Version: 1.1
+Name: pygerrit2
+Version: 2.0.4
+Summary: Client library for interacting with Gerrit's REST API
+Home-page: https://github.com/dpursehouse/pygerrit2
+Author: David Pursehouse
+Author-email: david.pursehouse at gmail.com
+License: The MIT License
+Description-Content-Type: UNKNOWN
+Description: Pygerrit2 - Client library for interacting with Gerrit Code Review's REST API
+        =============================================================================
+        
+        .. image:: https://img.shields.io/pypi/v/pygerrit2.png
+        
+        .. image:: https://img.shields.io/pypi/l/pygerrit2.png
+        
+        Pygerrit2 provides a simple interface for clients to interact with
+        `Gerrit Code Review`_ via the REST API.
+        
+        Prerequisites
+        -------------
+        
+        Pygerrit2 is compatible with Python 2.6 and Python 2.7.  Support for Python 3
+        is experimental.
+        
+        Pygerrit2 depends on the `requests`_ library.
+        
+        
+        Installation
+        ------------
+        
+        To install pygerrit2, simply::
+        
+            $ pip install pygerrit2
+        
+        
+        Usage
+        -----
+        
+        This simple example shows how to get the user's open changes. Authentication
+        to Gerrit is done via HTTP Basic authentication, using an explicitly given
+        username and password::
+        
+            >>> from requests.auth import HTTPBasicAuth
+            >>> from pygerrit2.rest import GerritRestAPI
+            >>> auth = HTTPBasicAuth('username', 'password')
+            >>> rest = GerritRestAPI(url='http://review.example.net', auth=auth)
+            >>> changes = rest.get("/changes/?q=owner:self%20status:open")
+        
+        Note that is is not necessary to add the ``/a/`` prefix on the endpoint
+        URLs. This is automatically added when the API is instantiated with an
+        authentication object.
+        
+        If the user's HTTP username and password are defined in the ``.netrc``
+        file::
+        
+            machine review.example.net login MyUsername password MyPassword
+        
+        then it is possible to authenticate with those credentials::
+        
+            >>> from pygerrit2.rest import GerritRestAPI
+            >>> from pygerrit2.rest.auth import HTTPBasicAuthFromNetrc
+            >>> url = 'http://review.example.net'
+            >>> auth = HTTPBasicAuthFromNetrc(url=url)
+            >>> rest = GerritRestAPI(url=url, auth=auth)
+            >>> changes = rest.get("/changes/?q=owner:self%20status:open")
+        
+        Note that the HTTP password is not the same as the SSH password. For
+        instructions on how to obtain the HTTP password, refer to Gerrit's
+        `HTTP upload settings`_ documentation.
+        
+        Also note that in Gerrit version 2.14, support for HTTP Digest authentication
+        was removed and only HTTP Basic authentication is supported. When using
+        pygerrit2 against an earlier Gerrit version, it may be necessary to replace
+        the `HTTPBasic...` classes with the corresponding `HTTPDigest...` versions.
+        
+        Refer to the `example`_ script for a full working example.
+        
+        Copyright and License
+        ---------------------
+        
+        Copyright 2011 Sony Ericsson Mobile Communications. All rights reserved.
+        
+        Copyright 2012 Sony Mobile Communications. All rights reserved.
+        
+        Copyright 2016 David Pursehouse. All rights reserved.
+        
+        Licensed under The MIT License.  Please refer to the `LICENSE`_ file for full
+        license details.
+        
+        .. _`Gerrit Code Review`: https://gerritcodereview.com/
+        .. _`requests`: https://github.com/kennethreitz/requests
+        .. _example: https://github.com/dpursehouse/pygerrit2/blob/master/example.py
+        .. _`HTTP upload settings`: https://gerrit-documentation.storage.googleapis.com/Documentation/2.14/user-upload.html#http
+        .. _LICENSE: https://github.com/dpursehouse/pygerrit2/blob/master/LICENSE
+        
+        
+Keywords: gerrit
+rest
+http
+Platform: UNKNOWN
+Classifier: Development Status :: 3 - Alpha
+Classifier: Environment :: Console
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Natural Language :: English
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..03687ef
--- /dev/null
+++ b/README.md
@@ -0,0 +1,90 @@
+# Pygerrit2 - Client library for interacting with Gerrit Code Review's REST API
+
+![Version](https://img.shields.io/pypi/v/pygerrit2.png)
+![License](https://img.shields.io/pypi/l/pygerrit2.png)
+
+Pygerrit2 provides a simple interface for clients to interact with
+[Gerrit Code Review][gerrit] via the REST API.
+
+## Prerequisites
+
+Pygerrit2 is compatible with Python 2.6 and Python 2.7.  Support for Python 3
+is experimental.
+
+Pygerrit2 depends on the [requests library][requests].
+
+
+## Installation
+
+To install pygerrit2, simply:
+
+```bash
+$ pip install pygerrit2
+```
+
+## Usage
+
+This simple example shows how to get the user's open changes. Authentication
+to Gerrit is done via HTTP Basic authentication, using an explicitly given
+username and password:
+
+```python
+from requests.auth import HTTPBasicAuth
+from pygerrit2.rest import GerritRestAPI
+
+auth = HTTPBasicAuth('username', 'password')
+rest = GerritRestAPI(url='http://review.example.net', auth=auth)
+changes = rest.get("/changes/?q=owner:self%20status:open")
+```
+
+Note that is is not necessary to add the `/a/` prefix on the endpoint
+URLs. This is automatically added when the API is instantiated with an
+authentication object.
+
+If the user's HTTP username and password are defined in the `.netrc`
+file:
+
+```bash
+machine review.example.net login MyUsername password MyPassword
+```
+
+then it is possible to authenticate with those credentials:
+
+```python
+from pygerrit2.rest import GerritRestAPI
+from pygerrit2.rest.auth import HTTPBasicAuthFromNetrc
+
+url = 'http://review.example.net'
+auth = HTTPBasicAuthFromNetrc(url=url)
+rest = GerritRestAPI(url=url, auth=auth)
+changes = rest.get("/changes/?q=owner:self%20status:open")
+```
+
+Note that the HTTP password is not the same as the SSH password. For
+instructions on how to obtain the HTTP password, refer to Gerrit's
+[HTTP upload settings documentation][settings].
+
+Also note that in Gerrit version 2.14, support for HTTP Digest authentication
+was removed and only HTTP Basic authentication is supported. When using
+pygerrit2 against an earlier Gerrit version, it may be necessary to replace
+the `HTTPBasic...` classes with the corresponding `HTTPDigest...` versions.
+
+Refer to the [example script][example] for a full working example.
+
+
+# Copyright and License
+
+Copyright 2011 Sony Ericsson Mobile Communications. All rights reserved.
+
+Copyright 2012 Sony Mobile Communications. All rights reserved.
+
+Copyright 2016 David Pursehouse. All rights reserved.
+
+Licensed under The MIT License.  Please refer to the [LICENSE file][license]
+for full license details.
+
+[gerrit]: https://gerritcodereview.com/
+[requests]: https://github.com/kennethreitz/requests
+[example]: https://github.com/dpursehouse/pygerrit2/blob/master/example.py
+[settings]: https://gerrit-documentation.storage.googleapis.com/Documentation/2.14/user-upload.html#http
+[license]: https://github.com/dpursehouse/pygerrit2/blob/master/LICENSE
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..00542f7
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,86 @@
+Pygerrit2 - Client library for interacting with Gerrit Code Review's REST API
+=============================================================================
+
+.. image:: https://img.shields.io/pypi/v/pygerrit2.png
+
+.. image:: https://img.shields.io/pypi/l/pygerrit2.png
+
+Pygerrit2 provides a simple interface for clients to interact with
+`Gerrit Code Review`_ via the REST API.
+
+Prerequisites
+-------------
+
+Pygerrit2 is compatible with Python 2.6 and Python 2.7.  Support for Python 3
+is experimental.
+
+Pygerrit2 depends on the `requests`_ library.
+
+
+Installation
+------------
+
+To install pygerrit2, simply::
+
+    $ pip install pygerrit2
+
+
+Usage
+-----
+
+This simple example shows how to get the user's open changes. Authentication
+to Gerrit is done via HTTP Basic authentication, using an explicitly given
+username and password::
+
+    >>> from requests.auth import HTTPBasicAuth
+    >>> from pygerrit2.rest import GerritRestAPI
+    >>> auth = HTTPBasicAuth('username', 'password')
+    >>> rest = GerritRestAPI(url='http://review.example.net', auth=auth)
+    >>> changes = rest.get("/changes/?q=owner:self%20status:open")
+
+Note that is is not necessary to add the ``/a/`` prefix on the endpoint
+URLs. This is automatically added when the API is instantiated with an
+authentication object.
+
+If the user's HTTP username and password are defined in the ``.netrc``
+file::
+
+    machine review.example.net login MyUsername password MyPassword
+
+then it is possible to authenticate with those credentials::
+
+    >>> from pygerrit2.rest import GerritRestAPI
+    >>> from pygerrit2.rest.auth import HTTPBasicAuthFromNetrc
+    >>> url = 'http://review.example.net'
+    >>> auth = HTTPBasicAuthFromNetrc(url=url)
+    >>> rest = GerritRestAPI(url=url, auth=auth)
+    >>> changes = rest.get("/changes/?q=owner:self%20status:open")
+
+Note that the HTTP password is not the same as the SSH password. For
+instructions on how to obtain the HTTP password, refer to Gerrit's
+`HTTP upload settings`_ documentation.
+
+Also note that in Gerrit version 2.14, support for HTTP Digest authentication
+was removed and only HTTP Basic authentication is supported. When using
+pygerrit2 against an earlier Gerrit version, it may be necessary to replace
+the `HTTPBasic...` classes with the corresponding `HTTPDigest...` versions.
+
+Refer to the `example`_ script for a full working example.
+
+Copyright and License
+---------------------
+
+Copyright 2011 Sony Ericsson Mobile Communications. All rights reserved.
+
+Copyright 2012 Sony Mobile Communications. All rights reserved.
+
+Copyright 2016 David Pursehouse. All rights reserved.
+
+Licensed under The MIT License.  Please refer to the `LICENSE`_ file for full
+license details.
+
+.. _`Gerrit Code Review`: https://gerritcodereview.com/
+.. _`requests`: https://github.com/kennethreitz/requests
+.. _example: https://github.com/dpursehouse/pygerrit2/blob/master/example.py
+.. _`HTTP upload settings`: https://gerrit-documentation.storage.googleapis.com/Documentation/2.14/user-upload.html#http
+.. _LICENSE: https://github.com/dpursehouse/pygerrit2/blob/master/LICENSE
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..7e96dc3
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,20 @@
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = python -msphinx
+SPHINXPROJ    = pygerrit2
+SOURCEDIR     = .
+BUILDDIR      = _build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..b25a4c8
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,168 @@
+# -*- coding: utf-8 -*-
+#
+# pygerrit2 documentation build configuration file, created by
+# sphinx-quickstart on Sun Oct 22 17:32:32 2017.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+# import os
+# import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'pygerrit2'
+copyright = u'2017, David Pursehouse'
+author = u'David Pursehouse'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u''
+# The full version, including alpha/beta/rc tags.
+release = u''
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
... 1419 lines suppressed ...

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



More information about the Python-modules-commits mailing list