Skip to content

Commit cc70f78

Browse files
committed
Adding
1 parent 4856f9b commit cc70f78

File tree

3 files changed

+351
-324
lines changed

3 files changed

+351
-324
lines changed

.style.yapf

+44-44
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
# YAPF Configuration File
22

33
[style]
4-
based_on_style = pep8
5-
align_closing_bracket_with_visual_indent = False
6-
allow_multiline_lambdas = False
7-
allow_multiline_dictionary_keys = True
8-
allow_split_before_default_or_named_assigns = True
9-
allow_split_before_dict_value = True
10-
arithmetic_precedence_indication = True
11-
blank_lines_around_top_level_definition = 1
12-
blank_line_before_class_docstring = True
13-
blank_lines_between_top_level_imports_and_variables = 2
14-
coalesce_brackets = True
154
column_limit = 120
16-
continuation_align_style = VALIGN-RIGHT
5+
indent_width = 4
6+
use_tabs = false
177
continuation_indent_width = 4
18-
dedent_closing_brackets = True
19-
disable_ending_comma_heuristic = True
20-
each_dict_entry_on_separate_line = True
21-
force_multiline_dict = True
22-
i18n_comment = "#! TODO:"
8+
continuation_align_style = valign-right
9+
join_multiple_lines = false
10+
align_closing_bracket_with_visual_indent = false
11+
allow_multiline_dictionary_keys = true
12+
allow_multiline_lambdas = false
13+
allow_split_before_default_or_named_assigns = true
14+
allow_split_before_dict_value = true
15+
arithmetic_precedence_indication = true
16+
blank_line_before_class_docstring = true
17+
blank_line_before_nested_class_or_def = true
18+
blank_lines_around_top_level_definition = 1
19+
blank_lines_between_top_level_imports_and_variables = 2
20+
coalesce_brackets = true
21+
dedent_closing_brackets = true
22+
disable_ending_comma_heuristic = true
23+
each_dict_entry_on_separate_line = true
24+
force_multiline_dict = true
25+
i18n_comment = "#! todo:"
2326
i18n_function_call = []
24-
indent_blank_lines = False
25-
indent_closing_brackets = True
26-
indent_dictionary_value = True
27-
indent_width = 2
28-
use_tabs = True
29-
join_multiple_lines = False
27+
indent_blank_lines = false
28+
indent_closing_brackets = true
29+
indent_dictionary_value = true
3030
no_spaces_around_selected_binary_operators = ['/']
31-
space_between_ending_comma_and_closing_bracket = False
32-
space_inside_brackets = False
33-
spaces_around_default_or_named_assign = True
34-
spaces_around_dict_delimiters = True
35-
spaces_around_list_delimiters = False
36-
spaces_around_power_operator = False
37-
spaces_around_subscript_colon = True
38-
spaces_around_tuple_delimiters = False
31+
space_between_ending_comma_and_closing_bracket = false
32+
space_inside_brackets = false
33+
spaces_around_default_or_named_assign = true
34+
spaces_around_dict_delimiters = true
35+
spaces_around_list_delimiters = false
36+
spaces_around_power_operator = false
37+
spaces_around_subscript_colon = true
38+
spaces_around_tuple_delimiters = false
3939
spaces_before_comment="15, 20"
40-
split_all_comma_separated_values = False
41-
split_all_top_level_comma_separated_values = True
42-
split_arguments_when_comma_terminated = False
43-
split_before_arithmetic_operator = False
44-
split_before_bitwise_operator = False
45-
split_before_closing_bracket = True
46-
split_before_dict_set_generator = True
47-
split_before_dot = False
48-
split_before_expression_after_opening_paren = False
49-
split_before_first_argument = True
50-
split_before_logical_operator = True
51-
split_before_named_assigns = True
52-
split_complex_comprehension = True
40+
split_all_comma_separated_values = false
41+
split_all_top_level_comma_separated_values = true
42+
split_arguments_when_comma_terminated = false
43+
split_before_arithmetic_operator = false
44+
split_before_bitwise_operator = false
45+
split_before_closing_bracket = true
46+
split_before_dict_set_generator = true
47+
split_before_dot = false
48+
split_before_expression_after_opening_paren = false
49+
split_before_first_argument = true
50+
split_before_logical_operator = true
51+
split_before_named_assigns = true
52+
split_complex_comprehension = true
5353
split_penalty_after_opening_bracket = 0
5454
split_penalty_after_unary_operator = 100
5555
split_penalty_arithmetic_operator = 0

add.py

+51-52
Original file line numberDiff line numberDiff line change
@@ -15,84 +15,83 @@
1515
Disallowed_Characters = r'[\\/*?:"<>|]'
1616

1717
if __name__ == "__main__":
18-
# Part 1 - Validate Data
18+
# Part 1 - Validate Data
1919

20-
# Read Credentials
21-
credentials_file = "\\".join([dirname(abspath(__file__)), "credentials.json"])
20+
# Read Credentials
21+
credentials_file = "\\".join([dirname(abspath(__file__)), "credentials.json"])
2222

23-
# Verify Credentials file valid
23+
# Verify Credentials file valid
2424

25-
# Parse Arguments
26-
args = parse_arguments(credentials_file)
25+
# Parse Arguments
26+
args = parse_arguments(credentials_file)
2727

28-
# Validation
28+
# Validation
2929

30-
# Step 1: Verify provided link is a valid URL
31-
if is_valid_url(args.link):
32-
#
30+
# Step 1: Verify provided link is a valid URL
31+
if is_valid_url(args.link):
3332

34-
# Step 2 : Verify link domain is one of the permitted options.
33+
# Step 2 : Verify link domain is one of the permitted options.
3534

36-
Platform = str((urlparse(args.link).netloc.split(".")[-2 :])[0]).capitalize()
35+
Platform = str((urlparse(args.link).netloc.split(".")[-2 :])[0]).capitalize()
3736

38-
# Step 3 : Check Valid Username
37+
# Step 3 : Check Valid Username
3938

40-
# Step 4 : Check Template.md file exists.
39+
# Step 4 : Check Template.md file exists.
4140

42-
# Step 5: Check Template.md file contains appropriate ids.
41+
# Step 5: Check Template.md file contains appropriate ids.
4342

44-
# Part 2 - Request Info
43+
# Part 2 - Request Info
4544

46-
# Given the URL extract the Challenge ID
47-
ID = extract_id(args.link)
45+
# Given the URL extract the Challenge ID
46+
ID = extract_id(args.link)
4847

49-
# Make API call and Fetch Response
50-
response_json = fetch("{}{}".format(args.link, ID))
48+
# Make API call and Fetch Response
49+
response_json = fetch("{}{}".format(args.link, ID))
5150

52-
# Determine info based on Request Response
53-
Challenge_Name = re.sub(Disallowed_Characters, "", response_json["name"])
54-
Challenge_URL = str("\\".join([response_json["url"], "python"])).strip()
55-
Challenge_Rank = str(re.sub(" ", "-", response_json["rank"]["name"])).strip()
56-
Challenge_Tags = ", ".join(response_json["tags"]).strip()
51+
# Determine info based on Request Response
52+
Challenge_Name = re.sub(Disallowed_Characters, "", response_json["name"])
53+
Challenge_URL = str("\\".join([response_json["url"], "python"])).strip()
54+
Challenge_Rank = str(re.sub(" ", "-", response_json["rank"]["name"])).strip()
55+
Challenge_Tags = ", ".join(response_json["tags"]).strip()
5756

58-
# Call update.py
57+
# Call update.py
5958

60-
# Fetch response in the form of database.json
59+
# Fetch response in the form of database.json
6160

62-
# Validate
61+
# Validate
6362

64-
# Parse JSON
63+
# Parse JSON
6564

66-
# Fetch Completion Date
65+
# Fetch Completion Date
6766

68-
# Part 3 - Update Structure
67+
# Part 3 - Update Structure
6968

70-
# Determine New Challenge file path
71-
path = "\\".join([dirname(abspath(__file__)), Platform, Challenge_Rank, Challenge_Name])
69+
# Determine New Challenge file path
70+
path = "\\".join([dirname(abspath(__file__)), Platform, Challenge_Rank, Challenge_Name])
7271

73-
# Determine template path based on argument or keep default value.
74-
Template_Path = "\\".join([dirname(abspath(__file__)), "Template.md"])
72+
# Determine template path based on argument or keep default value.
73+
Template_Path = "\\".join([dirname(abspath(__file__)), "Template.md"])
7574

76-
# Create a folder for this new challenge based on path.
77-
create_folder(path)
75+
# Create a folder for this new challenge based on path.
76+
create_folder(path)
7877

79-
# Initiate the Folder Structure
80-
initiate_structure(path)
78+
# Initiate the Folder Structure
79+
initiate_structure(path)
8180

82-
# Model README.md based on Template
83-
edit_template(
84-
challenge_name = Challenge_Name,
85-
challenge_url = Challenge_URL,
86-
completion_date = "Wednesday, 30 December 2024",
87-
tags = Challenge_Tags,
88-
template_path = Template_Path,
89-
readme_file = "\\".join([path, "README.md"]),
90-
)
81+
# Model README.md based on Template
82+
edit_template(
83+
challenge_name = Challenge_Name,
84+
challenge_url = Challenge_URL,
85+
completion_date = "Wednesday, 30 December 2024",
86+
tags = Challenge_Tags,
87+
template_path = Template_Path,
88+
readme_file = "\\".join([path, "README.md"]),
89+
)
9190

92-
# Part 4 - Results
91+
# Part 4 - Results
9392

94-
# Ask user for their solution?
93+
# Ask user for their solution?
9594

96-
# Open Folder?
95+
# Open Folder?
9796

98-
# open_file
97+
# open_file

0 commit comments

Comments
 (0)