From d06e642b56bf0aedef1e9aa49c52448b96d85653 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Thu, 1 Oct 2020 14:11:11 +0200 Subject: [PATCH] Assume developers are using virtualenvs If this is true, we don't have to mess with sys.path or provide a "convenience" launcher anymore. --- dosage | 17 ----------------- scripts/create-cbz.py | 3 +-- scripts/mklanguages.py | 17 +++++++---------- scripts/scriptutil.py | 2 -- scripts/webcomicfactory.py | 2 +- scripts/webtoons.py | 2 +- 6 files changed, 10 insertions(+), 33 deletions(-) delete mode 100755 dosage diff --git a/dosage b/dosage deleted file mode 100755 index e95f028f5..000000000 --- a/dosage +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: MIT -# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs -# Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2018 Tobias Gruetzmacher -# ___ -# / \___ ___ __ _ __ _ ___ -# / /\ / _ \/ __|/ _` |/ _` |/ _ \ -# / /_// (_) \__ \ (_| | (_| | __/ -# /___,' \___/|___/\__,_|\__, |\___| -# |___/ -import sys - -from dosagelib.cmd import main - -if __name__ == '__main__': - sys.exit(main()) diff --git a/scripts/create-cbz.py b/scripts/create-cbz.py index 9b015f97a..938a315f5 100755 --- a/scripts/create-cbz.py +++ b/scripts/create-cbz.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MIT # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2016 Tobias Gruetzmacher +# Copyright (C) 2015-2020 Tobias Gruetzmacher """ Creates a CBZ file in the comic directory. Uses an ordered symlink directory (see order-symlinks.py) if it exists, @@ -13,7 +13,6 @@ import sys import os import zipfile -sys.path.append(os.path.join(os.path.dirname(__file__), "..")) # noqa from dosagelib.configuration import App diff --git a/scripts/mklanguages.py b/scripts/mklanguages.py index 331b8f953..d1b1321a7 100755 --- a/scripts/mklanguages.py +++ b/scripts/mklanguages.py @@ -1,21 +1,18 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: MIT # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2018 Tobias Gruetzmacher +# Copyright (C) 2015-2020 Tobias Gruetzmacher '''update languages.py from pycountry''' import os -import sys import codecs -basepath = os.path.dirname(os.path.dirname(__file__)) -sys.path.insert(0, basepath) - -from dosagelib.scraper import get_scrapers # noqa +from dosagelib.scraper import get_scrapers def main(): """Update language information in dosagelib/languages.py.""" + basepath = os.path.dirname(os.path.dirname(__file__)) fn = os.path.join(basepath, 'dosagelib', 'languages.py') with codecs.open(fn, 'w', 'utf-8') as f: f.write('# SPDX-License-Identifier: MIT\n') @@ -34,11 +31,11 @@ def get_used_languages(): return languages -def write_languages(f, l): +def write_languages(f, lang): """Write language information.""" f.write("Languages = {%s" % os.linesep) - for lang in sorted(l): - f.write(" %r: %r,%s" % (lang, l[lang], os.linesep)) + for lang in sorted(lang): + f.write(" %r: %r,%s" % (lang, lang[lang], os.linesep)) f.write("}%s" % os.linesep) diff --git a/scripts/scriptutil.py b/scripts/scriptutil.py index f64eafa52..9c696d901 100644 --- a/scripts/scriptutil.py +++ b/scripts/scriptutil.py @@ -12,8 +12,6 @@ import time import lxml -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) # noqa - from dosagelib.util import get_page from dosagelib import scraper, http diff --git a/scripts/webcomicfactory.py b/scripts/webcomicfactory.py index a39652aa9..6881d850e 100755 --- a/scripts/webcomicfactory.py +++ b/scripts/webcomicfactory.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: MIT # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam diff --git a/scripts/webtoons.py b/scripts/webtoons.py index b7fc535bc..043082d00 100755 --- a/scripts/webtoons.py +++ b/scripts/webtoons.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: MIT # Copyright (C) 2019-2020 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring