Skip to content

Commit

Permalink
Use ~/.eblih as config file (For groups)
Browse files Browse the repository at this point in the history
  • Loading branch information
hug33k committed Jun 29, 2016
1 parent a0338cb commit b1bd2b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions eblih
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def show(message, color, direct=True):

class Eblih(object):

def __init__(self, user, token, color=True, folder=os.getenv('PWD'), tmp="/tmp/eblih", baseurl="https://blih.epitech.eu/", verbose=False, groups="./groups.json", graphicMode=False):
def __init__(self, user, token, color=True, folder=os.getenv('PWD'), tmp="/tmp/eblih", baseurl="https://blih.epitech.eu/", verbose=False, groups="{0}/.eblih".format(os.path.expanduser("~")), graphicMode=False):
super(Eblih, self).__init__()
self._user = user
self._token = token
Expand Down Expand Up @@ -120,7 +120,7 @@ if __name__ == '__main__':
colors = True
tmp = "/tmp/eblih"
baseurl = "https://blih.epitech.eu"
groups = "srcs/groups.json"
groups = "{0}/.eblih".format(os.path.expanduser("~"))
for flag, value in opts:
if flag in ('-h', '--help'):
showHelp = True
Expand Down
10 changes: 5 additions & 5 deletions srcs/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __str__(self):

class Mode(object):

def __init__(self, user, token, groups="./groups.json"):
def __init__(self, user, token, groups="{0}/.eblih".format(os.path.expanduser("~"))):
super(Mode, self).__init__()
self._user = user
self._token = token
Expand Down Expand Up @@ -45,7 +45,7 @@ def execute(self, args):

class Repository(Mode):

def __init__(self, user, token, groups="./groups.json", folder=None, tmp=None, gitServer="git.epitech.eu"):
def __init__(self, user, token, groups="{0}/.eblih".format(os.path.expanduser("~")), folder=None, tmp=None, gitServer="git.epitech.eu"):
super(Repository, self).__init__(user, token, groups)
self._api = BLIH.Repository(self._user, self._token)
self._folder = folder
Expand Down Expand Up @@ -223,7 +223,7 @@ def help(self):

class SSHKey(Mode):

def __init__(self, user, token, groups="./groups.json", folder=None, tmp=None):
def __init__(self, user, token, groups="{0}/.eblih".format(os.path.expanduser("~")), folder=None, tmp=None):
super(SSHKey, self).__init__(user, token, groups)
self._api = BLIH.SSHKey(self._user, self._token)
self._actions = {"upload": self._api.upload,
Expand Down Expand Up @@ -257,7 +257,7 @@ def help(self):

class Group(Mode):

def __init__(self, user=None, token=None, groups="./groups.json", folder=None, tmp=None):
def __init__(self, user=None, token=None, groups="{0}/.eblih".format(os.path.expanduser("~")), folder=None, tmp=None):
super(Group, self).__init__(None, None, groups)
self._config = self.getGroupsConfig()
self._actions = {"create": self.create,
Expand Down Expand Up @@ -356,7 +356,7 @@ def help(self):

class Config(Mode):

def __init__(self, user=None, token=None, groups="./groups.json", folder=None, tmp=None):
def __init__(self, user=None, token=None, groups="{0}/.eblih".format(os.path.expanduser("~")), folder=None, tmp=None):
super(Config, self).__init__(None, None, groups)
self._actions = {"crypt": self.crypt,
"disp": self.disp}
Expand Down

0 comments on commit b1bd2b9

Please sign in to comment.