delayed-rm 2.9.3__tar.gz → 2.10.0__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.
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/PKG-INFO +1 -1
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm/delayed_rm.py +13 -2
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm.egg-info/PKG-INFO +1 -1
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/LICENSE +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/README.md +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm/__init__.py +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm/py.typed +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm.egg-info/SOURCES.txt +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm.egg-info/dependency_links.txt +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm.egg-info/entry_points.txt +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/delayed_rm.egg-info/top_level.txt +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/pyproject.toml +0 -0
- {delayed_rm-2.9.3 → delayed_rm-2.10.0}/setup.cfg +0 -0
|
@@ -8,11 +8,12 @@ import subprocess
|
|
|
8
8
|
import argparse
|
|
9
9
|
import tempfile
|
|
10
10
|
import shutil
|
|
11
|
+
import math
|
|
11
12
|
import time
|
|
12
13
|
import sys
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
__version__ = "2.
|
|
16
|
+
__version__ = "2.10.0"
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
#
|
|
@@ -51,6 +52,16 @@ class _Secret:
|
|
|
51
52
|
#
|
|
52
53
|
|
|
53
54
|
|
|
55
|
+
def _size(p: Path) -> str:
|
|
56
|
+
"""
|
|
57
|
+
Get file size as a human readable string
|
|
58
|
+
"""
|
|
59
|
+
s = p.stat().st_size
|
|
60
|
+
lg = int(math.log(s, 1000))
|
|
61
|
+
si = " KMGT"[lg].replace(" ", "")
|
|
62
|
+
return f"{round(s/(1000**lg))} {si}B"
|
|
63
|
+
|
|
64
|
+
|
|
54
65
|
def _eprint(e: str | BaseException) -> None:
|
|
55
66
|
"""
|
|
56
67
|
Print e to stderr
|
|
@@ -213,7 +224,7 @@ def delayed_rm_raw(delay: int, log: bool, r: bool, f: bool, paths: list[Path]) -
|
|
|
213
224
|
if r or f or paths:
|
|
214
225
|
_eprint("--log may not be used with other arguments")
|
|
215
226
|
return False
|
|
216
|
-
print(f"{log_f.read_text()}Log file: {log_f}" if log_f.exists() else "Log is empty")
|
|
227
|
+
print(f"{log_f.read_text()}Log file ({_size(log_f)}): {log_f}" if log_f.exists() else "Log is empty")
|
|
217
228
|
return True
|
|
218
229
|
if not paths:
|
|
219
230
|
_eprint("nothing to remove")
|
|
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
|