5
5
import difflib
6
6
import sys
7
7
8
+ # TODO:(piotr1215) fallback if tree is not installed
8
9
def get_tree_structure ():
9
10
"""
10
11
Retrieves the current directory structure using the 'tree' command.
@@ -36,7 +37,6 @@ def generate_diff(old_tree, new_tree):
36
37
)
37
38
return '' .join (diff )
38
39
39
- # 1. Traverse the current directory and build a dictionary mapping step numbers to paths
40
40
def get_current_steps_dict (directory_items ):
41
41
"""
42
42
Build a dictionary mapping step numbers to their respective paths.
@@ -58,7 +58,6 @@ def get_current_steps_dict(directory_items):
58
58
pass # This handles cases where the step name is not a number
59
59
return steps_dict
60
60
61
- # 2. Take input from the user for the new step's name and the desired step number
62
61
def get_user_input (steps_dict , step_title_input , step_number_input ):
63
62
"""
64
63
Prompt the user for the new step's title and the desired step number, then validate the input.
@@ -84,7 +83,6 @@ def get_user_input(steps_dict, step_title_input, step_number_input):
84
83
85
84
return step_title , step_number
86
85
87
- # 3. Determine the renaming and shifting required based on user input
88
86
def plan_renaming (steps_dict , insert_step_num ):
89
87
"""
90
88
Create a plan for renaming step directories and files after inserting a new step.
@@ -111,6 +109,7 @@ def plan_renaming(steps_dict, insert_step_num):
111
109
renaming_plan .reverse ()
112
110
return renaming_plan
113
111
112
+ # TODO:(piotr1215) replace os calls with data structure
114
113
def calculate_renaming_operations (renaming_plan ):
115
114
"""
116
115
Calculate the file operations required to execute the renaming plan.
@@ -247,8 +246,6 @@ def display_help():
247
246
248
247
def main ():
249
248
"""
250
- The main entry point for the CLI tool.
251
-
252
249
This function orchestrates the entire process of adding a new step to the scenario,
253
250
from taking user input to updating the file system and the index.json file.
254
251
It ensures that the 'index.json' file is present, gathers the current directory structure,
0 commit comments