mirror of
https://github.com/netinvent/npbackup.git
synced 2025-12-17 21:50:05 +08:00
Fix GUI tree on Windows must have case insensitive keys
This commit is contained in:
parent
d1d60f00fe
commit
6572aecc18
1 changed files with 4 additions and 0 deletions
|
|
@ -159,6 +159,10 @@ def _make_treedata_from_json(ls_result: List[dict]) -> sg.TreeData:
|
||||||
for entry in ls_result:
|
for entry in ls_result:
|
||||||
# Make sure we drop the prefix '/' so sg.TreeData does not get an empty root
|
# Make sure we drop the prefix '/' so sg.TreeData does not get an empty root
|
||||||
entry["path"] = entry["path"].lstrip("/")
|
entry["path"] = entry["path"].lstrip("/")
|
||||||
|
if os.name == 'nt':
|
||||||
|
# On windows, we need to make sure tree keys don't get duplicate because of lower/uppercase
|
||||||
|
# Shown filenames aren't affected by this
|
||||||
|
entry["path"] = entry["path"].lower()
|
||||||
parent = os.path.dirname(entry["path"])
|
parent = os.path.dirname(entry["path"])
|
||||||
|
|
||||||
# Make sure we normalize mtime, and remove microseconds
|
# Make sure we normalize mtime, and remove microseconds
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue