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.
Files changed (23) hide show
  1. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/PKG-INFO +1 -1
  2. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/pyproject.toml +1 -1
  3. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/_module_info.py +1 -1
  4. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/dir.py +11 -5
  5. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/utils.py +2 -1
  6. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/README.md +0 -0
  7. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/__init__.py +0 -0
  8. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/__main__.py +0 -0
  9. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/advanced.py +0 -0
  10. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/cfg.py +0 -0
  11. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/core.py +0 -0
  12. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/dict.py +0 -0
  13. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/file.py +0 -0
  14. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/json.py +0 -0
  15. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/list.py +0 -0
  16. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/path.py +0 -0
  17. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/proc.py +0 -0
  18. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/regex.py +0 -0
  19. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/special_chars.py +0 -0
  20. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/str.py +0 -0
  21. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/term.py +0 -0
  22. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/types.py +0 -0
  23. {mainshortcuts2-2.2.3 → mainshortcuts2-2.2.4}/src/MainShortcuts2/win.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MainShortcuts2
3
- Version: 2.2.3
3
+ Version: 2.2.4
4
4
  Summary: Сокращение и улучшение функций
5
5
  Home-page: https://github.com/MainPlay-TG/MainShortcuts2.py
6
6
  Author: MainPlay TG
@@ -1,5 +1,5 @@
1
1
  [tool.poetry]
2
- version = "2.2.3"
2
+ version = "2.2.4"
3
3
  name = "MainShortcuts2"
4
4
  description = "Сокращение и улучшение функций"
5
5
  authors = [ "MainPlay TG <xbox.roman6666666666@gmail.com>",]
@@ -1,2 +1,2 @@
1
1
  name = "MainShortcuts2"
2
- version = "2.2.3"
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
- kw["exts"] = None if exts is None else builtins.list(exts)
54
+ path = _check(path)
55
+ r = []
56
56
  kw["func"] = func
57
57
  kw["links"] = links
58
58
  kw["type"] = type
59
- for i in os.listdir(_check(path)):
60
- i = Path(_check(path) + "/" + i)
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.lockfile, flags)
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