mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 22:16:37 +00:00
Allow skipping the loop
This commit is contained in:
parent
a066ba49f2
commit
1415af5001
@ -130,10 +130,10 @@ def file_is_editable(filepath):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def directory_and_stem(arg_path):
|
def directory_and_stem(arg_path, /, *, only_once=False):
|
||||||
filepath = Path(arg_path)
|
filepath = Path(arg_path)
|
||||||
stem = Path(filepath.stem)
|
stem = Path(filepath.stem)
|
||||||
while stem.suffixes and '' != stem.suffix:
|
while not only_once and stem.suffixes and '' != stem.suffix:
|
||||||
stem = Path(stem.stem)
|
stem = Path(stem.stem)
|
||||||
stem = str(stem)
|
stem = str(stem)
|
||||||
return (filepath.parent, stem,)
|
return (filepath.parent, stem,)
|
||||||
|
Loading…
Reference in New Issue
Block a user