|
65 | 65 | # Show the tui for confirm the data and choose the language to solve the problem
|
66 | 66 | data = Data(title, level, problem_path)
|
67 | 67 | tui.confirm_data(data)
|
68 |
| -print(data) |
69 |
| -exit(0) |
70 | 68 |
|
71 | 69 | # Download the images if there are any
|
72 | 70 | for img in discription.find_all("img"):
|
|
102 | 100 | f.write("## There is no note for this problem yet ¯\(ツ)/¯")
|
103 | 101 |
|
104 | 102 | # Create the solution project for each language
|
105 |
| -for lang in data.solve_with: |
106 |
| - lang_path = os.path.join(data.problem_path, lang) |
107 |
| - if not os.path.exists(lang_path): |
108 |
| - os.mkdir(lang_path) |
109 |
| - match lang: |
110 |
| - case "python" | "py": |
111 |
| - create_python_project(lang_path) |
112 |
| - case "java": |
113 |
| - create_java_project(lang_path) |
114 |
| - case "c++" | "cpp": |
115 |
| - create_cpp_project(lang_path) |
116 |
| - case "c": |
117 |
| - create_c_project(lang_path) |
118 |
| - case "rust": |
119 |
| - create_rust_project(lang_path) |
120 |
| - case "go": |
121 |
| - create_go_project(lang_path) |
122 |
| - case _: # If other language, do nothing |
123 |
| - pass |
| 103 | +if data.solve_with: |
| 104 | + print("Creating the solution projects...") |
| 105 | + for lang in data.solve_with: |
| 106 | + lang_path = os.path.join(data.problem_path, lang) |
| 107 | + if not os.path.exists(lang_path): |
| 108 | + os.mkdir(lang_path) |
| 109 | + match lang: |
| 110 | + case "python" | "py": |
| 111 | + create_python_project(lang_path) |
| 112 | + case "java": |
| 113 | + create_java_project(lang_path) |
| 114 | + case "c++" | "cpp": |
| 115 | + create_cpp_project(lang_path) |
| 116 | + case "c": |
| 117 | + create_c_project(lang_path) |
| 118 | + case "rust": |
| 119 | + create_rust_project(lang_path) |
| 120 | + case "go": |
| 121 | + create_go_project(lang_path) |
| 122 | + case _: # If other language, do nothing |
| 123 | + pass |
| 124 | +else: |
| 125 | + print("No language to solve the problem with, skipping the solution projects creation...") |
124 | 126 |
|
0 commit comments