Function | remove_tree | Remove the tree at 'path' from disk. |
Function | set_environ | Set the environment variables as specified by new_values. |
Function | override_environ | Override environment variables with the kwarg values. |
Function | ensure_directory_exists | Create 'directory' if it doesn't exist. |
Function | open_for_writing | Open 'filename' for writing, creating directories if necessary. |
Function | two_stage_kill | Kill process 'pid' with SIGTERM. If it doesn't die, SIGKILL it. |
Function | get_pid_from_file | Retrieve the PID from the given file, if it exists, None otherwise. |
Function | kill_by_pidfile | Kill a process identified by the pid stored in a file. |
Function | remove_if_exists | Remove the given file if it exists. |
Function | write_file | Undocumented |
Function | find_on_path | Is 'command' on the executable search path? |
Function | process_exists | Return True if the specified process already exists. |
Function | _kill_may_race | Kill a pid accepting that it may not exist. |
Returns | a dict of the old values |
If a value is None, the environment variable is deleted. Variables are restored to their previous state when exiting the context.
Returns | True if the directory had to be created, False otherwise. |
Parameters | filename | The path of the file to open. |
mode | The mode to open the filename with. Should be 'w', 'a' or something similar. See open for more details. If you pass in a read-only mode (e.g. 'r'), then we'll just accept that and return a read-only file-like object. | |
dirmode | The mode to use to create directories, if necessary. | |
Returns | A file-like object that can be used to write to 'filename'. |
Parameters | pid | The pid of the process to kill. |
poll_interval | The polling interval used to check if the process is still around. | |
num_polls | The number of polls to do before doing a SIGKILL. | |
get_status | If True, collect the process' exit status (which requires it to be a child of the process running this function). |