webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Classes | |
class | HelperError |
Functions | |
def | zero_pad (number, padding=_DEFAULT_PADDING) |
def | run_shell_command (cmd_list, fail_msg=None) |
def | perform_action_on_all_files (directory, file_pattern, file_extension, start_number, action, kwargs) |
def helper_functions.perform_action_on_all_files | ( | directory, | |
file_pattern, | |||
file_extension, | |||
start_number, | |||
action, | |||
kwargs | |||
) |
Function that performs a given action on all files matching a pattern. It is assumed that the files are named file_patternxxxx.file_extension, where xxxx are digits starting from start_number. Args: directory(string): The directory where the files live. file_pattern(string): The name pattern of the files. file_extension(string): The files' extension. start_number(int): From where to start to count frames. action(function): The action to be performed over the files. Must return False if the action failed, True otherwise. It should take a file name as the first argument and **kwargs as arguments. The function must be possible to pickle, so it cannot be a bound function (for instance). Return: (bool): Whether performing the action over all files was successful or not.
def helper_functions.run_shell_command | ( | cmd_list, | |
fail_msg = None |
|||
) |
Executes a command. Args: cmd_list(list): Command list to execute. fail_msg(string): Message describing the error in case the command fails. Return: (string): The standard output from running the command. Raise: HelperError: If command fails.
def helper_functions.zero_pad | ( | number, | |
padding = _DEFAULT_PADDING |
|||
) |
Converts an int into a zero padded string. Args: number(int): The number to convert. padding(int): The number of chars in the output. Note that if you pass for example number=23456 and padding=4, the output will still be '23456', i.e. it will not be cropped. If you pass number=2 and padding=4, the return value will be '0002'. Return: (string): The zero padded number converted to string.