delayed-rm 2.9.1__tar.gz → 2.9.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: delayed_rm
3
- Version: 2.9.1
3
+ Version: 2.9.2
4
4
  Summary: Ever wish you had a few minutes to undo an rm? Now you do!
5
5
  License: GPLv3
6
6
  Project-URL: Homepage, https://github.com/zwimer/delayed_rm
@@ -3,16 +3,16 @@ from collections import defaultdict
3
3
  from tempfile import gettempdir
4
4
  from datetime import datetime
5
5
  from pathlib import Path
6
+ from os import environ
6
7
  import subprocess
7
8
  import argparse
8
9
  import tempfile
9
10
  import shutil
10
11
  import time
11
12
  import sys
12
- import os
13
13
 
14
14
 
15
- __version__ = "2.9.1"
15
+ __version__ = "2.9.2"
16
16
 
17
17
 
18
18
  #
@@ -83,9 +83,8 @@ def _prep(paths: list[Path], rf: bool) -> list[Path]:
83
83
  # Normalize paths and error checking
84
84
  try:
85
85
  paths = [i.parent.resolve(strict=True) / i.name for i in paths]
86
- # pathlib.stat does not support follow_symlinks until 3.10
87
- if len(paths) != len({os.stat(i, follow_symlinks=False).st_ino for i in paths}):
88
- raise RMError("duplicate items passed")
86
+ if len(paths) != len({i.stat(follow_symlinks=False).st_ino for i in paths}):
87
+ raise RMError("duplicate or hardlinked items passed")
89
88
  except (FileNotFoundError, RuntimeError) as e:
90
89
  raise RMError(e) from e
91
90
  for i in paths:
@@ -231,7 +230,7 @@ def delayed_rm_raw(delay: int, log: bool, r: bool, f: bool, paths: list[Path]) -
231
230
 
232
231
 
233
232
  def main(prog: str, *args: str) -> bool:
234
- base: str = os.path.basename(prog)
233
+ base: str = Path(prog).name
235
234
  parser = argparse.ArgumentParser(prog=base)
236
235
  parser.add_argument("--version", action="version", version=f"{base} {__version__}")
237
236
  parser.add_argument("--delay", "--ttl", type=int, default=900, help="The deletion delay in seconds")
@@ -259,12 +258,12 @@ def cli() -> None:
259
258
  def _secret_cli():
260
259
  """
261
260
  This CLI is invoked on import and not will do nothing by default
262
- This CLI will only active if argv was intentionally configured to do so
261
+ This CLI will only activate if argv was intentionally configured to do so
263
262
  This entrypoint is for the spawned process to act
264
263
  """
265
264
  try:
266
265
  if len(sys.argv) == 4 and sys.argv[1] == _Secret.value:
267
- if os.environ.get(_Secret.key, None) == _Secret.value:
266
+ if environ.get(_Secret.key, None) == _Secret.value:
268
267
  delay = int(sys.argv[2])
269
268
  d = Path(sys.argv[3]).resolve()
270
269
  time.sleep(delay)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: delayed_rm
3
- Version: 2.9.1
3
+ Version: 2.9.2
4
4
  Summary: Ever wish you had a few minutes to undo an rm? Now you do!
5
5
  License: GPLv3
6
6
  Project-URL: Homepage, https://github.com/zwimer/delayed_rm
File without changes
File without changes
File without changes
File without changes