Fix editor prio as per #333

This commit is contained in:
boltgolt 2020-06-22 18:00:33 +02:00
parent 23810ef3c9
commit 2890457fa5
No known key found for this signature in database
GPG key ID: BECEC9937E1AAE26

View file

@ -11,10 +11,10 @@ print("Opening config.ini in the default editor")
editor = "/bin/nano"
# Use the user preferred editor if available
if os.path.isfile("/etc/alternatives/editor"):
editor = "/etc/alternatives/editor"
elif "EDITOR" in os.environ:
if "EDITOR" in os.environ:
editor = os.environ["EDITOR"]
elif os.path.isfile("/etc/alternatives/editor"):
editor = "/etc/alternatives/editor"
# Open the editor as a subprocess and fork it
subprocess.call([editor, os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"])