[scripts/util] add 'trim()' helper

This commit is contained in:
Mike Fährmann
2025-08-05 21:55:05 +02:00
parent 3dd1372a0b
commit 253d498a4e
3 changed files with 7 additions and 7 deletions

View File

@@ -60,7 +60,7 @@ def create_extractor_module(args):
category = args.category
path = util.path("gallery_dl", "extractor", f"{category}.py")
LOG.info("Creating '%s'", trim_path(path))
LOG.info("Creating '%s'", util.trim(path))
type = args.type
if type == "manga":
@@ -218,7 +218,7 @@ BASE_PATTERN = r"(?:https?://)?{subdomain}{re.escape(domain)}"
def create_test_results_file(args):
path = util.path("test", "results", f"{args.category}.py")
LOG.info("Creating '%s'", trim_path(path))
LOG.info("Creating '%s'", util.trim(path))
import_stmt = generate_test_result_import(args)
with util.open(path, "x") as fp:
@@ -311,10 +311,6 @@ def insert_into_supportedsites(args):
###############################################################################
# General #####################################################################
def trim_path(path):
return path[len(util.ROOTDIR)+1:]
def parse_args(args=None):
parser = argparse.ArgumentParser(args)