|
|
@ -20,7 +20,7 @@ import curses |
|
|
|
from curses import textpad, panel |
|
|
|
|
|
|
|
# https://gitlab.com/zlax/sshch |
|
|
|
version = "1.04" |
|
|
|
version = "1.05" |
|
|
|
# expand groups by default |
|
|
|
expand_default = True |
|
|
|
# path to conf dir and file, default: ~/.config/sshch.conf |
|
|
@ -808,13 +808,28 @@ if __name__ == "__main__": |
|
|
|
pass |
|
|
|
|
|
|
|
if not path.exists(conf_dir): |
|
|
|
from os import makedirs |
|
|
|
makedirs(conf_dir) |
|
|
|
try: |
|
|
|
from os import makedirs |
|
|
|
makedirs(conf_dir) |
|
|
|
except: |
|
|
|
print("Can't make dir " + conf_dir) |
|
|
|
exit() |
|
|
|
|
|
|
|
conf = configparser.RawConfigParser() |
|
|
|
|
|
|
|
if not path.exists(conf_file): |
|
|
|
open(conf_file, 'w') |
|
|
|
conf.read(conf_file) |
|
|
|
try: |
|
|
|
open(conf_file, 'w') |
|
|
|
except: |
|
|
|
print("Can't make file at " + conf_dir) |
|
|
|
exit() |
|
|
|
|
|
|
|
try: |
|
|
|
conf.read(conf_file) |
|
|
|
except: |
|
|
|
print("Error: can't read config file " + conf_file) |
|
|
|
exit() |
|
|
|
|
|
|
|
if len(argv) > 1: |
|
|
|
try: |
|
|
|
CMDOptions() |
|
|
@ -823,6 +838,10 @@ if __name__ == "__main__": |
|
|
|
except configparser.Error: |
|
|
|
print("Error: can't parse your config file, please check it manually or make new one") |
|
|
|
exit() |
|
|
|
except IOError: |
|
|
|
print("Error: can't use your config file, please check permissionss of " + conf_file) |
|
|
|
exit() |
|
|
|
|
|
|
|
else: |
|
|
|
try: |
|
|
|
CursesMain() |
|
|
@ -834,3 +853,6 @@ if __name__ == "__main__": |
|
|
|
except curses.error: |
|
|
|
CursesExit("".join(["Error: can't show some curses element, maybe ", |
|
|
|
"your terminal is too small"])) |
|
|
|
except IOError: |
|
|
|
CursesExit("".join(["Error: can't use your config file, please ", |
|
|
|
"check permissionss of ", conf_file])) |
|
|
|