rpyc_docker package

Submodules

rpyc_docker.browser module

class rpyc_docker.browser.Browser[source]

Bases: object

driver_chrome()[source]
driver_firefox()[source]
get_attributes(element)[source]

gets all of the attributes of a selenium web element

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.

js_ex_file(fileName)[source]
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

teardown()[source]

tears down the webbrowser

rpyc_docker.drivers module

class rpyc_docker.drivers.ChromeDriver(chromeDriverPath=None, **kwargs)[source]

Bases: rpyc_docker.drivers.WebDriver

get_plugins()[source]
setup()[source]
class rpyc_docker.drivers.FirefoxDriver(**kwargs)[source]

Bases: rpyc_docker.drivers.WebDriver

setup()[source]
setup_profile()[source]
class rpyc_docker.drivers.WebDriver(browserBinary=None, profileDir=None, userAgent=None)[source]

Bases: object

get_userAgent()[source]
setup()[source]

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
report()[source]

generates report of the status of the manager

Returns:report
Return type:string
run()[source]
stop()[source]

stops the manager, there might be a delay before it loops throught the workers

rpyc_docker.rpyc_browser_worker module

class rpyc_docker.rpyc_browser_worker.BrowserRpycWorker(docker, mount=None)[source]

Bases: rpyc_docker.rpyc_worker.RpycWorker

dump_page(destDir)[source]
setup_browser(driver, visible=False, backend='xvfb')[source]

rpyc_docker.rpyc_worker module

class rpyc_docker.rpyc_worker.RpycWorker(docker, mount=None)[source]

Bases: rpyc_docker.worker.Worker

connect_rpyc()[source]
create_container(vncExternal=False)[source]
docker_ls(path='')[source]
docker_ps()[source]

gets all the processes running in the docker container

enable_logger(name=None, stdError=False)[source]
image = 'ubuntu/rpyc_worker:pexpect'

there is a conflict with the ports when starting containers this needs to be fixed

teardown()[source]
vncPort
Returns:port vncserver is listening on
Return type:int
write_file(filePath, content)[source]

rpyc_docker.worker module

class rpyc_docker.worker.Worker[source]

Bases: threading.Thread

cmd(cmd)[source]
classmethod inc_workers()[source]
run()[source]
setup()[source]
teardown()[source]
upTime
work()[source]

Module contents