From 75f2bc1dfc29bef35c1eed2e7a5d9910d62b6a4e Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Thu, 14 Mar 2019 13:40:27 +0100 Subject: [PATCH] contribManager: fix imports, use print_function We don't need to import nbt from overviewer_core at all so we can remove the silly fix to do that. Why was that ever there? It's a mystery! --- contribManager.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/contribManager.py b/contribManager.py index 18c9aab..aa4fc26 100755 --- a/contribManager.py +++ b/contribManager.py @@ -3,15 +3,11 @@ """The contrib manager is used to help control the contrib scripts that are shipped with overviewer in Windows packages.""" -import sys -import os.path +from __future__ import print_function + import ast - -# incantation to be able to import overviewer_core -if not hasattr(sys, "frozen"): - sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0], '.'))) - -from overviewer_core import nbt +import os.path +import sys scripts = { # keys are names, values are scripts "convertCyrillic": "cyrillic_convert.py", @@ -67,20 +63,20 @@ else: docstring = docstring.strip().splitlines()[0] else: docstring = "(No description found. Add one by adding a docstring to %s.)" % script - print "%s : %s" % (contrib, docstring) + print("%s : %s" % (contrib, docstring)) sys.exit(0) if len(sys.argv) > 1 and sys.argv[1] in scripts.keys(): script = scripts[sys.argv[1]] sys.argv = [script] + sys.argv[2:] else: - print usage + print(usage, file=sys.stderr) sys.exit(1) torun = os.path.join("contrib", script) if not os.path.exists(torun): - print "Script '%s' is missing!" % script + print("Script '%s' is missing!" % script, file=sys.stderr) sys.exit(1) execfile(torun)