Fix editor prio as per #333
This commit is contained in:
parent
23810ef3c9
commit
2890457fa5
1 changed files with 3 additions and 3 deletions
|
|
@ -11,10 +11,10 @@ print("Opening config.ini in the default editor")
|
||||||
editor = "/bin/nano"
|
editor = "/bin/nano"
|
||||||
|
|
||||||
# Use the user preferred editor if available
|
# Use the user preferred editor if available
|
||||||
if os.path.isfile("/etc/alternatives/editor"):
|
if "EDITOR" in os.environ:
|
||||||
editor = "/etc/alternatives/editor"
|
|
||||||
elif "EDITOR" in os.environ:
|
|
||||||
editor = os.environ["EDITOR"]
|
editor = os.environ["EDITOR"]
|
||||||
|
elif os.path.isfile("/etc/alternatives/editor"):
|
||||||
|
editor = "/etc/alternatives/editor"
|
||||||
|
|
||||||
# Open the editor as a subprocess and fork it
|
# Open the editor as a subprocess and fork it
|
||||||
subprocess.call([editor, os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"])
|
subprocess.call([editor, os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue