summaryrefslogtreecommitdiff
path: root/example.py
Commit message (Collapse)AuthorAgeFilesLines
* 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