ara-cli 0.1.9.54__py3-none-any.whl → 0.1.9.56__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,9 @@ class ArtefactRenamer:
30
30
  if not Classifier.is_valid_classifier(classifier):
31
31
  raise ValueError("Invalid classifier provided. Please provide a valid classifier.")
32
32
 
33
+ fs = self.file_system
33
34
  original_directory = self.navigate_to_target()
35
+ original_directory = fs.path.abspath(original_directory)
34
36
 
35
37
  classified_artefacts = ArtefactReader.read_artefacts()
36
38
 
@@ -45,10 +47,15 @@ class ArtefactRenamer:
45
47
  matching_artefact = matching_artefacts[0]
46
48
 
47
49
  old_file_path = matching_artefact.file_path
48
- old_base_path = self.file_system.path.dirname(old_file_path)
50
+ old_base_path = fs.path.dirname(old_file_path)
49
51
  old_dir_path = f"{old_base_path}/{old_name}.data"
50
52
 
51
- if not self.file_system.path.exists(old_file_path):
53
+ old_file_path_display = old_file_path.replace('./', 'ara/')
54
+ old_dir_path_display = old_dir_path.replace('./', 'ara/')
55
+
56
+ old_dir_exists = fs.path.exists(old_dir_path)
57
+
58
+ if not fs.path.exists(old_file_path):
52
59
  raise FileNotFoundError(f"The file {old_file_path} does not exist.")
53
60
 
54
61
  children_by_classifier = ArtefactReader.find_children(
@@ -59,20 +66,26 @@ class ArtefactRenamer:
59
66
 
60
67
  matching_artefact.title = new_name
61
68
  new_file_path = matching_artefact.file_path
62
- new_base_path = self.file_system.path.dirname(new_file_path)
69
+ new_base_path = fs.path.dirname(new_file_path)
63
70
  new_dir_path = f"{new_base_path}/{new_name}.data"
64
- if self.file_system.path.exists(new_file_path):
71
+ if fs.path.exists(new_file_path):
65
72
  raise FileExistsError(f"The new file name {new_file_path} already exists.")
66
- if self.file_system.path.exists(new_dir_path):
73
+ if fs.path.exists(new_dir_path):
67
74
  raise FileExistsError(f"The new directory name {new_dir_path} already exists.")
68
75
 
76
+ new_file_path_display = new_file_path.replace('./', 'ara/')
77
+ new_dir_path_display = new_dir_path.replace('./', 'ara/')
78
+
69
79
  serialized_artefact = matching_artefact.serialize()
70
80
  with open(matching_artefact.file_path, 'w') as file:
71
81
  file.write(serialized_artefact)
72
- self.file_system.remove(old_file_path)
82
+ fs.remove(old_file_path)
83
+
84
+ print(f"Renamed file: {old_file_path_display} to {new_file_path_display}")
73
85
 
74
- if self.file_system.path.exists(old_dir_path):
75
- self.file_system.rename(old_dir_path, new_dir_path)
86
+ if old_dir_exists:
87
+ fs.rename(old_dir_path, new_dir_path)
88
+ print(f"Renamed directory: {old_dir_path_display} to {new_dir_path_display}")
76
89
 
77
90
  for children in children_by_classifier.values():
78
91
  for child in children:
@@ -83,7 +96,7 @@ class ArtefactRenamer:
83
96
  with open(child.file_path, 'w') as file:
84
97
  file.write(serialized_artefact)
85
98
 
86
- self.file_system.chdir(original_directory)
99
+ fs.chdir(original_directory)
87
100
 
88
101
  def _update_title_in_artefact(self, artefact_path, new_title, classifier):
89
102
  # Format the new title: replace underscores with spaces
ara_cli/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # version.py
2
- __version__ = "0.1.9.54" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
2
+ __version__ = "0.1.9.56" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ara-cli
3
- Version: 0.1.9.54
3
+ Version: 0.1.9.56
4
4
  Requires-Dist: litellm
5
5
  Requires-Dist: llama-index
6
6
  Requires-Dist: llama-index-llms-openai
@@ -10,7 +10,7 @@ ara_cli/artefact_fuzzy_search.py,sha256=XAvoiRafd1u21uKbX5-bow7hdq7uiLLy1KtxHNAF
10
10
  ara_cli/artefact_link_updater.py,sha256=itMS_Z64jE8bBly9WA01z8PqkBeNW6ntTO7ryMeCTRg,3703
11
11
  ara_cli/artefact_lister.py,sha256=jhk4n4eqp7hDIq07q43QzS7-36BM3OfZ4EABxCeOGcw,4764
12
12
  ara_cli/artefact_reader.py,sha256=qNaMPWShmWtDU5LLdh9efFB27djI4NAoq6zEFwdTd38,6983
13
- ara_cli/artefact_renamer.py,sha256=g9rM6GN6mZgjF1Ct6wrH-PuPH1HVF7vhjdyttOfHS1E,4865
13
+ ara_cli/artefact_renamer.py,sha256=aJriqHdkeXAvHx1PuKOhpqgg9EBr7PMv6NK67CCasbU,5319
14
14
  ara_cli/artefact_scan.py,sha256=DgFGv4hnbCjYdIgPA2PbAuGDWg1q2fCjtIqxGs57b9w,1762
15
15
  ara_cli/chat.py,sha256=7xTtPEDk052_wmIzoti7GavEJ1vpRxe5c084WQ1C7dg,28617
16
16
  ara_cli/classifier.py,sha256=zWskj7rBYdqYBGjksBm46iTgVU5IIf2PZsJr4qeiwVU,1878
@@ -31,7 +31,7 @@ ara_cli/run_file_lister.py,sha256=XbrrDTJXp1LFGx9Lv91SNsEHZPP-PyEMBF_P4btjbDA,23
31
31
  ara_cli/tag_extractor.py,sha256=R5T103Y60NppYifKV7b8KoI5kE1M66fULz6f_Fdc9VU,1081
32
32
  ara_cli/template_manager.py,sha256=YXPj2jGNDb-diIHFEK_vGJ-ZucodnXSGAPofKTnOofI,6633
33
33
  ara_cli/update_config_prompt.py,sha256=PZgNIN3dTw6p80GyX8Sp5apkAhSoykwnkEbHo3IOkUo,4571
34
- ara_cli/version.py,sha256=joWtfEHQKcqd_HWWG1S1SAlSYqkEtgwJ2k-0v2dWJTk,146
34
+ ara_cli/version.py,sha256=eKX-p6J2J_ePXQZR0YG8l4etY97ti-S6ePuQYxSf5Zc,146
35
35
  ara_cli/artefact_models/artefact_load.py,sha256=dNcwZDW2Dk0bts9YnPZ0ESmWD2NbsLIvl4Z-qQeGmTQ,401
36
36
  ara_cli/artefact_models/artefact_mapping.py,sha256=8aD0spBjkJ8toMAmFawc6UTUxB6-tEEViZXv2I-r88Q,1874
37
37
  ara_cli/artefact_models/artefact_model.py,sha256=UQaLeuFzVOJViuMbFOgMY8zW7ihgxZZMV86Li7Tpjds,14847
@@ -148,8 +148,8 @@ ara_cli/tests/test_list_filter.py,sha256=gSRKirTtFuhRS3QlFHqWl89WvCvAdVEnFsCWTYm
148
148
  ara_cli/tests/test_tag_extractor.py,sha256=n2xNApbDciqKO3QuaveEWSPXU1PCUa_EhxlZMrukONw,2074
149
149
  ara_cli/tests/test_template_manager.py,sha256=bRxka6cxHsCAOvXjfG8MrVO8qSZXhxW01tnph80UtNk,3143
150
150
  ara_cli/tests/test_update_config_prompt.py,sha256=vSsLvc18HZdVjVM93qXWVbJt752xTLL6VGjSVCrPufk,6729
151
- ara_cli-0.1.9.54.dist-info/METADATA,sha256=OPj9OD4lnrIgr6rBNggL63nB9ITFSgEfDsFVzbT7Bms,367
152
- ara_cli-0.1.9.54.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
153
- ara_cli-0.1.9.54.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
154
- ara_cli-0.1.9.54.dist-info/top_level.txt,sha256=zzee_PwFmKqfBi9XgIunP6xy2S4TIt593CLLxenNaAE,8
155
- ara_cli-0.1.9.54.dist-info/RECORD,,
151
+ ara_cli-0.1.9.56.dist-info/METADATA,sha256=5RAVkALC78xWa4fX_XF_kgnH-GJ9m9QDAKOj7i3v6gE,367
152
+ ara_cli-0.1.9.56.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
153
+ ara_cli-0.1.9.56.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
154
+ ara_cli-0.1.9.56.dist-info/top_level.txt,sha256=zzee_PwFmKqfBi9XgIunP6xy2S4TIt593CLLxenNaAE,8
155
+ ara_cli-0.1.9.56.dist-info/RECORD,,