cooptools 1.82__tar.gz → 1.83__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.
- {cooptools-1.82 → cooptools-1.83}/PKG-INFO +1 -1
- {cooptools-1.82 → cooptools-1.83}/cooptools/os_manip.py +14 -7
- {cooptools-1.82 → cooptools-1.83}/cooptools.egg-info/PKG-INFO +1 -1
- {cooptools-1.82 → cooptools-1.83}/setup.py +1 -1
- {cooptools-1.82 → cooptools-1.83}/tests/test_os_manip.py +36 -0
- {cooptools-1.82 → cooptools-1.83}/MANIFEST.in +0 -0
- {cooptools-1.82 → cooptools-1.83}/README.md +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/anchor.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/asyncable.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/cli/CliAtomicUserInteraction.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/cli/CliMenu.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/cli/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/cli/fileContentReturn.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/cnxn_info.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/colors.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/commandDesignPattern/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/commandDesignPattern/commandController.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/commandDesignPattern/commandProtocol.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/commandDesignPattern/exceptions.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/common.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/config.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/coopDataclass.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/coopEnum.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/coopthreading.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/currency.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataRefresher/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataRefresher/dataHub.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataRefresher/dataRefresher.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataStore/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataStore/dataProcessor.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataStore/dataStoreProtocol.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataStore/dbConnectionURI.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dataStore/inMemoryDataStore.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/date_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/decay.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/decor.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/dictPolicies.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/exceptions.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/expertise/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/expertise/expertiseArgs.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/expertise/expertiseSchedules.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/expertise/expertise_state.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/dicounted_cashflow_analysis.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/fund_projection.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/fund_projection_renderer.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/futureValueProjector.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/growth_projections.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/reports.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/finance/utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/circle_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/common.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/curve_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/curves.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/line_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/polygon_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/rect_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/triangle_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/geometry_utils/vector_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/astar_results_viewer.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/draw.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/flow_field.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/graph.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/graph_dcs.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/graph_definitions.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/graphs/utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/actionItemTracker/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/actionItemTracker/ai_tracker.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/actionItemTracker/dcs.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/discreteEventSimulator/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/discreteEventSimulator/discreteEventSimulator.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/jsonIO.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/metrics.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/triggerActionSystem/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/triggerActionSystem/signal.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/ideas/triggerActionSystem/trigger.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/loggingHelpers.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/marchingSquares.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/materialHandling/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/materialHandling/cli.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/materialHandling/dcs.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/materialHandling/selectionCriteria.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/matrixManipulation.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pandasHelpers.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/catmullRomFollower.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/demo/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/demo/server.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/kinematicGoalSeeker.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/motion_profile_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/orbit_fuzzer.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/path_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/straightLineFollower.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/trajectory_provider.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/waypoint.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/pathing/waypointFollower.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/persistence/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/persistence/enum_state.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/persistence/stateful.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/physics/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/physics/kinematic.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/physics/kinematic_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/physics/movement.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/physics/trajectory.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/plotting.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/printing.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/protocols.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/qualifiers/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/qualifiers/cli.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/qualifiers/qualifier.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/randoms.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/register.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/reservation/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/reservation/dcs.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/reservation/enums.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/reservation/reservationmanager.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/retry.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/grids/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/grids/gridState.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/grids/grid_base.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/grids/hexGrid.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/grids/rectGrid.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/hex_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/sect_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/sectorTree/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/sectors/sectorTree/sectorTree.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/spatial/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/spatial/colliders.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/spatial/index.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/spatial/stores.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/statistics/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/statistics/activityReport.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/statistics/controlChart/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/statistics/controlChart/controlChart.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/statistics/controlChart/plotting.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/statistics/oee/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/statistics/oee/oeeHub.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/taskProcessing/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/taskProcessing/dcs.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/taskProcessing/taskProcessor.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/timeTracker/__init__.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/timeTracker/decay.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/timeTracker/timeTracker.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/timeWindow.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/toggles.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/transform.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/trends.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/typeProviders.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/typevalidation.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools/version.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools.egg-info/SOURCES.txt +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools.egg-info/dependency_links.txt +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools.egg-info/not-zip-safe +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools.egg-info/requires.txt +0 -0
- {cooptools-1.82 → cooptools-1.83}/cooptools.egg-info/top_level.txt +0 -0
- {cooptools-1.82 → cooptools-1.83}/requirements.txt +0 -0
- {cooptools-1.82 → cooptools-1.83}/setup.cfg +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_CliAtomicUserInteraction.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_asyncable.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_catmullRomFollower.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_cdp_bugs.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_commandDesignPattern.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_common.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_config.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_coopEnum.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_currency.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_curves.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_date_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_expertise_state.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_flow_field.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_flow_field_perf.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_fund_projection.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_graph_node_classification.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_kinematicGoalSeeker.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_kinematic_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_pandas.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_path_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_persistence.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_polygon_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_printing.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_qualifiers.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_sectors.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_sectors_hex.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_sectors_sectorTree.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_spatial_index.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_statistics.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_straightLineFollower.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_target_seek.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_tasks.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_toggles.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_trajectory.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_trends.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_typevalidation.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_vector_utils.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_version.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/test_waypointFollower.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/tests_graph.py +0 -0
- {cooptools-1.82 → cooptools-1.83}/tests/tests_gridsystem.py +0 -0
|
@@ -124,7 +124,7 @@ def rename_files(filepaths: List[StringProvider],
|
|
|
124
124
|
if remove_spaces:
|
|
125
125
|
new = new.replace(' ', '')
|
|
126
126
|
|
|
127
|
-
os.rename(src=src, dst=
|
|
127
|
+
os.rename(src=src, dst=os.path.join(path, new))
|
|
128
128
|
|
|
129
129
|
def check_and_make_new_proj_localapp(app_root: StringProvider, proj_name: StringProvider):
|
|
130
130
|
""" Verifies that the app_root exists at LOCALAPPDATA and then verifies that a subfolder exists at that directory
|
|
@@ -141,7 +141,7 @@ def root_and_name(root: StringProvider, name: StringProvider):
|
|
|
141
141
|
|
|
142
142
|
root = resolve_string_provider(root)
|
|
143
143
|
name = resolve_string_provider(name)
|
|
144
|
-
return
|
|
144
|
+
return os.path.join(root, name)
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
def check_and_make_proj_path_dir(root, proj_name):
|
|
@@ -153,11 +153,18 @@ def check_and_make_proj_path_dir(root, proj_name):
|
|
|
153
153
|
return proj_dir
|
|
154
154
|
|
|
155
155
|
|
|
156
|
+
def local_app_data() -> str:
|
|
157
|
+
""" The per-user application data directory: LOCALAPPDATA on Windows; where that isn't set (Linux,
|
|
158
|
+
macOS), XDG_DATA_HOME, else ~/.local/share"""
|
|
159
|
+
return (os.getenv(LOCALAPP_ROOT)
|
|
160
|
+
or os.getenv("XDG_DATA_HOME")
|
|
161
|
+
or os.path.join(os.path.expanduser("~"), ".local", "share"))
|
|
162
|
+
|
|
163
|
+
|
|
156
164
|
def localapp_root(app_name: StringProvider):
|
|
157
165
|
""" Returns the string of the directory that would be in the LOCALAPPDATA for the given app name"""
|
|
158
166
|
app_name = resolve_string_provider(app_name)
|
|
159
|
-
|
|
160
|
-
return f"{local_app_data}\\{app_name}"
|
|
167
|
+
return os.path.join(local_app_data(), app_name)
|
|
161
168
|
|
|
162
169
|
|
|
163
170
|
def localapp_root_exists(app_name: StringProvider):
|
|
@@ -238,8 +245,8 @@ def read_file(file_path: StringProvider, as_lines: bool=False):
|
|
|
238
245
|
|
|
239
246
|
def filepath_at_check_and_make_dir(dir: StringProvider, file_name: StringProvider, file_type: FileType = None):
|
|
240
247
|
file_name = resolve_string_provider(file_name)
|
|
241
|
-
check_and_make_dirs(dir)
|
|
242
|
-
file_path =
|
|
248
|
+
dir = check_and_make_dirs(dir)
|
|
249
|
+
file_path = os.path.join(dir, file_name)
|
|
243
250
|
return clean_file_type(file_path, file_type)
|
|
244
251
|
|
|
245
252
|
|
|
@@ -340,7 +347,7 @@ def load_application_json(app_root: StringProvider, filename: StringProvider):
|
|
|
340
347
|
def load_project_json(app_root: StringProvider, project: StringProvider, filename: StringProvider):
|
|
341
348
|
proj_dir = check_and_make_new_proj_localapp(app_root, project)
|
|
342
349
|
filename = resolve_string_provider(filename)
|
|
343
|
-
file_path = f"{
|
|
350
|
+
file_path = os.path.join(proj_dir, f"{filename}.json")
|
|
344
351
|
return try_load_json_data_to_dict(file_path)
|
|
345
352
|
|
|
346
353
|
def get_xml_root_from_file(file_path_provider: StringProvider) -> ET.Element:
|
|
@@ -2,9 +2,45 @@ import unittest
|
|
|
2
2
|
import os
|
|
3
3
|
import tempfile
|
|
4
4
|
import json
|
|
5
|
+
from unittest.mock import patch
|
|
5
6
|
from cooptools import os_manip
|
|
6
7
|
|
|
7
8
|
|
|
9
|
+
class Test_LocalAppPaths(unittest.TestCase):
|
|
10
|
+
|
|
11
|
+
def test__localapp_root__is_the_app_folder_inside_LOCALAPPDATA(self):
|
|
12
|
+
with tempfile.TemporaryDirectory() as tmpdir, patch.dict(os.environ, {"LOCALAPPDATA": tmpdir}):
|
|
13
|
+
self.assertEqual(os.path.join(tmpdir, "myapp"), os_manip.localapp_root("myapp"))
|
|
14
|
+
|
|
15
|
+
def test__localapp_root__without_LOCALAPPDATA_uses_XDG_DATA_HOME(self):
|
|
16
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
17
|
+
env = {k: v for k, v in os.environ.items() if k != "LOCALAPPDATA"}
|
|
18
|
+
env["XDG_DATA_HOME"] = tmpdir
|
|
19
|
+
with patch.dict(os.environ, env, clear=True):
|
|
20
|
+
self.assertEqual(os.path.join(tmpdir, "myapp"), os_manip.localapp_root("myapp"))
|
|
21
|
+
|
|
22
|
+
def test__localapp_root__without_either_uses_local_share_in_home(self):
|
|
23
|
+
env = {k: v for k, v in os.environ.items() if k not in ("LOCALAPPDATA", "XDG_DATA_HOME")}
|
|
24
|
+
with patch.dict(os.environ, env, clear=True):
|
|
25
|
+
expected = os.path.join(os.path.expanduser("~"), ".local", "share", "myapp")
|
|
26
|
+
self.assertEqual(expected, os_manip.localapp_root("myapp"))
|
|
27
|
+
|
|
28
|
+
def test__a_file_made_in_a_project_folder_is_a_real_file_inside_it(self):
|
|
29
|
+
with tempfile.TemporaryDirectory() as tmpdir, patch.dict(os.environ, {"LOCALAPPDATA": tmpdir}):
|
|
30
|
+
path = os_manip.filepath_at_dir("myapp", "settings", proj_name="proj", file_type=os_manip.FileType.INI)
|
|
31
|
+
|
|
32
|
+
self.assertEqual(os.path.join(tmpdir, "myapp", "proj", "settings.ini"), path)
|
|
33
|
+
self.assertTrue(os.path.isfile(path))
|
|
34
|
+
self.assertEqual(["settings.ini"], os.listdir(os.path.join(tmpdir, "myapp", "proj")))
|
|
35
|
+
|
|
36
|
+
def test__a_project_json_round_trips_through_its_folder(self):
|
|
37
|
+
with tempfile.TemporaryDirectory() as tmpdir, patch.dict(os.environ, {"LOCALAPPDATA": tmpdir}):
|
|
38
|
+
os_manip.save_project_json({"a": 1}, "myapp", "proj", "data")
|
|
39
|
+
|
|
40
|
+
self.assertTrue(os.path.isfile(os.path.join(tmpdir, "myapp", "proj", "data.json")))
|
|
41
|
+
self.assertEqual({"a": 1}, os_manip.load_project_json("myapp", "proj", "data"))
|
|
42
|
+
|
|
43
|
+
|
|
8
44
|
class Test_FilesAtDir(unittest.TestCase):
|
|
9
45
|
|
|
10
46
|
def test__files_at_dir__returns_files_in_directory(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cooptools-1.82 → cooptools-1.83}/cooptools/ideas/discreteEventSimulator/discreteEventSimulator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|