diff --git a/.gitignore b/.gitignore index fbfa7d1..fe3e714 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ **/*.pyc +.vscode +.venv +poetry.lock +pyproject.toml +.pytest_cache +__pycache__/ \ No newline at end of file diff --git a/example_code/item_01.py b/example_code/item_01__01.py similarity index 100% rename from example_code/item_01.py rename to example_code/item_01__01.py diff --git a/example_code/item_03.py b/example_code/item_03__03.py similarity index 100% rename from example_code/item_03.py rename to example_code/item_03__03.py diff --git a/example_code/item_05.py b/example_code/item_05__04.py similarity index 100% rename from example_code/item_05.py rename to example_code/item_05__04.py diff --git a/example_code/item_07.py b/example_code/item_07__10.py similarity index 100% rename from example_code/item_07.py rename to example_code/item_07__10.py diff --git a/example_code/item_08.py b/example_code/item_08__11.py similarity index 100% rename from example_code/item_08.py rename to example_code/item_08__11.py diff --git a/example_code/item_09.py b/example_code/item_09__12.py similarity index 100% rename from example_code/item_09.py rename to example_code/item_09__12.py diff --git a/example_code/item_11.py b/example_code/item_11__05.py similarity index 100% rename from example_code/item_11.py rename to example_code/item_11__05.py diff --git a/example_code/item_12.py b/example_code/item_12__06.py similarity index 100% rename from example_code/item_12.py rename to example_code/item_12__06.py diff --git a/example_code/item_20.py b/example_code/item_20__14.py similarity index 100% rename from example_code/item_20.py rename to example_code/item_20__14.py diff --git a/example_code/item_21.py b/example_code/item_21__15.py similarity index 100% rename from example_code/item_21.py rename to example_code/item_21__15.py diff --git a/example_code/item_22.py b/example_code/item_22__18.py similarity index 100% rename from example_code/item_22.py rename to example_code/item_22__18.py diff --git a/example_code/item_23.py b/example_code/item_23__19.py similarity index 100% rename from example_code/item_23.py rename to example_code/item_23__19.py diff --git a/example_code/item_24.py b/example_code/item_24__20.py similarity index 100% rename from example_code/item_24.py rename to example_code/item_24__20.py diff --git a/example_code/item_25.py b/example_code/item_25__21.py similarity index 100% rename from example_code/item_25.py rename to example_code/item_25__21.py diff --git a/example_code/item_26.py b/example_code/item_26__43.py similarity index 100% rename from example_code/item_26.py rename to example_code/item_26__43.py diff --git a/example_code/item_28.py b/example_code/item_28__08.py similarity index 100% rename from example_code/item_28.py rename to example_code/item_28__08.py diff --git a/example_code/item_30.py b/example_code/item_30__16.py similarity index 100% rename from example_code/item_30.py rename to example_code/item_30__16.py diff --git a/example_code/item_31.py b/example_code/item_31__17.py similarity index 100% rename from example_code/item_31.py rename to example_code/item_31__17.py diff --git a/example_code/item_32.py b/example_code/item_32__09.py similarity index 100% rename from example_code/item_32.py rename to example_code/item_32__09.py diff --git a/example_code/item_37.py b/example_code/item_37__22.py similarity index 100% rename from example_code/item_37.py rename to example_code/item_37__22.py diff --git a/example_code/item_38.py b/example_code/item_38__23.py similarity index 100% rename from example_code/item_38.py rename to example_code/item_38__23.py diff --git a/example_code/item_39.py b/example_code/item_39__24.py similarity index 100% rename from example_code/item_39.py rename to example_code/item_39__24.py diff --git a/example_code/item_40.py b/example_code/item_40__25.py similarity index 100% rename from example_code/item_40.py rename to example_code/item_40__25.py diff --git a/example_code/item_41.py b/example_code/item_41__26.py similarity index 100% rename from example_code/item_41.py rename to example_code/item_41__26.py diff --git a/example_code/item_42.py b/example_code/item_42__27.py similarity index 100% rename from example_code/item_42.py rename to example_code/item_42__27.py diff --git a/example_code/item_43.py b/example_code/item_43__28.py similarity index 100% rename from example_code/item_43.py rename to example_code/item_43__28.py diff --git a/example_code/item_44.py b/example_code/item_44__29.py similarity index 100% rename from example_code/item_44.py rename to example_code/item_44__29.py diff --git a/example_code/item_45.py b/example_code/item_45__30.py similarity index 100% rename from example_code/item_45.py rename to example_code/item_45__30.py diff --git a/example_code/item_46.py b/example_code/item_46__31.py similarity index 100% rename from example_code/item_46.py rename to example_code/item_46__31.py diff --git a/example_code/item_47.py b/example_code/item_47__32.py similarity index 100% rename from example_code/item_47.py rename to example_code/item_47__32.py diff --git a/example_code/item_48.py b/example_code/item_48__33.py similarity index 100% rename from example_code/item_48.py rename to example_code/item_48__33.py diff --git a/example_code/item_49.py b/example_code/item_49__34.py similarity index 100% rename from example_code/item_49.py rename to example_code/item_49__34.py diff --git a/example_code/item_50.py b/example_code/item_50__35.py similarity index 100% rename from example_code/item_50.py rename to example_code/item_50__35.py diff --git a/example_code/item_52.py b/example_code/item_52__36.py similarity index 100% rename from example_code/item_52.py rename to example_code/item_52__36.py diff --git a/example_code/item_53.py b/example_code/item_53__37.py similarity index 100% rename from example_code/item_53.py rename to example_code/item_53__37.py diff --git a/example_code/item_54.py b/example_code/item_54__38.py similarity index 100% rename from example_code/item_54.py rename to example_code/item_54__38.py diff --git a/example_code/item_55.py b/example_code/item_55__39.py similarity index 100% rename from example_code/item_55.py rename to example_code/item_55__39.py diff --git a/example_code/item_64/parallel/my_module.py b/example_code/item_64__41/parallel/my_module.py similarity index 100% rename from example_code/item_64/parallel/my_module.py rename to example_code/item_64__41/parallel/my_module.py diff --git a/example_code/item_64/parallel/run_parallel.py b/example_code/item_64__41/parallel/run_parallel.py similarity index 100% rename from example_code/item_64/parallel/run_parallel.py rename to example_code/item_64__41/parallel/run_parallel.py diff --git a/example_code/item_64/parallel/run_serial.py b/example_code/item_64__41/parallel/run_serial.py similarity index 100% rename from example_code/item_64/parallel/run_serial.py rename to example_code/item_64__41/parallel/run_serial.py diff --git a/example_code/item_64/parallel/run_threads.py b/example_code/item_64__41/parallel/run_threads.py similarity index 100% rename from example_code/item_64/parallel/run_threads.py rename to example_code/item_64__41/parallel/run_threads.py diff --git a/example_code/item_65.py b/example_code/item_65__13.py similarity index 100% rename from example_code/item_65.py rename to example_code/item_65__13.py diff --git a/example_code/item_66.py b/example_code/item_66__43.py similarity index 100% rename from example_code/item_66.py rename to example_code/item_66__43.py diff --git a/example_code/item_67.py b/example_code/item_67__45.py similarity index 100% rename from example_code/item_67.py rename to example_code/item_67__45.py diff --git a/example_code/item_68.py b/example_code/item_68__44.py similarity index 100% rename from example_code/item_68.py rename to example_code/item_68__44.py diff --git a/example_code/item_69.py b/example_code/item_69__47.py similarity index 100% rename from example_code/item_69.py rename to example_code/item_69__47.py diff --git a/example_code/item_70.py b/example_code/item_70__58.py similarity index 100% rename from example_code/item_70.py rename to example_code/item_70__58.py diff --git a/example_code/item_75.py b/example_code/item_75__55.py similarity index 100% rename from example_code/item_75.py rename to example_code/item_75__55.py diff --git a/example_code/item_76/testing/assert_test.py b/example_code/item_76__56/testing/assert_test.py similarity index 100% rename from example_code/item_76/testing/assert_test.py rename to example_code/item_76__56/testing/assert_test.py diff --git a/example_code/item_76/testing/data_driven_test.py b/example_code/item_76__56/testing/data_driven_test.py similarity index 100% rename from example_code/item_76/testing/data_driven_test.py rename to example_code/item_76__56/testing/data_driven_test.py diff --git a/example_code/item_76/testing/helper_test.py b/example_code/item_76__56/testing/helper_test.py similarity index 100% rename from example_code/item_76/testing/helper_test.py rename to example_code/item_76__56/testing/helper_test.py diff --git a/example_code/item_76/testing/utils.py b/example_code/item_76__56/testing/utils.py similarity index 100% rename from example_code/item_76/testing/utils.py rename to example_code/item_76__56/testing/utils.py diff --git a/example_code/item_76/testing/utils_error_test.py b/example_code/item_76__56/testing/utils_error_test.py similarity index 100% rename from example_code/item_76/testing/utils_error_test.py rename to example_code/item_76__56/testing/utils_error_test.py diff --git a/example_code/item_76/testing/utils_test.py b/example_code/item_76__56/testing/utils_test.py similarity index 100% rename from example_code/item_76/testing/utils_test.py rename to example_code/item_76__56/testing/utils_test.py diff --git a/example_code/item_81/tracemalloc/top_n.py b/example_code/item_81__59/tracemalloc/top_n.py similarity index 100% rename from example_code/item_81/tracemalloc/top_n.py rename to example_code/item_81__59/tracemalloc/top_n.py diff --git a/example_code/item_81/tracemalloc/using_gc.py b/example_code/item_81__59/tracemalloc/using_gc.py similarity index 100% rename from example_code/item_81/tracemalloc/using_gc.py rename to example_code/item_81__59/tracemalloc/using_gc.py diff --git a/example_code/item_81/tracemalloc/waste_memory.py b/example_code/item_81__59/tracemalloc/waste_memory.py similarity index 100% rename from example_code/item_81/tracemalloc/waste_memory.py rename to example_code/item_81__59/tracemalloc/waste_memory.py diff --git a/example_code/item_81/tracemalloc/with_trace.py b/example_code/item_81__59/tracemalloc/with_trace.py similarity index 100% rename from example_code/item_81/tracemalloc/with_trace.py rename to example_code/item_81__59/tracemalloc/with_trace.py diff --git a/example_code/item_84.py b/example_code/item_84__49.py similarity index 100% rename from example_code/item_84.py rename to example_code/item_84__49.py diff --git a/example_code/item_85/api_package/api_consumer.py b/example_code/item_85__50/api_package/api_consumer.py similarity index 100% rename from example_code/item_85/api_package/api_consumer.py rename to example_code/item_85__50/api_package/api_consumer.py diff --git a/example_code/item_85/api_package/main.py b/example_code/item_85__50/api_package/main.py similarity index 100% rename from example_code/item_85/api_package/main.py rename to example_code/item_85__50/api_package/main.py diff --git a/example_code/item_85/api_package/mypackage/__init__.py b/example_code/item_85__50/api_package/mypackage/__init__.py similarity index 100% rename from example_code/item_85/api_package/mypackage/__init__.py rename to example_code/item_85__50/api_package/mypackage/__init__.py diff --git a/example_code/item_85/api_package/mypackage/models.py b/example_code/item_85__50/api_package/mypackage/models.py similarity index 100% rename from example_code/item_85/api_package/mypackage/models.py rename to example_code/item_85__50/api_package/mypackage/models.py diff --git a/example_code/item_85/api_package/mypackage/utils.py b/example_code/item_85__50/api_package/mypackage/utils.py similarity index 100% rename from example_code/item_85/api_package/mypackage/utils.py rename to example_code/item_85__50/api_package/mypackage/utils.py diff --git a/example_code/item_85/namespace_package/analysis/__init__.py b/example_code/item_85__50/namespace_package/analysis/__init__.py similarity index 100% rename from example_code/item_85/namespace_package/analysis/__init__.py rename to example_code/item_85__50/namespace_package/analysis/__init__.py diff --git a/example_code/item_85/namespace_package/analysis/utils.py b/example_code/item_85__50/namespace_package/analysis/utils.py similarity index 100% rename from example_code/item_85/namespace_package/analysis/utils.py rename to example_code/item_85__50/namespace_package/analysis/utils.py diff --git a/example_code/item_85/namespace_package/frontend/__init__.py b/example_code/item_85__50/namespace_package/frontend/__init__.py similarity index 100% rename from example_code/item_85/namespace_package/frontend/__init__.py rename to example_code/item_85__50/namespace_package/frontend/__init__.py diff --git a/example_code/item_85/namespace_package/frontend/utils.py b/example_code/item_85__50/namespace_package/frontend/utils.py similarity index 100% rename from example_code/item_85/namespace_package/frontend/utils.py rename to example_code/item_85__50/namespace_package/frontend/utils.py diff --git a/example_code/item_85/namespace_package/main.py b/example_code/item_85__50/namespace_package/main.py similarity index 100% rename from example_code/item_85/namespace_package/main.py rename to example_code/item_85__50/namespace_package/main.py diff --git a/example_code/item_85/namespace_package/main2.py b/example_code/item_85__50/namespace_package/main2.py similarity index 100% rename from example_code/item_85/namespace_package/main2.py rename to example_code/item_85__50/namespace_package/main2.py diff --git a/example_code/item_85/namespace_package/main3.py b/example_code/item_85__50/namespace_package/main3.py similarity index 100% rename from example_code/item_85/namespace_package/main3.py rename to example_code/item_85__50/namespace_package/main3.py diff --git a/example_code/item_85/namespace_package/main4.py b/example_code/item_85__50/namespace_package/main4.py similarity index 100% rename from example_code/item_85/namespace_package/main4.py rename to example_code/item_85__50/namespace_package/main4.py diff --git a/example_code/item_86/module_scope/db_connection.py b/example_code/item_86__54/module_scope/db_connection.py similarity index 100% rename from example_code/item_86/module_scope/db_connection.py rename to example_code/item_86__54/module_scope/db_connection.py diff --git a/example_code/item_86/module_scope/dev_main.py b/example_code/item_86__54/module_scope/dev_main.py similarity index 100% rename from example_code/item_86/module_scope/dev_main.py rename to example_code/item_86__54/module_scope/dev_main.py diff --git a/example_code/item_86/module_scope/prod_main.py b/example_code/item_86__54/module_scope/prod_main.py similarity index 100% rename from example_code/item_86/module_scope/prod_main.py rename to example_code/item_86__54/module_scope/prod_main.py diff --git a/example_code/item_87.py b/example_code/item_87__51.py similarity index 100% rename from example_code/item_87.py rename to example_code/item_87__51.py diff --git a/example_code/item_88/recursive_import_bad/app.py b/example_code/item_88__52/recursive_import_bad/app.py similarity index 100% rename from example_code/item_88/recursive_import_bad/app.py rename to example_code/item_88__52/recursive_import_bad/app.py diff --git a/example_code/item_88/recursive_import_bad/dialog.py b/example_code/item_88__52/recursive_import_bad/dialog.py similarity index 100% rename from example_code/item_88/recursive_import_bad/dialog.py rename to example_code/item_88__52/recursive_import_bad/dialog.py diff --git a/example_code/item_88/recursive_import_bad/main.py b/example_code/item_88__52/recursive_import_bad/main.py similarity index 100% rename from example_code/item_88/recursive_import_bad/main.py rename to example_code/item_88__52/recursive_import_bad/main.py diff --git a/example_code/item_88/recursive_import_dynamic/app.py b/example_code/item_88__52/recursive_import_dynamic/app.py similarity index 100% rename from example_code/item_88/recursive_import_dynamic/app.py rename to example_code/item_88__52/recursive_import_dynamic/app.py diff --git a/example_code/item_88/recursive_import_dynamic/dialog.py b/example_code/item_88__52/recursive_import_dynamic/dialog.py similarity index 100% rename from example_code/item_88/recursive_import_dynamic/dialog.py rename to example_code/item_88__52/recursive_import_dynamic/dialog.py diff --git a/example_code/item_88/recursive_import_dynamic/main.py b/example_code/item_88__52/recursive_import_dynamic/main.py similarity index 100% rename from example_code/item_88/recursive_import_dynamic/main.py rename to example_code/item_88__52/recursive_import_dynamic/main.py diff --git a/example_code/item_88/recursive_import_nosideeffects/app.py b/example_code/item_88__52/recursive_import_nosideeffects/app.py similarity index 100% rename from example_code/item_88/recursive_import_nosideeffects/app.py rename to example_code/item_88__52/recursive_import_nosideeffects/app.py diff --git a/example_code/item_88/recursive_import_nosideeffects/dialog.py b/example_code/item_88__52/recursive_import_nosideeffects/dialog.py similarity index 100% rename from example_code/item_88/recursive_import_nosideeffects/dialog.py rename to example_code/item_88__52/recursive_import_nosideeffects/dialog.py diff --git a/example_code/item_88/recursive_import_nosideeffects/main.py b/example_code/item_88__52/recursive_import_nosideeffects/main.py similarity index 100% rename from example_code/item_88/recursive_import_nosideeffects/main.py rename to example_code/item_88__52/recursive_import_nosideeffects/main.py diff --git a/example_code/item_88/recursive_import_ordering/app.py b/example_code/item_88__52/recursive_import_ordering/app.py similarity index 100% rename from example_code/item_88/recursive_import_ordering/app.py rename to example_code/item_88__52/recursive_import_ordering/app.py diff --git a/example_code/item_88/recursive_import_ordering/dialog.py b/example_code/item_88__52/recursive_import_ordering/dialog.py similarity index 100% rename from example_code/item_88/recursive_import_ordering/dialog.py rename to example_code/item_88__52/recursive_import_ordering/dialog.py diff --git a/example_code/item_88/recursive_import_ordering/main.py b/example_code/item_88__52/recursive_import_ordering/main.py similarity index 100% rename from example_code/item_88/recursive_import_ordering/main.py rename to example_code/item_88__52/recursive_import_ordering/main.py diff --git a/tagged/tagged_items.py b/tagged/tagged_items.py new file mode 100644 index 0000000..48c85d8 --- /dev/null +++ b/tagged/tagged_items.py @@ -0,0 +1,25 @@ +from collections import namedtuple +from os import listdir +from os.path import abspath, dirname, join + + + +def get_items_given_path(path: str, name_file: str): + items = [item for item in sorted(listdir(path))] + name_file = join(dirname(abspath(__file__)), name_file) + with open(name_file, 'w') as f: + for i in items: + f.write(f'{str(i)}\n') + return items + +def path_func(): + from os.path import join, abspath + _path = join('..', 'example_code') + _path = abspath(_path) + return _path + + +if __name__ == '__main__': + name_f = 'original.txt' + p = path_func() + get_items_given_path(p, name_f) \ No newline at end of file