Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sibson/vncdotool
Browse files Browse the repository at this point in the history
  • Loading branch information
sibson committed Mar 1, 2018
2 parents 428108f + 5dbb3b5 commit a1cd622
Show file tree
Hide file tree
Showing 15 changed files with 310 additions and 3,438 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.0.0 (unreleased)
----------------------
- connect via UNIX sockets, thanks Matteo Cafasso
- bugfix, XTightVNC initial connection, thanks Antti Kervinen

0.11.2 (2017-09-24)
----------------------
- fix version metadata, thanks Kevin Gottsman
Expand Down
5 changes: 5 additions & 0 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ running::

nosetests tests/functional

The RFB/VNC Protocol
-----------------------
There is a community effort to document the protcol, _rfbproto_.

Release
--------
Expand All @@ -18,3 +21,5 @@ Release
6. add new section to CHANGELOG
7. update setup.py version
8. blog post/twitter

.. _rfbproto: https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst
7 changes: 0 additions & 7 deletions docs/appendix.rst

This file was deleted.

24 changes: 22 additions & 2 deletions docs/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,35 @@ To use the syncronous API you can do the following::
from vncdotool import api
client = api.connect('vnchost:display', password=None)

You can then call any of the methods available on
You can then call any of the methods available on
:class:`vncdotool.client.VNCDoToolClient` and they will block until completion.
For example::

client.captureScreen('screenshot.png')
client.keyPress('enter')
client.expectScreen('login_success.png', maxrms=10)

This can be used to automate the starting of an Virtual Machine or other application::
It is possible to set a per-client timeout in seconds to prevent calls from blocking indefinitely.

::

client.timeout = 10
try:
client.captureScreen('screenshot.png')
except TimeoutError:
print('Timeout when capturing screen')

In case of too many timeout errors, it is recommended to reset the client connection via the `disconnect` and `connect` methods.

The :class:`vncdotool.client.VNCDoToolClient` supports the context manager protocol.

::

with api.connect('vnchost:display') as client:
client.captureScreen('screenshot.png')


The syncronous API can be used to automate the starting of a Virtual Machine or other application::

vmtool.start('myvirtualmachine.img')
client.connect('vmaddress::5950')
Expand Down
Loading

0 comments on commit a1cd622

Please sign in to comment.