Dolda2000 GitWeb
/
automanga.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6a0782d
)
local: Treat dots/periods as digits in destructuring directories.
master
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 20 Aug 2023 15:35:39 +0000
(17:35 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 20 Aug 2023 15:35:39 +0000
(17:35 +0200)
manga/local.py
patch
|
blob
|
blame
|
history
diff --git
a/manga/local.py
b/manga/local.py
index
43392a1
..
7f5a34d
100644
(file)
--- a/
manga/local.py
+++ b/
manga/local.py
@@
-1,14
+1,20
@@
import os, pathlib
from . import lib
import os, pathlib
from . import lib
+def pdigit(s):
+ for c in s:
+ if c not in "0123456789.":
+ return False
+ return True
+
def decode1(nm):
ret = []
p = 0
while p < len(nm):
def decode1(nm):
ret = []
p = 0
while p < len(nm):
- if
nm[p].isdigit(
):
+ if
pdigit(nm[p]
):
s = p
p += 1
s = p
p += 1
- while p < len(nm) and
nm[p].isdigit(
):
+ while p < len(nm) and
pdigit(nm[p]
):
p += 1
ret += [nm[s:p]]
elif nm[p].isalpha():
p += 1
ret += [nm[s:p]]
elif nm[p].isalpha():
@@
-25,7
+31,7
@@
def decode1(nm):
def genstr(s):
ret = []
for part in s:
def genstr(s):
ret = []
for part in s:
- if p
art.isdigit(
):
+ if p
digit(part
):
ret += [int]
else:
ret += [part]
ret += [int]
else:
ret += [part]
@@
-155,7
+161,7
@@
class manga(lib.manga):
if not ordered:
structs.sort(key=lambda o: "".join(o[1][len(mx):]))
for i in reversed(var):
if not ordered:
structs.sort(key=lambda o: "".join(o[1][len(mx):]))
for i in reversed(var):
- structs.sort(key=lambda o:
int(o[1][i])
)
+ structs.sort(key=lambda o:
o[1][i]
)
readnames = prefixes(self.path)
def constree(p, structs, idx):
if idx == len(var):
readnames = prefixes(self.path)
def constree(p, structs, idx):
if idx == len(var):