pyhabitat 1.0.12__tar.gz → 1.0.15__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.
Potentially problematic release.
This version of pyhabitat might be problematic. Click here for more details.
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/PKG-INFO +3 -3
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/README.md +2 -2
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/pyhabitat/__init__.py +2 -2
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/pyhabitat/environment.py +12 -3
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/pyhabitat.egg-info/PKG-INFO +3 -3
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/pyproject.toml +1 -1
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/LICENSE +0 -0
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/pyhabitat.egg-info/SOURCES.txt +0 -0
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/pyhabitat.egg-info/dependency_links.txt +0 -0
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/pyhabitat.egg-info/top_level.txt +0 -0
- {pyhabitat-1.0.12 → pyhabitat-1.0.15}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyhabitat
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.15
|
|
4
4
|
Summary: A lightweight library for detecting system environment, GUI, and build properties.
|
|
5
5
|
Author-email: George Clayton Bennett <george.bennett@memphistn.gov>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -110,7 +110,7 @@ Key Question: "What could I do next?"
|
|
|
110
110
|
|
|
111
111
|
| Function | Description |
|
|
112
112
|
| :--- | :--- |
|
|
113
|
-
| `
|
|
113
|
+
| `open_text_file_for_editing()` | Smoothly opens a text file for editing (for configuration editing prompted by a CLI flag). |
|
|
114
114
|
|
|
115
115
|
</details>
|
|
116
116
|
|
|
@@ -177,7 +177,7 @@ Use this function to smoothly open a text file for editing.
|
|
|
177
177
|
Ideal use case: Edit a configuration file, if prompted by a CLI command like 'config --textedit'.
|
|
178
178
|
|
|
179
179
|
```python
|
|
180
|
-
|
|
180
|
+
open_text_file_for_editing(filepath=Path('./config.json'))
|
|
181
181
|
```
|
|
182
182
|
</details>
|
|
183
183
|
|
|
@@ -95,7 +95,7 @@ Key Question: "What could I do next?"
|
|
|
95
95
|
|
|
96
96
|
| Function | Description |
|
|
97
97
|
| :--- | :--- |
|
|
98
|
-
| `
|
|
98
|
+
| `open_text_file_for_editing()` | Smoothly opens a text file for editing (for configuration editing prompted by a CLI flag). |
|
|
99
99
|
|
|
100
100
|
</details>
|
|
101
101
|
|
|
@@ -162,7 +162,7 @@ Use this function to smoothly open a text file for editing.
|
|
|
162
162
|
Ideal use case: Edit a configuration file, if prompted by a CLI command like 'config --textedit'.
|
|
163
163
|
|
|
164
164
|
```python
|
|
165
|
-
|
|
165
|
+
open_text_file_for_editing(filepath=Path('./config.json'))
|
|
166
166
|
```
|
|
167
167
|
</details>
|
|
168
168
|
|
|
@@ -20,7 +20,7 @@ from .environment import (
|
|
|
20
20
|
is_pipx,
|
|
21
21
|
interactive_terminal_is_available,
|
|
22
22
|
web_browser_is_available,
|
|
23
|
-
|
|
23
|
+
open_text_file_for_editing,
|
|
24
24
|
)
|
|
25
25
|
|
|
26
26
|
# Optional: Set __all__ for explicit documentation and cleaner imports
|
|
@@ -44,5 +44,5 @@ __all__ = [
|
|
|
44
44
|
'is_pipx',
|
|
45
45
|
'interactive_terminal_is_available',
|
|
46
46
|
'web_browser_is_available',
|
|
47
|
-
'
|
|
47
|
+
'open_text_file_for_editing',
|
|
48
48
|
]
|
|
@@ -12,8 +12,7 @@ import shutil
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
import subprocess
|
|
14
14
|
import io
|
|
15
|
-
|
|
16
|
-
from pipeline.helpers import check_if_zip
|
|
15
|
+
import zipfile
|
|
17
16
|
|
|
18
17
|
# Global cache for tkinter and matplotlib (mpl) availability
|
|
19
18
|
_TKINTER_AVAILABILITY: bool | None = None
|
|
@@ -277,7 +276,7 @@ def is_pyz(exec_path: Path=None, debug=False) -> bool:
|
|
|
277
276
|
if not str(exec_path).endswith(".pyz"):
|
|
278
277
|
return False
|
|
279
278
|
|
|
280
|
-
if not
|
|
279
|
+
if not _check_if_zip():
|
|
281
280
|
return False
|
|
282
281
|
|
|
283
282
|
def is_windows_portable_executable(exec_path: Path = None, debug=False) -> bool:
|
|
@@ -522,3 +521,13 @@ def _get_pipx_paths():
|
|
|
522
521
|
pipx_venv_base = Path.home() / '.local' / 'share' / 'pipx' / 'venvs'
|
|
523
522
|
|
|
524
523
|
return pipx_bin_path, pipx_venv_base.resolve()
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
def _check_if_zip(file_path: str | Path) -> bool:
|
|
527
|
+
"""Checks if the file at the given path is a valid ZIP archive."""
|
|
528
|
+
try:
|
|
529
|
+
return zipfile.is_zipfile(file_path)
|
|
530
|
+
except Exception:
|
|
531
|
+
# Handle cases where the path might be invalid, or other unexpected errors
|
|
532
|
+
return False
|
|
533
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyhabitat
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.15
|
|
4
4
|
Summary: A lightweight library for detecting system environment, GUI, and build properties.
|
|
5
5
|
Author-email: George Clayton Bennett <george.bennett@memphistn.gov>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -110,7 +110,7 @@ Key Question: "What could I do next?"
|
|
|
110
110
|
|
|
111
111
|
| Function | Description |
|
|
112
112
|
| :--- | :--- |
|
|
113
|
-
| `
|
|
113
|
+
| `open_text_file_for_editing()` | Smoothly opens a text file for editing (for configuration editing prompted by a CLI flag). |
|
|
114
114
|
|
|
115
115
|
</details>
|
|
116
116
|
|
|
@@ -177,7 +177,7 @@ Use this function to smoothly open a text file for editing.
|
|
|
177
177
|
Ideal use case: Edit a configuration file, if prompted by a CLI command like 'config --textedit'.
|
|
178
178
|
|
|
179
179
|
```python
|
|
180
|
-
|
|
180
|
+
open_text_file_for_editing(filepath=Path('./config.json'))
|
|
181
181
|
```
|
|
182
182
|
</details>
|
|
183
183
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|