MainShortcuts2 2.2.3__tar.gz → 2.2.4__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.
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/PKG-INFO +1 -1
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/pyproject.toml +1 -1
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/_module_info.py +1 -1
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/dir.py +11 -5
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/utils.py +2 -1
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/README.md +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/__init__.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/__main__.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/advanced.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/cfg.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/core.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/dict.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/file.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/json.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/list.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/path.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/proc.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/regex.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/special_chars.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/str.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/term.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/types.py +0 -0
- {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/win.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
name = "MainShortcuts2"
|
|
2
|
-
version = "2.2.
|
|
2
|
+
version = "2.2.4"
|
|
@@ -34,7 +34,7 @@ def create(path: PATH_TYPES, force: bool = False, **kw):
|
|
|
34
34
|
|
|
35
35
|
def _list_filter(path: Path, *, exts: Iterable[str], func: Callable[[Path], bool], links: bool, type: str):
|
|
36
36
|
if not exts is None:
|
|
37
|
-
if not path.ext in exts:
|
|
37
|
+
if not path.ext.lower() in exts:
|
|
38
38
|
return False
|
|
39
39
|
if not func is None:
|
|
40
40
|
if not func(path):
|
|
@@ -50,14 +50,20 @@ def _list_filter(path: Path, *, exts: Iterable[str], func: Callable[[Path], bool
|
|
|
50
50
|
|
|
51
51
|
def list(path: PATH_TYPES = ".", *, exts: Iterable[str] = None, func: Callable[[Path], bool] = None, links: bool = None, type: str = None) -> list[Path]:
|
|
52
52
|
"""Список содержимого папки"""
|
|
53
|
-
r = []
|
|
54
53
|
kw = {}
|
|
55
|
-
|
|
54
|
+
path = _check(path)
|
|
55
|
+
r = []
|
|
56
56
|
kw["func"] = func
|
|
57
57
|
kw["links"] = links
|
|
58
58
|
kw["type"] = type
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
if exts is None:
|
|
60
|
+
kw["exts"] = None
|
|
61
|
+
else:
|
|
62
|
+
kw["exts"] = []
|
|
63
|
+
for i in exts:
|
|
64
|
+
kw["exts"].append((i if i.startswith(".") else "." + i).lower())
|
|
65
|
+
for i in os.listdir(path):
|
|
66
|
+
i = Path(path + "/" + i)
|
|
61
67
|
if _list_filter(i, **kw):
|
|
62
68
|
r.append(i)
|
|
63
69
|
return r
|
|
@@ -365,6 +365,7 @@ class OnlyOneInstance:
|
|
|
365
365
|
def __init__(self, name: str = "main", lock_path: str = None):
|
|
366
366
|
import tempfile
|
|
367
367
|
self.name: str = name
|
|
368
|
+
self.running = False
|
|
368
369
|
if lock_path is None:
|
|
369
370
|
lock_path = tempfile.gettempdir() + "/" + ms.MAIN_FILE.replace(":", "").replace("/", "_") + "." + name + ".lock"
|
|
370
371
|
self.lock = ms.path.Path(lock_path, use_cache=False)
|
|
@@ -375,7 +376,7 @@ class OnlyOneInstance:
|
|
|
375
376
|
try:
|
|
376
377
|
if self.lock.exists:
|
|
377
378
|
os.unlink(self.lock.path)
|
|
378
|
-
self.fd = os.open(self.
|
|
379
|
+
self.fd = os.open(self.lock.path, flags)
|
|
379
380
|
except OSError as err:
|
|
380
381
|
if err.errno == 13:
|
|
381
382
|
raise OnlyOneInstanceError()
|
|
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
|