delayed-rm 3.0.0__tar.gz → 3.0.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.4
2
2
  Name: delayed_rm
3
- Version: 3.0.0
3
+ Version: 3.0.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
@@ -13,7 +13,7 @@ import time
13
13
  import sys
14
14
 
15
15
  # Constants
16
- __version__ = "3.0.0"
16
+ __version__ = "3.0.2"
17
17
  _UNSAFE_FLAG = "unsafe-rmtree"
18
18
  log_f: Path = Path.home().resolve() / ".delayed_rm.log"
19
19
  tmp_d: Path = Path(gettempdir()).resolve() / ".delayed_rm"
@@ -185,8 +185,8 @@ def delayed_rm(paths: list[Path], delay: int, rf: bool, unsafe: bool = False) ->
185
185
  shutil.rmtree(p)
186
186
  else:
187
187
  copy3(p, new)
188
- edited = True
189
188
  p.unlink()
189
+ edited = True
190
190
  success.append(p)
191
191
  full_where[p] = new
192
192
  where[p.name].add(out_d)
@@ -195,18 +195,18 @@ def delayed_rm(paths: list[Path], delay: int, rf: bool, unsafe: bool = False) ->
195
195
  _print_exc(e)
196
196
  if edited:
197
197
  _print_stderr(f"WARNING: Contents of {p} may have been PARTIALLY delayed_rm'd")
198
- continue
199
- if _copytree:
200
- if output := _rmtree(new):
201
- _print_stderr(output)
202
- continue
203
- new.unlink()
198
+ elif not new.exists(follow_symlinks=False):
199
+ pass
200
+ elif not _copytree:
201
+ new.unlink()
202
+ elif output := _rmtree(new):
203
+ _print_stderr(output)
204
204
  finally:
205
205
  any_edited |= edited
206
206
  except KeyboardInterrupt:
207
207
  ctrlc = True
208
208
  # Inform user of failures
209
- failed_plus: list[str] = [str(i) for i in failed]
209
+ failed_plus: list[str] = list(map(str, failed))
210
210
  if len(failed) > 0 and not ctrlc:
211
211
  _print_exc(OSError("failed to rm:\n " + "\n ".join(failed_plus)))
212
212
  # Log result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: delayed_rm
3
- Version: 3.0.0
3
+ Version: 3.0.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