summaryrefslogtreecommitdiff
path: root/pygerrit/client.py
Commit message (Collapse)AuthorAgeFilesLines
* Add keepalive support to GerritSSHClientVineet Naik2015-06-301-2/+7
| | | | | | | This will allow keeping the SSH sessions alive for a duration of time longer than the timeout configured for the server. Change-Id: I9d86c0fc304783fab944ebae7bd0da8f3b1edd6c
* Restructure docstrings for better html output.David Pursehouse2014-10-301-13/+45
| | | | Change-Id: Ic935e8f85e2ad333677770746c15648ae5bac339
* Revert "Remove support for Gerrit over ssh"David Pursehouse2014-05-291-0/+136
| | | | | | | | | | | | | | | | | | | | | The ssh interface is still being used and patches are being contributed [1]. It's easier to revert the removal on master than attempt to keep the support in a separate branch. This reverts commit f0b77968389966cd7bad0cac1fe7f04526eafde1. [1] https://github.com/sonyxperiadev/pygerrit/pull/21 Conflicts: README.rst example.py requirements.txt setup.py unittests.py Change-Id: I9e02208c57cb2022ff39cff6650101ed40c0519d
* Remove support for Gerrit over sshDavid Pursehouse2014-04-281-136/+0
| | | | | | | | | From now only the REST API is supported. This makes installation of the package a bit lighter as we no longer depend on paramiko and pycrypto Change-Id: Ieda773d596fd43047c05895f3304690ddf709094
* Add method to run a gerrit command from the clientDavid Pursehouse2013-11-071-0/+6
| | | | Change-Id: If1863c06619a11f93efc7c25c7c33c749950d6a5
* Add method to get username and Gerrit versionDavid Pursehouse2013-11-071-0/+4
| | | | | | | | | | If the username is not given in the constructor, it is detected from the ssh config. Add a method that allows the client to get the detected username that was used to connect to Gerrit. Change-Id: I15747d1446b07ce6b250f294fe72842a1be50a6c
* Fix #10: Allow to manually specify ssh username and portDavid Pursehouse2013-09-121-2/+2
| | | | | | | | | | | If the username and port are specified when constructing the client, they will be used instead of attempting to fetch from the ssh config file. In this case the full hostname of the server is required, rather than only the name as listed in the ssh config. Change-Id: I82b8638d99922c9b40a54a8275ffc085f505696f
* Fix #5: Move json parsing and error handling into the event factoryDavid Pursehouse2013-09-111-3/+3
| | | | | | | | | | Pass the raw string into the event factory and parse it to a json object there. If the string is not valid json, generate an error event. Add a unit test for handling of invalid json on the event stream. Change-Id: I209a89fd28c3a594b71443fc106e25d58c5cc1ea
* Don't put copyright and license headers in Python module docstringsDavid Pursehouse2013-08-071-25/+23
| | | | | | | | | | | | | | If the copyright and license headers are in module docstrings, they appear in the generated API documentation pages and it looks crappy. Instead, put the headers in regular Python comments. Thus each file still has the required copyright and license notice, but it is not included everywhere in the generated documentation. The documentation still includes an automatically generated copyright notice at the bottom of each page. Change-Id: Ibc5f4ca221c0a6de26f04f3b4511d8991e28b663
* Add generation of package documentationDavid Pursehouse2013-08-071-1/+1
| | | | | | | | | | Documentation is generated in html format into the docs folder. The idea is that with further commits we can automatically generate and package the documentation into a zip file that can be published to the package index. Change-Id: Ia5719bda59b6224fc05e2021e9054e29990ad22a
* Fix relative importsDavid Pursehouse2013-08-061-6/+6
| | | | Change-Id: I6bc8d92ed1055959f1c24128b8beace814eaf998
* Only allow strings as query terms and commandsDavid Pursehouse2013-08-051-6/+9
| | | | Change-Id: I850978039ca10162a5ae2ab0a4f79374183107ba
* Add missing docstrings to conform to PEP-257David Pursehouse2013-08-041-1/+1
| | | | Change-Id: If06f1ea17740a796142db63e7086f80445f4c6e1
* Python 2.6 style exception handlingDavid Pursehouse2012-10-251-1/+1
| | | | | | | | | | | | Handle exceptions with the syntax: except Exception as e rather than: except Exception, e Change-Id: I883fdc1db541b9d2699712bfd2bd328261635005
* Encapsulate the SSH command results in a classDavid Pursehouse2012-10-241-2/+2
| | | | | | | | Add a new class GerritSSHCommandResult to encapsulate the stdin, stdout, and stderr streams that are returned from running a command over SSH. Change-Id: Ic851c195ac63e530e62198eb7e0af62c2fbd73d5
* Only add query result lines to returned dataDavid Pursehouse2012-10-241-4/+3
| | | | | | | | Only add JSON lines in the results if they contain "project". Otherwise the "rowCount" line, and anything else, will be included in the results as an empty Change object. Change-Id: Ia4de4ed7970c8f5ba87f5e12dd42ff45b459b047
* Handle JSON errors in query resultsDavid Pursehouse2012-10-241-1/+4
| | | | Change-Id: Iadced9142673f1a5f277462bc6d9027db4a53e2d
* Refactor getting the Gerrit versionDavid Pursehouse2012-10-241-16/+3
| | | | | | | | | | | | | Move the functionality to get the Gerrit version from the main client into the SSH client and reimplement it. First attempt to get the version from the underlying Paramiko SSH client. If that fails, fall back to using the `gerrit version` command as before. Get and print the version in the example script. Change-Id: Ia79853f80f898b43c301fcecee61fdfdb75e9811
* Get Gerrit version during client initialisationDavid Pursehouse2012-10-171-0/+17
| | | | | | | | Later the client might have functionality that only works on certain versions of Gerrit. Store the Gerrit version during initialisation. Change-Id: Idcd35baf00d6cd583f6f85b68c4b0a0c3653344b
* Add query functionalityDavid Pursehouse2012-10-171-0/+34
| | | | | | | Add a method that calls `gerrit query` and returns the results as a list of Change objects. Change-Id: Ie58a61e569d457c56109e34041e9db95147de91c
* Move SSH client from stream class to main client classDavid Pursehouse2012-10-161-2/+3
| | | | | | | So it can be reused in query functionality that will be added later. Change-Id: I361aaf8fe8aa9107a94757606a3a1837b6a448ab
* Add license informationDavid Pursehouse2012-09-201-1/+25
| | | | Change-Id: I25ce3fafe7a51d0221f66fe30b2fb7cc8115c4aa
* Wait for thread to complete when stopping streamDavid Pursehouse2012-09-121-0/+1
| | | | Change-Id: I19eac2b83fc0fd6771c703de087b94de372f45af
* Refactor event stream handling to use SSH clientDavid Pursehouse2012-09-111-2/+18
| | | | Change-Id: I4953be92719fddeb7c23c2559ffe954c452cc131
* Add initial stub of GerritClient classDavid Pursehouse2012-08-241-0/+43
The Gerrit client class will be used as an interface to the Gerrit events stream and query functionality. This is the intial stub. More functionality will be added, and existing stream functionality refactored, in later commits. Change-Id: If4ef838c2d3f3e5afaad2a553af49b1c66ad4278