Skip to content

Commit

Permalink
Adjust doc comments to 79 character max line length
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Spelchak committed Feb 8, 2018
1 parent f619906 commit d41df08
Showing 1 changed file with 77 additions and 64 deletions.
141 changes: 77 additions & 64 deletions lib/galaxy/jobs/dynamic_tool_destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,27 @@ def get_keys_from_dict(dl, keys_list):

class RuleValidator:
"""
This class is the primary facility for validating configs. It's always called
in map_tool_to_destination and it's called for validating config directly through
DynamicToolDestination.py
This class is the primary facility for validating configs. It's always
called in map_tool_to_destination and it's called for validating config
directly through DynamicToolDestination.py
"""

@classmethod
def validate_rule(cls, rule_type, return_bool=False, *args, **kwargs):
"""
This function is responsible for passing each rule to its relevant function.
This function is responsible for passing each rule to its relevant
function.
@type rule_type: str
@param rule_type: the current rule's type
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@rtype: bool, dict (depending on return_bool)
@return: validated rule or result of validation (depending on return_bool)
@return: validated rule or result of validation (depending on
return_bool)
"""
if rule_type == 'file_size':
return cls.__validate_file_size_rule(return_bool, *args, **kwargs)
Expand All @@ -93,21 +95,22 @@ def __validate_file_size_rule(
This function is responsible for validating 'file_size' rules.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
@rtype: bool, dict (depending on return_bool)
@return: validated rule or result of validation (depending on return_bool)
@return: validated rule or result of validation (depending on
return_bool)
"""

rule = copy.deepcopy(original_rule)
Expand Down Expand Up @@ -146,21 +149,22 @@ def __validate_num_input_datasets_rule(
This function is responsible for validating 'num_input_datasets' rules.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
@rtype: bool, dict (depending on return_bool)
@return: validated rule or result of validation (depending on return_bool)
@return: validated rule or result of validation (depending on
return_bool)
"""

rule = copy.deepcopy(original_rule)
Expand Down Expand Up @@ -198,21 +202,22 @@ def __validate_records_rule(cls, return_bool, original_rule, counter, tool):
This function is responsible for validating 'records' rules.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
@rtype: bool, dict (depending on return_bool)
@return: validated rule or result of validation (depending on return_bool)
@return: validated rule or result of validation (depending on
return_bool)
"""

rule = copy.deepcopy(original_rule)
Expand Down Expand Up @@ -251,21 +256,22 @@ def __validate_arguments_rule(
This is responsible for validating 'arguments' rules.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
@rtype: bool, dict (depending on return_bool)
@return: validated rule or result of validation (depending on return_bool)
@return: validated rule or result of validation (depending on
return_bool)
"""

rule = copy.deepcopy(original_rule)
Expand Down Expand Up @@ -304,19 +310,19 @@ def __validate_nice_value(cls, valid_rule, return_bool, rule, tool, counter):
This function is responsible for validating nice_value.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type valid_rule: bool
@param valid_rule: returns True if everything is valid. False if it encounters any
abnormalities in the config.
@param valid_rule: returns True if everything is valid. False if it
encounters any abnormalities in the config.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
Expand Down Expand Up @@ -356,19 +362,19 @@ def __validate_destination(cls, valid_rule, return_bool, rule, tool, counter):
This function is responsible for validating destination.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type valid_rule: bool
@param valid_rule: returns True if everything is valid. False if it encounters any
abnormalities in the config.
@param valid_rule: returns True if everything is valid. False if it
encounters any abnormalities in the config.
@type rule: dict
@param rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
Expand Down Expand Up @@ -483,19 +489,19 @@ def __validate_bounds(cls, valid_rule, return_bool, rule, tool, counter):
This function is responsible for validating bounds.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type valid_rule: bool
@param valid_rule: returns True if everything is valid. False if it encounters any
abnormalities in the config.
@param valid_rule: returns True if everything is valid. False if it
encounters any abnormalities in the config.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
Expand Down Expand Up @@ -558,19 +564,19 @@ def __validate_arguments(cls, valid_rule, return_bool, rule, tool, counter):
This function is responsible for validating arguments.
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type valid_rule: bool
@param valid_rule: returns True if everything is valid. False if it encounters any
abnormalities in the config.
@param valid_rule: returns True if everything is valid. False if it
encounters any abnormalities in the config.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
Expand All @@ -597,19 +603,19 @@ def __validate_users(cls, valid_rule, return_bool, rule, tool, counter):
This function is responsible for validating users (if present).
@type return_bool: bool
@param return_bool: True when we are only interested in the result of the
validation, and not the validated rule itself.
@param return_bool: True when we are only interested in the result of
the validation, and not the validated rule itself.
@type valid_rule: bool
@param valid_rule: returns True if everything is valid. False if it encounters any
abnormalities in the config.
@param valid_rule: returns True if everything is valid. False if it
encounters any abnormalities in the config.
@type original_rule: dict
@param original_rule: contains the original received rule
@type counter: int
@param counter: this counter is used to identify what rule # is currently being
validated. Necessary for log output.
@param counter: this counter is used to identify what rule # is
currently being validated. Necessary for log output.
@type tool: str
@param tool: the name of the current tool. Necessary for log output.
Expand Down Expand Up @@ -675,7 +681,10 @@ def parse_yaml(path="/config/tool_destinations.yml", job_conf_path="/config/job_
Get a yaml file from path and send it to validate_config for validation.
@type path: str
@param path: the path to the config file
@param path: the path to the tool destinations config file
@type job_conf_path: str
@param job_conf_path: the path to the job config file
@type test: bool
@param test: indicates whether to run in test mode or production mode
Expand Down Expand Up @@ -1202,6 +1211,9 @@ def map_tool_to_destination(
@type path: str
@param path: path to tool_destinations.yml
@type job_conf_path: str
@param job_conf_path: path to job_conf.xml
"""
importer(test)

Expand Down Expand Up @@ -1516,12 +1528,13 @@ def get_destination_list_from_job_config(job_config_location='/config/job_conf.x

if __name__ == '__main__':
"""
This function is responsible for running the app if directly run through the
commandline. It offers the ability to specify a config through the commandline
for checking whether or not it is a valid config. It's to be run from within Galaxy,
assuming it is installed correctly within the proper directories in Galaxy, and it
looks for the config file in galaxy/config/. It can also be run with a path pointing
to a config file if not being run directly from inside Galaxy install directory.
This function is responsible for running the app if directly run through
the commandline. It offers the ability to specify a config through the
commandline for checking whether or not it is a valid config. It's to be
run from within Galaxy, assuming it is installed correctly within the
proper directories in Galaxy, and it looks for the config file in
galaxy/config/. It can also be run with a path pointing to a config file if
not being run directly from inside Galaxy install directory.
"""
verbose = True

Expand Down

0 comments on commit d41df08

Please sign in to comment.