Jira Convert Task Session Script To Readme module
Convert a script session file to a README file.
convert_file(infile, outfile, jira_id, verbose=DEFAULT_VERBOSE, command_prompt=DEFAULT_COMMAND_PROMPT, command_start=DEFAULT_COMMAND_START)
Convert the input file to a README file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
infile |
str
|
The input file absolute path. |
required |
outfile |
str
|
The output file absolute path. |
required |
jira_id |
str
|
The Jira issue id. |
required |
verbose |
bool
|
Will print more info to STDOUT. Defaults to DEFAULT_VERBOSE. |
DEFAULT_VERBOSE
|
command_prompt |
str
|
The command prompt string. Defaults to DEFAULT_COMMAND_PROMPT. |
DEFAULT_COMMAND_PROMPT
|
command_start |
str
|
The command start string. Defaults to DEFAULT_COMMAND_START. |
DEFAULT_COMMAND_START
|
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
create_readme_file(jira_dir, jira_id, url, verbose=DEFAULT_VERBOSE)
Create the README file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jira_dir |
str
|
The Jira issue directory. |
required |
jira_id |
str
|
The Jira issue id. |
required |
url |
str
|
The Jira issue URL. |
required |
verbose |
bool
|
If true print more info to STDOUT. Defaults to DEFAULT_VERBOSE. |
DEFAULT_VERBOSE
|
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
create_symlink_directory(jira_dir, verbose=DEFAULT_VERBOSE)
Create the symlink to the Jira issue directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jira_dir |
str
|
The Jira issue directory. |
required |
verbose |
bool
|
If True print info to STDOUT. Defaults to DEFAULT_VERBOSE. |
DEFAULT_VERBOSE
|
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
echo_script(jira_id, jira_dir)
Start the script command.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jira_id |
str
|
The Jira issue id. |
required |
jira_dir |
str
|
The directory where the script file will be written. |
required |
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
get_description()
Prompt the user for a description of the command.
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
get_file_content(infile, command_prompt=DEFAULT_COMMAND_PROMPT, command_start=DEFAULT_COMMAND_START)
Read the file and return the content as a list of lists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
infile |
str
|
The input file absolute path. |
required |
command_prompt |
str
|
The command prompt string. Defaults to DEFAULT_COMMAND_PROMPT. |
DEFAULT_COMMAND_PROMPT
|
command_start |
str
|
The command start string. Defaults to DEFAULT_COMMAND_START. |
DEFAULT_COMMAND_START
|
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: The content of the file as a list of lists. |
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
include()
Prompt the user to include the command in the README.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the user wants to include the command in the README, False otherwise. |
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
initialize_jira_directory(jira_id, verbose=DEFAULT_VERBOSE)
Create the Jira id directory and return the that path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jira_id |
str
|
The Jira issue id |
required |
Returns:
Name | Type | Description |
---|---|---|
dir |
str
|
The absolute path to the Jira issue directory created |
Source code in jira_python_utils/jira_convert_task_session_script_to_readme.py
main(config_file, infile, jira_id, logfile, outdir, outfile, verbose)
Convert a script session file to a README file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_file |
str
|
The configuration file. |
required |
infile |
str
|
The input script session file. |
required |
jira_id |
str
|
The Jira ticket identifier. |
required |
logfile |
str
|
The log file. |
required |
outdir |
str
|
The output directory. |
required |
outfile |
str
|
The output README file. |
required |
verbose |
bool
|
The verbose flag. |
required |