nano-dev-utils 1.5.2__tar.gz → 1.6.2__tar.gz
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.
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/workspace.xml +94 -122
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/PKG-INFO +1 -1
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/benchmark/benchtest_bkp.py +34 -6
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/pyproject.toml +6 -1
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/src/nano_dev_utils/__init__.py +14 -4
- nano_dev_utils-1.6.2/src/nano_dev_utils/__main__.py +129 -0
- nano_dev_utils-1.6.2/src/nano_dev_utils/__version__.py +1 -0
- nano_dev_utils-1.6.2/src/nano_dev_utils/_constants.py +2 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/src/nano_dev_utils/common.py +20 -1
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/src/nano_dev_utils/file_tree_display.py +21 -6
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/update_package.py +2 -2
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/uv.lock +241 -242
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.gitignore +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/.gitignore +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/encodings.xml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/misc.xml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/modules.xml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/nano_dev_utils.iml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.idea/vcs.xml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/.pre-commit-config.yaml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/LICENSE +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/README.md +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/benchmark/__init__.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/benchmark/benchtest.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/benchmark/win_tree_wrapper.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/ruff.toml +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/src/nano_dev_utils/dynamic_importer.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/src/nano_dev_utils/release_ports.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/src/nano_dev_utils/timers.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/__init__.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_common.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_dynamic_importer.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_file_tree_display.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_release_ports.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_timers/__init__.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_timers/conftest.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_timers/test_duration_formatter.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_timers/test_timer.py +0 -0
- {nano_dev_utils-1.5.2 → nano_dev_utils-1.6.2}/tests/test_timers/test_timers_async.py +0 -0
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="1859e23b-7665-4b92-98cc-65e07a208923" name="Changes" comment="
|
|
8
|
-
<change beforePath="$PROJECT_DIR$/
|
|
7
|
+
<list default="true" id="1859e23b-7665-4b92-98cc-65e07a208923" name="Changes" comment="versioning updates; load_cfg_file minor update; v1.6.1">
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/src/nano_dev_utils/__main__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/nano_dev_utils/__main__.py" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/src/nano_dev_utils/__version__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/nano_dev_utils/__version__.py" afterDir="false" />
|
|
9
10
|
</list>
|
|
10
11
|
<option name="SHOW_DIALOG" value="false" />
|
|
11
12
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
<option name="PUSH_AUTO_UPDATE" value="true" />
|
|
24
25
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
|
25
26
|
<map>
|
|
26
|
-
<entry key="$PROJECT_DIR$" value="
|
|
27
|
+
<entry key="$PROJECT_DIR$" value="FI-CLI" />
|
|
27
28
|
</map>
|
|
28
29
|
</option>
|
|
29
30
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
@@ -39,69 +40,48 @@
|
|
|
39
40
|
<option name="showLibraryContents" value="true" />
|
|
40
41
|
<option name="showMembers" value="true" />
|
|
41
42
|
</component>
|
|
42
|
-
<component name="PropertiesComponent"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
43
|
+
<component name="PropertiesComponent">{
|
|
44
|
+
"keyToString": {
|
|
45
|
+
"Python tests.Python tests in test_dynamic_importer.py.executor": "Run",
|
|
46
|
+
"Python tests.Python tests in test_file_tree_display.py.executor": "Run",
|
|
47
|
+
"Python tests.Python tests in test_release_ports.py.executor": "Run",
|
|
48
|
+
"Python tests.Python tests in test_timer.py.executor": "Run",
|
|
49
|
+
"Python tests.Python tests in test_timers (1).executor": "Run",
|
|
50
|
+
"Python tests.Python tests in test_timers.executor": "Run",
|
|
51
|
+
"Python tests.Python tests in test_timers_async.py.executor": "Run",
|
|
52
|
+
"Python tests.Python tests in testing_duration_formatter.py.executor": "Run",
|
|
53
|
+
"Python tests.Python tests in tests.executor": "Run",
|
|
54
|
+
"Python tests.test_timer prev.executor": "Run",
|
|
55
|
+
"Python.__main__.executor": "Debug",
|
|
56
|
+
"Python.benchtest.executor": "Run",
|
|
57
|
+
"Python.benchtest_bkp.executor": "Run",
|
|
58
|
+
"Python.ftd_main.executor": "Run",
|
|
59
|
+
"Python.test_timer.executor": "Run",
|
|
60
|
+
"Python.update_package.executor": "Run",
|
|
61
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
62
|
+
"git-widget-placeholder": "master",
|
|
63
|
+
"ignore.virus.scanning.warn.message": "true",
|
|
64
|
+
"last_opened_file_path": "C:/GitHubWS/nano_dev_utils/src",
|
|
65
|
+
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
|
|
66
|
+
"two.files.diff.last.used.file": "C:/Workspaces/review1/tools/file_tree_display/tests/test_file_tree_display.py"
|
|
65
67
|
}
|
|
66
|
-
}
|
|
68
|
+
}</component>
|
|
67
69
|
<component name="RecentsManager">
|
|
68
70
|
<key name="CopyFile.RECENT_KEYS">
|
|
71
|
+
<recent name="C:\GitHubWS\nano_dev_utils\src" />
|
|
69
72
|
<recent name="C:\GitHubWS\nano_dev_utils\benchmark" />
|
|
70
73
|
<recent name="C:\GitHubWS\nano_dev_utils\src\nano_dev_utils" />
|
|
71
74
|
<recent name="C:\GitHubWS\nano_dev_utils\tests\test_timers" />
|
|
72
75
|
<recent name="C:\GitHubWS\nano_dev_utils\tests\test_timer" />
|
|
73
|
-
<recent name="C:\GitHubWS\nano_dev_utils\tests" />
|
|
74
76
|
</key>
|
|
75
77
|
<key name="MoveFile.RECENT_KEYS">
|
|
76
|
-
<recent name="C:\GitHubWS\nano_dev_utils" />
|
|
77
78
|
<recent name="C:\GitHubWS\nano_dev_utils\src\nano_dev_utils" />
|
|
79
|
+
<recent name="C:\GitHubWS\nano_dev_utils" />
|
|
78
80
|
<recent name="C:\GitHubWS\nano_dev_utils\tests\test_timers" />
|
|
79
81
|
<recent name="C:\GitHubWS\nano_dev_utils\tests" />
|
|
80
82
|
</key>
|
|
81
83
|
</component>
|
|
82
|
-
<component name="RunManager" selected="Python.
|
|
83
|
-
<configuration name="benchtest" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
|
84
|
-
<module name="nano_dev_utils" />
|
|
85
|
-
<option name="ENV_FILES" value="" />
|
|
86
|
-
<option name="INTERPRETER_OPTIONS" value="" />
|
|
87
|
-
<option name="PARENT_ENVS" value="true" />
|
|
88
|
-
<envs>
|
|
89
|
-
<env name="PYTHONUNBUFFERED" value="1" />
|
|
90
|
-
</envs>
|
|
91
|
-
<option name="SDK_HOME" value="" />
|
|
92
|
-
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/benchmark" />
|
|
93
|
-
<option name="IS_MODULE_SDK" value="true" />
|
|
94
|
-
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
95
|
-
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
96
|
-
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/benchmark/benchtest.py" />
|
|
97
|
-
<option name="PARAMETERS" value="" />
|
|
98
|
-
<option name="SHOW_COMMAND_LINE" value="false" />
|
|
99
|
-
<option name="EMULATE_TERMINAL" value="false" />
|
|
100
|
-
<option name="MODULE_MODE" value="false" />
|
|
101
|
-
<option name="REDIRECT_INPUT" value="false" />
|
|
102
|
-
<option name="INPUT_FILE" value="" />
|
|
103
|
-
<method v="2" />
|
|
104
|
-
</configuration>
|
|
84
|
+
<component name="RunManager" selected="Python.benchtest_bkp">
|
|
105
85
|
<configuration name="benchtest_bkp" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
|
106
86
|
<module name="nano_dev_utils" />
|
|
107
87
|
<option name="ENV_FILES" value="" />
|
|
@@ -179,17 +159,15 @@
|
|
|
179
159
|
<list>
|
|
180
160
|
<item itemvalue="Python.update_package" />
|
|
181
161
|
<item itemvalue="Python.benchtest_bkp" />
|
|
182
|
-
<item itemvalue="Python.benchtest" />
|
|
183
162
|
<item itemvalue="Python tests.Python tests in test_file_tree_display.py" />
|
|
184
163
|
<item itemvalue="Python tests.Python tests in tests" />
|
|
185
164
|
</list>
|
|
186
165
|
<recent_temporary>
|
|
187
166
|
<list>
|
|
188
167
|
<item itemvalue="Python.update_package" />
|
|
189
|
-
<item itemvalue="Python.benchtest_bkp" />
|
|
190
168
|
<item itemvalue="Python tests.Python tests in tests" />
|
|
169
|
+
<item itemvalue="Python.benchtest_bkp" />
|
|
191
170
|
<item itemvalue="Python tests.Python tests in test_file_tree_display.py" />
|
|
192
|
-
<item itemvalue="Python.benchtest" />
|
|
193
171
|
</list>
|
|
194
172
|
</recent_temporary>
|
|
195
173
|
</component>
|
|
@@ -209,54 +187,6 @@
|
|
|
209
187
|
<option name="presentableId" value="Default" />
|
|
210
188
|
<updated>1746126505743</updated>
|
|
211
189
|
</task>
|
|
212
|
-
<task id="LOCAL-00092" summary="typo correction">
|
|
213
|
-
<option name="closed" value="true" />
|
|
214
|
-
<created>1761919201955</created>
|
|
215
|
-
<option name="number" value="00092" />
|
|
216
|
-
<option name="presentableId" value="LOCAL-00092" />
|
|
217
|
-
<option name="project" value="LOCAL" />
|
|
218
|
-
<updated>1761919201955</updated>
|
|
219
|
-
</task>
|
|
220
|
-
<task id="LOCAL-00093" summary="+PredicateBuilder: creates predicate functions">
|
|
221
|
-
<option name="closed" value="true" />
|
|
222
|
-
<created>1762031151046</created>
|
|
223
|
-
<option name="number" value="00093" />
|
|
224
|
-
<option name="presentableId" value="LOCAL-00093" />
|
|
225
|
-
<option name="project" value="LOCAL" />
|
|
226
|
-
<updated>1762031151046</updated>
|
|
227
|
-
</task>
|
|
228
|
-
<task id="LOCAL-00094" summary="README updates IAW recends mods">
|
|
229
|
-
<option name="closed" value="true" />
|
|
230
|
-
<created>1762039318077</created>
|
|
231
|
-
<option name="number" value="00094" />
|
|
232
|
-
<option name="presentableId" value="LOCAL-00094" />
|
|
233
|
-
<option name="project" value="LOCAL" />
|
|
234
|
-
<updated>1762039318077</updated>
|
|
235
|
-
</task>
|
|
236
|
-
<task id="LOCAL-00095" summary="bumped to v1.4.0">
|
|
237
|
-
<option name="closed" value="true" />
|
|
238
|
-
<created>1762039348920</created>
|
|
239
|
-
<option name="number" value="00095" />
|
|
240
|
-
<option name="presentableId" value="LOCAL-00095" />
|
|
241
|
-
<option name="project" value="LOCAL" />
|
|
242
|
-
<updated>1762039348920</updated>
|
|
243
|
-
</task>
|
|
244
|
-
<task id="LOCAL-00096" summary="+build">
|
|
245
|
-
<option name="closed" value="true" />
|
|
246
|
-
<created>1762044026530</created>
|
|
247
|
-
<option name="number" value="00096" />
|
|
248
|
-
<option name="presentableId" value="LOCAL-00096" />
|
|
249
|
-
<option name="project" value="LOCAL" />
|
|
250
|
-
<updated>1762044026530</updated>
|
|
251
|
-
</task>
|
|
252
|
-
<task id="LOCAL-00097" summary="+build">
|
|
253
|
-
<option name="closed" value="true" />
|
|
254
|
-
<created>1762044034034</created>
|
|
255
|
-
<option name="number" value="00097" />
|
|
256
|
-
<option name="presentableId" value="LOCAL-00097" />
|
|
257
|
-
<option name="project" value="LOCAL" />
|
|
258
|
-
<updated>1762044034034</updated>
|
|
259
|
-
</task>
|
|
260
190
|
<task id="LOCAL-00098" summary="Readme updates">
|
|
261
191
|
<option name="closed" value="true" />
|
|
262
192
|
<created>1762078800875</created>
|
|
@@ -601,7 +531,55 @@
|
|
|
601
531
|
<option name="project" value="LOCAL" />
|
|
602
532
|
<updated>1762674409302</updated>
|
|
603
533
|
</task>
|
|
604
|
-
<
|
|
534
|
+
<task id="LOCAL-00141" summary=".">
|
|
535
|
+
<option name="closed" value="true" />
|
|
536
|
+
<created>1762675477783</created>
|
|
537
|
+
<option name="number" value="00141" />
|
|
538
|
+
<option name="presentableId" value="LOCAL-00141" />
|
|
539
|
+
<option name="project" value="LOCAL" />
|
|
540
|
+
<updated>1762675477783</updated>
|
|
541
|
+
</task>
|
|
542
|
+
<task id="LOCAL-00142" summary="+load_cfg_file: loading configuration from a JSON file (e.g. for CLI version).">
|
|
543
|
+
<option name="closed" value="true" />
|
|
544
|
+
<created>1762704478450</created>
|
|
545
|
+
<option name="number" value="00142" />
|
|
546
|
+
<option name="presentableId" value="LOCAL-00142" />
|
|
547
|
+
<option name="project" value="LOCAL" />
|
|
548
|
+
<updated>1762704478450</updated>
|
|
549
|
+
</task>
|
|
550
|
+
<task id="LOCAL-00143" summary="ftd: +get_num_of_entries (total number of scanned files and folders)">
|
|
551
|
+
<option name="closed" value="true" />
|
|
552
|
+
<created>1762704535196</created>
|
|
553
|
+
<option name="number" value="00143" />
|
|
554
|
+
<option name="presentableId" value="LOCAL-00143" />
|
|
555
|
+
<option name="project" value="LOCAL" />
|
|
556
|
+
<updated>1762704535196</updated>
|
|
557
|
+
</task>
|
|
558
|
+
<task id="LOCAL-00144" summary="+ftd cli version">
|
|
559
|
+
<option name="closed" value="true" />
|
|
560
|
+
<created>1762704567968</created>
|
|
561
|
+
<option name="number" value="00144" />
|
|
562
|
+
<option name="presentableId" value="LOCAL-00144" />
|
|
563
|
+
<option name="project" value="LOCAL" />
|
|
564
|
+
<updated>1762704567968</updated>
|
|
565
|
+
</task>
|
|
566
|
+
<task id="LOCAL-00145" summary="pyproject.toml: dynamic version; ftd cli shortcut; hatch.version path according to __version__ v1.6.0">
|
|
567
|
+
<option name="closed" value="true" />
|
|
568
|
+
<created>1762704675201</created>
|
|
569
|
+
<option name="number" value="00145" />
|
|
570
|
+
<option name="presentableId" value="LOCAL-00145" />
|
|
571
|
+
<option name="project" value="LOCAL" />
|
|
572
|
+
<updated>1762704675201</updated>
|
|
573
|
+
</task>
|
|
574
|
+
<task id="LOCAL-00146" summary="versioning updates; load_cfg_file minor update; v1.6.1">
|
|
575
|
+
<option name="closed" value="true" />
|
|
576
|
+
<created>1762712425856</created>
|
|
577
|
+
<option name="number" value="00146" />
|
|
578
|
+
<option name="presentableId" value="LOCAL-00146" />
|
|
579
|
+
<option name="project" value="LOCAL" />
|
|
580
|
+
<updated>1762712425856</updated>
|
|
581
|
+
</task>
|
|
582
|
+
<option name="localTasksCounter" value="147" />
|
|
605
583
|
<servers />
|
|
606
584
|
</component>
|
|
607
585
|
<component name="Vcs.Log.Tabs.Properties">
|
|
@@ -615,6 +593,11 @@
|
|
|
615
593
|
<option value="origin/master" />
|
|
616
594
|
</option>
|
|
617
595
|
</RecentGroup>
|
|
596
|
+
<RecentGroup>
|
|
597
|
+
<option name="FILTER_VALUES">
|
|
598
|
+
<option value="FI-CLI" />
|
|
599
|
+
</option>
|
|
600
|
+
</RecentGroup>
|
|
618
601
|
<RecentGroup>
|
|
619
602
|
<option name="FILTER_VALUES">
|
|
620
603
|
<option value="origin/YD_Benchmarks" />
|
|
@@ -653,12 +636,6 @@
|
|
|
653
636
|
</option>
|
|
654
637
|
</component>
|
|
655
638
|
<component name="VcsManagerConfiguration">
|
|
656
|
-
<MESSAGE value="FTD unit tests refactor, completing coverage for file_tree_display method" />
|
|
657
|
-
<MESSAGE value="tiny reformatting and renaming" />
|
|
658
|
-
<MESSAGE value="+improved error handling for win_tree_wrapper +benchtest code, comparing my FTD module to MS-Windows Tree (focusing on running time) +updating bench results (FTD is very stable twice as fast)" />
|
|
659
|
-
<MESSAGE value="+improved error handling for win_tree_wrapper +benchtest code, comparing my FTD module to MS-Windows Tree (focusing on running time)" />
|
|
660
|
-
<MESSAGE value="minor update v1.4.3" />
|
|
661
|
-
<MESSAGE value="Benchtest - removed unused code; README update; minor update v1.4.4" />
|
|
662
639
|
<MESSAGE value="upgrading connector style (WIP)" />
|
|
663
640
|
<MESSAGE value="optimizing performance: -reduced alloc & overhead; -precomputed style dict and sorting outside the recursive _build_tree; -improved string ops: used StringIO for better memory efficiency -improved traversal Unit tests updates" />
|
|
664
641
|
<MESSAGE value="-removing single char old style fallback + unit test for custom styles dynamically added by user" />
|
|
@@ -678,17 +655,12 @@
|
|
|
678
655
|
<MESSAGE value="precommit update" />
|
|
679
656
|
<MESSAGE value="minor updates" />
|
|
680
657
|
<MESSAGE value="minor updates: benchtest-removed old style FTD: +skip_sorting README: FTD doc updates" />
|
|
681
|
-
<
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
<
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
<line>93</line>
|
|
689
|
-
<option name="timeStamp" value="7" />
|
|
690
|
-
</line-breakpoint>
|
|
691
|
-
</breakpoints>
|
|
692
|
-
</breakpoint-manager>
|
|
658
|
+
<MESSAGE value="." />
|
|
659
|
+
<MESSAGE value="+load_cfg_file: loading configuration from a JSON file (e.g. for CLI version)." />
|
|
660
|
+
<MESSAGE value="ftd: +get_num_of_entries (total number of scanned files and folders)" />
|
|
661
|
+
<MESSAGE value="+ftd cli version" />
|
|
662
|
+
<MESSAGE value="pyproject.toml: dynamic version; ftd cli shortcut; hatch.version path according to __version__ v1.6.0" />
|
|
663
|
+
<MESSAGE value="versioning updates; load_cfg_file minor update; v1.6.1" />
|
|
664
|
+
<option name="LAST_COMMIT_MESSAGE" value="versioning updates; load_cfg_file minor update; v1.6.1" />
|
|
693
665
|
</component>
|
|
694
666
|
</project>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nano_dev_utils
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.2
|
|
4
4
|
Summary: A collection of small Python utilities for developers.
|
|
5
5
|
Project-URL: Homepage, https://github.com/yaronday/nano_utils
|
|
6
6
|
Project-URL: Issues, https://github.com/yaronday/nano_utils/issues
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import logging
|
|
2
3
|
|
|
3
4
|
from pathlib import Path
|
|
@@ -15,6 +16,8 @@ logging.basicConfig(
|
|
|
15
16
|
)
|
|
16
17
|
|
|
17
18
|
ITER = 1
|
|
19
|
+
ONE_MB = 1_048_576
|
|
20
|
+
|
|
18
21
|
|
|
19
22
|
root = r'c:/yd'
|
|
20
23
|
# root = r"c:/HugeFolder"
|
|
@@ -28,6 +31,7 @@ timer.update({'precision': 3})
|
|
|
28
31
|
|
|
29
32
|
@timer.timeit(iterations=ITER, timeout=5, per_iteration=True)
|
|
30
33
|
def ftd_run():
|
|
34
|
+
|
|
31
35
|
# filename = 'nano_filetree_.txt'
|
|
32
36
|
filename = 'ftd_ws_.txt'
|
|
33
37
|
filepath = str(Path(target_path, filename))
|
|
@@ -37,27 +41,51 @@ def ftd_run():
|
|
|
37
41
|
filepath=filepath,
|
|
38
42
|
indent=2,
|
|
39
43
|
files_first=True, # default for 'Tree /F'
|
|
40
|
-
# sort_key_name='natural'
|
|
41
|
-
skip_sorting=True,
|
|
42
44
|
)
|
|
43
|
-
|
|
44
|
-
# ftd.style = 'plus2'
|
|
45
|
-
# ftd.printout = True # ensure it works both with file saving - done
|
|
45
|
+
|
|
46
46
|
return ftd.file_tree_display()
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
@timer.timeit(iterations=ITER, timeout=10, per_iteration=True)
|
|
50
50
|
def win_tree_cmd():
|
|
51
|
-
# filename = 'wintree_w_files.txt'
|
|
52
51
|
filename = 'wintree_ws.txt'
|
|
53
52
|
filepath = str(Path(target_path, filename))
|
|
54
53
|
tree_wrapper(root_path=root, show_files=True, save2file=True, filepath=filepath)
|
|
55
54
|
|
|
56
55
|
|
|
57
56
|
def run():
|
|
57
|
+
# timer.printout = True
|
|
58
|
+
# print_stats(root_path=Path(root))
|
|
58
59
|
ftd_run()
|
|
59
60
|
# win_tree_cmd()
|
|
60
61
|
|
|
61
62
|
|
|
63
|
+
@timer.timeit()
|
|
64
|
+
def print_stats(root_path: Path) -> None:
|
|
65
|
+
"""Compute and print directory statistics."""
|
|
66
|
+
file_count = 0
|
|
67
|
+
dir_count = 0
|
|
68
|
+
total_size = 0
|
|
69
|
+
max_depth = 0
|
|
70
|
+
|
|
71
|
+
for dirpath, dirs, files in os.walk(root_path):
|
|
72
|
+
dir_count += len(dirs)
|
|
73
|
+
file_count += len(files)
|
|
74
|
+
dpath = Path(dirpath)
|
|
75
|
+
for f in files:
|
|
76
|
+
try:
|
|
77
|
+
total_size += (dpath / f).stat().st_size
|
|
78
|
+
except OSError:
|
|
79
|
+
continue
|
|
80
|
+
rel_depth = len(dpath.relative_to(root_path).parts)
|
|
81
|
+
max_depth = max(max_depth, rel_depth)
|
|
82
|
+
|
|
83
|
+
print(f"\nStats for '{root_path}':")
|
|
84
|
+
print(f" Folders: {dir_count}")
|
|
85
|
+
print(f" Files: {file_count}")
|
|
86
|
+
print(f" Max Depth: {max_depth}")
|
|
87
|
+
print(f" Total Size: {total_size / ONE_MB:.2f} MB\n\n")
|
|
88
|
+
|
|
89
|
+
|
|
62
90
|
if __name__ == '__main__':
|
|
63
91
|
run()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nano_dev_utils"
|
|
3
|
-
|
|
3
|
+
dynamic = ["version"]
|
|
4
4
|
authors = [
|
|
5
5
|
{ name="Yaron Dayan", email="yaronday77@gmail.com" },
|
|
6
6
|
]
|
|
@@ -21,6 +21,9 @@ Homepage = "https://github.com/yaronday/nano_utils"
|
|
|
21
21
|
Issues = "https://github.com/yaronday/nano_utils/issues"
|
|
22
22
|
license = "https://github.com/yaronday/nano_dev_utils/blob/master/LICENSE"
|
|
23
23
|
|
|
24
|
+
[project.scripts]
|
|
25
|
+
ftd = "nano_dev_utils.__main__:main"
|
|
26
|
+
|
|
24
27
|
[project.files]
|
|
25
28
|
license = { path = "LICENSE" }
|
|
26
29
|
|
|
@@ -35,3 +38,5 @@ test = [
|
|
|
35
38
|
requires = ["hatchling >= 1.26"]
|
|
36
39
|
build-backend = "hatchling.build"
|
|
37
40
|
|
|
41
|
+
[tool.hatch.version]
|
|
42
|
+
path = "src/nano_dev_utils/__version__.py"
|
|
@@ -7,8 +7,17 @@ from importlib.metadata import version
|
|
|
7
7
|
from .dynamic_importer import Importer
|
|
8
8
|
from .timers import Timer
|
|
9
9
|
from .release_ports import PortsRelease, PROXY_SERVER, INSPECTOR_CLIENT
|
|
10
|
-
from .common import
|
|
11
|
-
|
|
10
|
+
from .common import (
|
|
11
|
+
update,
|
|
12
|
+
encode_dict,
|
|
13
|
+
str2file,
|
|
14
|
+
PredicateBuilder,
|
|
15
|
+
FilterSet,
|
|
16
|
+
load_cfg_file,
|
|
17
|
+
)
|
|
18
|
+
from .file_tree_display import FileTreeDisplay
|
|
19
|
+
|
|
20
|
+
from ._constants import PKG_NAME
|
|
12
21
|
|
|
13
22
|
timer = Timer()
|
|
14
23
|
ports_release = PortsRelease()
|
|
@@ -16,7 +25,7 @@ importer = Importer()
|
|
|
16
25
|
filetree_display = FileTreeDisplay(root_dir=str(Path.cwd()))
|
|
17
26
|
predicate_builder = PredicateBuilder
|
|
18
27
|
|
|
19
|
-
__version__ = version(
|
|
28
|
+
__version__ = version(PKG_NAME)
|
|
20
29
|
|
|
21
30
|
__all__ = [
|
|
22
31
|
'Importer',
|
|
@@ -34,5 +43,6 @@ __all__ = [
|
|
|
34
43
|
'ports_release',
|
|
35
44
|
'importer',
|
|
36
45
|
'filetree_display',
|
|
37
|
-
'
|
|
46
|
+
'FileTreeDisplay',
|
|
47
|
+
'load_cfg_file',
|
|
38
48
|
]
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""CLI interface for FileTreeDisplay"""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
from .file_tree_display import FileTreeDisplay
|
|
11
|
+
from .common import load_cfg_file
|
|
12
|
+
from ._constants import DEFAULT_SFX
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def parse() -> argparse.Namespace:
|
|
16
|
+
parser = argparse.ArgumentParser(
|
|
17
|
+
description='Display or export a formatted file tree of a directory.',
|
|
18
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
parser.add_argument('--cfg', type=str, help='Path to JSON config file.')
|
|
22
|
+
parser.add_argument('--root-dir', '-r', type=str, help='Root directory to display.')
|
|
23
|
+
parser.add_argument('--filepath', '-o', type=str, help='Output file path.')
|
|
24
|
+
parser.add_argument(
|
|
25
|
+
'--ignore-dirs', nargs='*', default=None, help='Directories to ignore.'
|
|
26
|
+
)
|
|
27
|
+
parser.add_argument(
|
|
28
|
+
'--ignore-files', nargs='*', default=None, help='Files to ignore.'
|
|
29
|
+
)
|
|
30
|
+
parser.add_argument(
|
|
31
|
+
'--include-dirs', nargs='*', default=None, help='Directories to include.'
|
|
32
|
+
)
|
|
33
|
+
parser.add_argument(
|
|
34
|
+
'--include-files', nargs='*', default=None, help='Files to include.'
|
|
35
|
+
)
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
'--style',
|
|
38
|
+
'-s',
|
|
39
|
+
choices=['classic', 'dash', 'arrow', 'plus'],
|
|
40
|
+
default='classic',
|
|
41
|
+
help='Tree connector style.',
|
|
42
|
+
)
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
'--indent', '-i', type=int, default=2, help='Indent width per level.'
|
|
45
|
+
)
|
|
46
|
+
parser.add_argument(
|
|
47
|
+
'--files-first',
|
|
48
|
+
'-f',
|
|
49
|
+
action='store_true',
|
|
50
|
+
default=False,
|
|
51
|
+
help='List files before directories.',
|
|
52
|
+
)
|
|
53
|
+
parser.add_argument(
|
|
54
|
+
'--skip-sorting', action='store_true', default=False, help='Disable sorting.'
|
|
55
|
+
)
|
|
56
|
+
parser.add_argument(
|
|
57
|
+
'--sort-key',
|
|
58
|
+
choices=['natural', 'lex', 'custom'],
|
|
59
|
+
default='natural',
|
|
60
|
+
help='Sorting mode.',
|
|
61
|
+
)
|
|
62
|
+
parser.add_argument(
|
|
63
|
+
'--reverse', action='store_true', default=False, help='Reverse sort order.'
|
|
64
|
+
)
|
|
65
|
+
parser.add_argument(
|
|
66
|
+
'--no-save', action='store_true', default=False, help='Do not save to file.'
|
|
67
|
+
)
|
|
68
|
+
parser.add_argument(
|
|
69
|
+
'--printout',
|
|
70
|
+
'-p',
|
|
71
|
+
action='store_true',
|
|
72
|
+
default=False,
|
|
73
|
+
help='Print tree to stdout.',
|
|
74
|
+
)
|
|
75
|
+
parser.add_argument(
|
|
76
|
+
'--version', '-v', action='version', version=f'{FileTreeDisplay.get_version()}'
|
|
77
|
+
)
|
|
78
|
+
return parser.parse_args()
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def merge_config(
|
|
82
|
+
cli_args: argparse.Namespace, cfg_dict: dict[str, Any]
|
|
83
|
+
) -> dict[str, Any]:
|
|
84
|
+
"""Merge CLI args and config file into a unified options dict."""
|
|
85
|
+
merged = {**cfg_dict}
|
|
86
|
+
for k, v in vars(cli_args).items():
|
|
87
|
+
if v is not None and k != 'cfg':
|
|
88
|
+
merged[k] = v
|
|
89
|
+
return merged
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def main() -> None:
|
|
93
|
+
args = parse()
|
|
94
|
+
cfg_dict = load_cfg_file(args.cfg)
|
|
95
|
+
opts = merge_config(args, cfg_dict)
|
|
96
|
+
|
|
97
|
+
root_dir = Path(opts.get('root_dir') or Path.cwd())
|
|
98
|
+
if not root_dir.exists():
|
|
99
|
+
sys.exit(f"Error: root directory '{root_dir}' does not exist.")
|
|
100
|
+
|
|
101
|
+
filepath = opts.get('filepath')
|
|
102
|
+
if not filepath and not opts.get('no-save'):
|
|
103
|
+
filepath = str(root_dir.with_name(f'{root_dir.name}{DEFAULT_SFX}'))
|
|
104
|
+
|
|
105
|
+
ftd = FileTreeDisplay(
|
|
106
|
+
root_dir=str(root_dir),
|
|
107
|
+
filepath=filepath,
|
|
108
|
+
ignore_dirs=opts.get('ignore_dirs') or [],
|
|
109
|
+
ignore_files=opts.get('ignore_files') or [],
|
|
110
|
+
include_dirs=opts.get('include_dirs') or [],
|
|
111
|
+
include_files=opts.get('include_files') or [],
|
|
112
|
+
style=opts.get('style', 'classic'),
|
|
113
|
+
indent=int(opts.get('indent', 2)),
|
|
114
|
+
files_first=bool(opts.get('files_first', False)),
|
|
115
|
+
skip_sorting=bool(opts.get('skip_sorting', False)),
|
|
116
|
+
sort_key_name=opts.get('sort_key', 'natural'),
|
|
117
|
+
reverse=bool(opts.get('reverse', False)),
|
|
118
|
+
save2file=not opts.get('no_save', False),
|
|
119
|
+
printout=opts.get('printout', False),
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
try:
|
|
123
|
+
ftd.file_tree_display()
|
|
124
|
+
except Exception as e:
|
|
125
|
+
sys.exit(f'Error: {e}')
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if __name__ == '__main__':
|
|
129
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.6.2'
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import fnmatch
|
|
2
2
|
import re
|
|
3
|
+
import sys
|
|
4
|
+
import json
|
|
3
5
|
|
|
4
6
|
from pathlib import Path
|
|
5
|
-
from typing import AnyStr
|
|
7
|
+
from typing import AnyStr, Any
|
|
6
8
|
|
|
7
9
|
from collections.abc import Callable
|
|
8
10
|
from functools import partial
|
|
@@ -179,3 +181,20 @@ class PredicateBuilder:
|
|
|
179
181
|
if name in allow_lits or self._match_patts(name, allow_patts):
|
|
180
182
|
return True
|
|
181
183
|
return False
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def load_cfg_file(path: str | None = None) -> dict[str, Any]:
|
|
187
|
+
"""Load configuration from JSON file."""
|
|
188
|
+
if not path:
|
|
189
|
+
return {}
|
|
190
|
+
cfg_path = Path(path)
|
|
191
|
+
if not cfg_path.exists():
|
|
192
|
+
sys.exit(f"Error: config file '{cfg_path}' not found.")
|
|
193
|
+
try:
|
|
194
|
+
if cfg_path.suffix == '.json':
|
|
195
|
+
with open(cfg_path, 'r', encoding='utf-8') as f:
|
|
196
|
+
return json.load(f)
|
|
197
|
+
else:
|
|
198
|
+
sys.exit('Error: config file must .json')
|
|
199
|
+
except Exception as e:
|
|
200
|
+
sys.exit(f'Error reading config file: {e}')
|