rpyc_docker package¶
Submodules¶
rpyc_docker.browser module¶
-
class
rpyc_docker.browser.
Browser
[source]¶ Bases:
object
-
get_element_image
(element)[source]¶ takes screenshot of an element returns it as a PIL image on IPython notebook the PIL image will be automatically displayed. Requires that PIL or Pillows is installed
-
js_ex
(script, *args)[source]¶ convenience function to execute javascript.
Parameters: - script – The JavaScript to execute.
- *args –
Any applicable arguments for your JavaScript.
-
patch_pydisplay
()[source]¶ monkey patch xvnc to use password file if using xvnc backend call this function before calling setup
-
setup
(visible=False, driver='firefox', backend='xvfb', opt=None)[source]¶ Sets up the webbrowser
Parameters: - visible (bool) – if True, visible if False runs as headless
- driver (str or rpyc_docker.drivers.WebDriver) – either “firefox” or “chrome” or a an instance of rpyc_docker.drivers.WebDriver
- backend (str) – either “xvfb” or xvnc” if xvnc then it will start and xvnc server which can be connected to. Default password is secret.
- opt (None) – not used
Returns: True if successful
Return type: bool
-
rpyc_docker.drivers module¶
rpyc_docker.manager module¶
-
class
rpyc_docker.manager.
Manager
(argQueue, numWorkers, maxTime=300)[source]¶ Bases:
threading.Thread
-
get_error
(n)[source]¶ returns the traceback of a worker if it has crashed
Parameters: n (int) – worker number Returns: traceback Return type: str:
-
get_result
(n)[source]¶ returns the result of a worker if it has finished
Parameters: n (int) – worker number Returns: result Return type: object:
-
managerTraceback
¶ shows traceback of manager if it has crashed
Returns: traceback of manager Return type: string
-
rpyc_docker.rpyc_browser_worker module¶
rpyc_docker.rpyc_worker module¶
-
class
rpyc_docker.rpyc_worker.
RpycWorker
(docker, mount=None)[source]¶ Bases:
rpyc_docker.worker.Worker
-
image
= 'ubuntu/rpyc_worker:pexpect'¶ there is a conflict with the ports when starting containers this needs to be fixed
-
vncPort
¶ Returns: port vncserver is listening on Return type: int
-