edir 2.27__tar.gz → 2.28__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.
@@ -2,7 +2,7 @@ NAME = $(shell basename $(CURDIR))
2
2
  PYNAME = $(subst -,_,$(NAME))
3
3
 
4
4
  check:
5
- ruff $(PYNAME).py
5
+ ruff check $(PYNAME).py
6
6
  flake8 $(PYNAME).py
7
7
  mypy $(PYNAME).py
8
8
  pyright $(PYNAME).py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edir
3
- Version: 2.27
3
+ Version: 2.28
4
4
  Summary: Utility to rename, remove, and copy files/dirs using your editor
5
5
  Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
6
6
  License: GPLv3
@@ -259,10 +259,11 @@ you can use `-T` on the command line to turn that default option off
259
259
  temporarily.
260
260
 
261
261
  You can specify an alternative trash program, e.g.
262
- [`trash-d`](https://github.com/rushsteve1/trash-d) or [`gio
263
- trash`](https://man.archlinux.org/man/gio.1#COMMANDS), by setting the
264
- `--trash-program` option. Most likely you want to set this as a [default
265
- option](#command-default-options).
262
+ [`trash-d`](https://github.com/rushsteve1/trash-d), or
263
+ [`gio trash`](https://man.archlinux.org/man/gio.1#COMMANDS), or
264
+ [`gtrash put`](https://github.com/umlx5h/gtrash),
265
+ by setting the `--trash-program` option. Most likely you
266
+ want to set this as a [default option](#command-default-options).
266
267
 
267
268
  ## Previewing Changes
268
269
 
@@ -245,10 +245,11 @@ you can use `-T` on the command line to turn that default option off
245
245
  temporarily.
246
246
 
247
247
  You can specify an alternative trash program, e.g.
248
- [`trash-d`](https://github.com/rushsteve1/trash-d) or [`gio
249
- trash`](https://man.archlinux.org/man/gio.1#COMMANDS), by setting the
250
- `--trash-program` option. Most likely you want to set this as a [default
251
- option](#command-default-options).
248
+ [`trash-d`](https://github.com/rushsteve1/trash-d), or
249
+ [`gio trash`](https://man.archlinux.org/man/gio.1#COMMANDS), or
250
+ [`gtrash put`](https://github.com/umlx5h/gtrash),
251
+ by setting the `--trash-program` option. Most likely you
252
+ want to set this as a [default option](#command-default-options).
252
253
 
253
254
  ## Previewing Changes
254
255
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edir
3
- Version: 2.27
3
+ Version: 2.28
4
4
  Summary: Utility to rename, remove, and copy files/dirs using your editor
5
5
  Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
6
6
  License: GPLv3
@@ -259,10 +259,11 @@ you can use `-T` on the command line to turn that default option off
259
259
  temporarily.
260
260
 
261
261
  You can specify an alternative trash program, e.g.
262
- [`trash-d`](https://github.com/rushsteve1/trash-d) or [`gio
263
- trash`](https://man.archlinux.org/man/gio.1#COMMANDS), by setting the
264
- `--trash-program` option. Most likely you want to set this as a [default
265
- option](#command-default-options).
262
+ [`trash-d`](https://github.com/rushsteve1/trash-d), or
263
+ [`gio trash`](https://man.archlinux.org/man/gio.1#COMMANDS), or
264
+ [`gtrash put`](https://github.com/umlx5h/gtrash),
265
+ by setting the `--trash-program` option. Most likely you
266
+ want to set this as a [default option](#command-default-options).
266
267
 
267
268
  ## Previewing Changes
268
269
 
@@ -127,7 +127,7 @@ def remove(path: Path, git: bool = False, trash: bool = False,
127
127
  out, err = run(f'{args.trash_program} "{path}"')
128
128
  return f'{args.trash_program} error: {err}' if err else None
129
129
 
130
- if recurse:
130
+ if recurse and not path.is_symlink():
131
131
  try:
132
132
  shutil.rmtree(str(path))
133
133
  except Exception as e:
@@ -184,7 +184,7 @@ class Fpath:
184
184
  self.note = ''
185
185
  self.copies: List[Path] = []
186
186
  try:
187
- self.is_dir = path.is_dir()
187
+ self.is_dir = path.is_dir() and not path.is_symlink()
188
188
  except Exception as e:
189
189
  sys.exit(f'ERROR: Can not read {path}: {e}')
190
190
 
@@ -252,11 +252,21 @@ class Fpath:
252
252
 
253
253
  def sort_time(self) -> float:
254
254
  'Return time for sort'
255
- return self.path.stat().st_mtime
255
+ try:
256
+ ret = self.path.lstat().st_mtime
257
+ except Exception:
258
+ ret = 0
259
+
260
+ return ret
256
261
 
257
262
  def sort_size(self) -> int:
258
263
  'Return size for sort'
259
- return self.path.stat().st_size
264
+ try:
265
+ ret = self.path.lstat().st_size
266
+ except Exception:
267
+ ret = 0
268
+
269
+ return ret
260
270
 
261
271
  def is_recursive(self) -> bool:
262
272
  'Return True if directory and we can view it and contains children'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes