issue 10 fix
This commit is contained in:
parent
a39cd7ae68
commit
0fd4ff9b74
2
setup.py
2
setup.py
|
@ -13,7 +13,7 @@ def main():
|
||||||
long_description='SSH connection and aliases manager with curses and command line interface',
|
long_description='SSH connection and aliases manager with curses and command line interface',
|
||||||
long_description_content_type='text/x-rst',
|
long_description_content_type='text/x-rst',
|
||||||
license='DWTWL 2.55',
|
license='DWTWL 2.55',
|
||||||
version='1.03',
|
version='1.04',
|
||||||
py_modules=['sshch'],
|
py_modules=['sshch'],
|
||||||
scripts=['sshch/sshch'],
|
scripts=['sshch/sshch'],
|
||||||
keywords='sshch ssh aliases curses manager',
|
keywords='sshch ssh aliases curses manager',
|
||||||
|
|
13
sshch/sshch
13
sshch/sshch
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
@ -20,11 +20,12 @@ import curses
|
||||||
from curses import textpad, panel
|
from curses import textpad, panel
|
||||||
|
|
||||||
# https://gitlab.com/zlax/sshch
|
# https://gitlab.com/zlax/sshch
|
||||||
version = "1.03"
|
version = "1.04"
|
||||||
# path to conf file, default: ~/.config/sshch.conf
|
|
||||||
conf_file = path.expanduser("~") + '/.config/sshch.conf'
|
|
||||||
# expand groups by default
|
# expand groups by default
|
||||||
expand_default = True
|
expand_default = True
|
||||||
|
# path to conf dir and file, default: ~/.config/sshch.conf
|
||||||
|
conf_dir = path.expanduser("~") + '/.config'
|
||||||
|
conf_file = conf_dir + '/' + 'sshch.conf'
|
||||||
|
|
||||||
|
|
||||||
def AddNewAlias(alias):
|
def AddNewAlias(alias):
|
||||||
|
@ -806,6 +807,10 @@ if __name__ == "__main__":
|
||||||
except NameError:
|
except NameError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if not path.exists(conf_dir):
|
||||||
|
from os import makedirs
|
||||||
|
makedirs(conf_dir)
|
||||||
|
|
||||||
conf = configparser.RawConfigParser()
|
conf = configparser.RawConfigParser()
|
||||||
if not path.exists(conf_file):
|
if not path.exists(conf_file):
|
||||||
open(conf_file, 'w')
|
open(conf_file, 'w')
|
||||||
|
|
Loading…
Reference in New Issue