Initializes our child and then starts it. It takes our pool’s childqueue, our pool’s workqueue, our child’s number to report back statuses, our base log directory, and a collection of options.
Parameters: |
|
---|---|
Returns: | Child (self) |
Sends a display message to the main loop, which is then translated to the UI.
Parameters: | t – The status this child will now show, a constant starting with DISP in const.py. |
---|---|
Returns: | None |
Checks if the child’s process is still running, if it is then it returns True, otherwise False. There’s a check for if the process is None, which is set when a child terminates.
Returns: | Boolean for if Child process is still active (different from if a child is processing data). |
---|
Log Screenshot of Error with Exception Renders a screenshot of what it sees then writes it to our log directory as error_#.png Also takes the exception we received and exports it as text
Parameters: |
|
---|---|
Returns: | String for screenshot location, if any. |
Writes to our message log if level is greater than or equal to our level (in self.log).
Parameters: |
|
---|---|
Kwargs: |
|
Returns: | None |
Restarts the child process and gets webdriver running again.
Parameters: |
|
---|---|
Returns: | None |
Saves a screenshot to error_#.png and prints a message into the log specifying the file logged to.
Parameters: | level (NOTICE) – This determines whether or not the error message will be logged according to the level set in self.level. The screenshot will print anyway. If this error is not greater or equal to the level specified in self.level, it is not printed. If it is, the message is printed into log.txt with the level specified by the timestamp. |
---|---|
Returns: | String for screenshot location |
Starts our child process off properly, used after a restart typically.
Parameters: | flag (DISP_LOAD) – A custom flag to change the display color of the child, if desired. |
---|---|
Returns: | None |
Uses a multiprocess-safe variable to transmit our status upstream. These values are listed under universal status types in const.py. The status types allow better logging and, for example, prevent children that were already terminated from being terminated again (and throwing an exception).
When called with a type it will set this child’s status on both the main process and the child’s process. When called without it, it reads from the status variable.
Parameters: | type (None) – The new value of our status. |
---|---|
Returns: | If type isn’t specified, our status. If it is, it sets our type and returns None. |
Stops a child process properly and sets its self.proc to None. Optionally takes a message to print out.
Parameters: |
|
---|---|
Returns: | None |
Bases: selenium.webdriver.phantomjs.service.Service
This class sits atop our PhantomJSService class included in webdriver to implemention service_args inclusion, which we pass by default –load-images=no to disable images.
Parameters: | PhantomJSService – Pass this function the PhantomJSService class so that it can patch on top of it. |
---|---|
Returns: | PhantomJsNoImages (self) |