Update terminis.py

This commit is contained in:
adrienmalin 2019-02-15 12:13:55 +01:00
parent db2065997c
commit 206ab23e36

@ -13,7 +13,7 @@ import sched
import time import time
import os import os
import locale import locale
import distutils.spawn import subprocess
try: try:
import configparser import configparser
except ImportError: except ImportError:
@ -728,13 +728,12 @@ def main():
def edit(): def edit():
if sys.platform == "win32": if sys.platform == "win32":
if distutils.spawn.find_executable("edit"): try:
command = "edit" subprocess.call(["edit.com", Controls.FILE_PATH])
except FileNotFoundError:
subprocess.call(["notepad.exe", Controls.FILE_PATH])
else: else:
command = "notepad" subprocess.call(["${EDITOR:-vi}", Controls.FILE_PATH])
else:
command = "${EDITOR:-vi}"
os.system(command+" "+Controls.FILE_PATH)
def usage(): def usage():
print("Usage:") print("Usage:")