Skip to content

Commit

Permalink
[fix] fix password
Browse files Browse the repository at this point in the history
  • Loading branch information
jhao104 committed Dec 7, 2018
1 parent 26aaf18 commit 223f57d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions Util/GetConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GetConfig(object):
def __init__(self):
self.pwd = os.path.split(os.path.realpath(__file__))[0]
self.config_path = os.path.join(os.path.split(self.pwd)[0], 'Config.ini')
self.config_file = ConfigParse()
self.config_file = ConfigParse(defaults={"password": None})
self.config_file.read(self.config_path)

@LazyProperty
Expand All @@ -47,7 +47,7 @@ def db_port(self):

@LazyProperty
def db_password(self):
return self.config_file.get('DB', 'password', fallback=None)
return self.config_file.get('DB', 'password')

@LazyProperty
def proxy_getter_functions(self):
Expand All @@ -61,10 +61,6 @@ def host_ip(self):
def host_port(self):
return int(self.config_file.get('API', 'port'))

@LazyProperty
def processes(self):
return int(self.config_file.get('API', 'processes'))


config = GetConfig()

Expand All @@ -77,5 +73,4 @@ def processes(self):
print(gg.proxy_getter_functions)
print(gg.host_ip)
print(gg.host_port)
print(gg.processes)
print(gg.db_password)
4 changes: 2 additions & 2 deletions Util/utilClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class ConfigParse(ConfigParser):
rewrite ConfigParser, for support upper option
"""

def __init__(self):
ConfigParser.__init__(self)
def __init__(self, *args, **kwargs):
ConfigParser.__init__(self, *args, **kwargs)

def optionxform(self, optionstr):
return optionstr
Expand Down

0 comments on commit 223f57d

Please sign in to comment.