summaryrefslogtreecommitdiff
path: root/example.py
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Remove support for Gerrit over ssh"David Pursehouse2014-05-291-55/+58
| | | | | | | | | | | | | | | | | | | | | 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
* Stop using pylintDavid Pursehouse2014-05-021-2/+0
| | | | | | | | - It has dependencies on several other modules. - It is too strict. It should be enough to run pyflakes. Change-Id: I17d1c3390e5530e2b2a86d680d9816a29f272707
* Remove support for Gerrit over sshDavid Pursehouse2014-04-281-58/+57
| | | | | | | | | 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
* Fix up usage of argparse in examplesDavid Pursehouse2014-04-111-10/+12
| | | | | | | | | | | | | | | | | | | Since a76db4cfc83d4cf7a52d045e4df82ec8b1e3f562 it is broken. - Use ArgumentDefaultsHelpFormatter to automatically show default values for the options. - Remove hard-coded 'default' information from help texts. - Add a metavar for the ssh event timeout option. - Integer arguments must now be specified as `int` rather than `'int'` with quotation marks. - Fix calls to `parser.parse_args`, which now returns a single value rather than a tuple. Change-Id: If5cf4e2d1f4014a60f7a7634d43df12b788bc7b4
* Update examples to use argparse instead of optparseAndrey Devyatkin2014-04-111-24/+24
| | | | | | optparse was deprecated since 2.7 and removed in python 3 Change-Id: Ic5bccb171f45c4948dad47e8fc6fb5830d6dfcff
* Fix #10: Allow to manually specify ssh username and portDavid Pursehouse2013-09-121-1/+8
| | | | | | | | | | | 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
* Allow example script to continue if errors are receivedDavid Pursehouse2013-09-111-1/+4
| | | | | | | | | Add an option to ignore error events and continue receiving. Connection errors are not ignored and will still result in the script exiting. Change-Id: I807fa50700eb6970b7fbabe48c499fe513717c4d
* Fix #5: Move json parsing and error handling into the event factoryDavid Pursehouse2013-09-111-2/+2
| | | | | | | | | | 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
* Improved logging in the example scriptDavid Pursehouse2013-09-111-1/+7
| | | | | | | | - Add --verbose option to enable DEBUG logging. - Add timestamp and log level to the output format. Change-Id: I11ca42095d7ee24782d39141fae20b8b26695fff
* Add __repr__ methods on event and model classesDavid Pursehouse2013-09-111-1/+1
| | | | | | | | | | This gives more meaningful output when doing: print(event) and means it's not necessary to use str(event). Change-Id: I3c1546ab89c481bec24fbc4445ed7f33aa05eff8
* 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
* Make the shebangs consistentDavid Pursehouse2013-08-061-0/+1
| | | | Change-Id: I713c3ce5205b6e6f63d9ecc15882566a63b71c3e
* Better error message in example scriptDavid Pursehouse2013-01-291-1/+1
| | | | Change-Id: Icfbea6f47028accd3c976279e6eafdcb0b76b226
* Better error handling in the example scriptDavid Pursehouse2013-01-181-3/+17
| | | | | | | | | Exit with non-zero status if any error occurs when setting up the Gerrit connection or when starting the event stream. Also make sure the event stream is stopped before exiting. Change-Id: Ibf3742b834e30a019fa952440277f9027b8e85ea
* Refactor getting the Gerrit versionDavid Pursehouse2012-10-241-0/+1
| | | | | | | | | | | | | 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
* Add __str__ on event base classDavid Pursehouse2012-10-161-1/+1
| | | | Change-Id: I26f1c11223b4271c3e5a74c9333a1f7513c5acab
* Add license informationDavid Pursehouse2012-09-201-1/+25
| | | | Change-Id: I25ce3fafe7a51d0221f66fe30b2fb7cc8115c4aa
* Add an example of how the Gerrit client class is usedDavid Pursehouse2012-09-121-0/+55
Change-Id: Ia6df5a588e4789fdf24825a8492f6c11b35e899b