Skip to content

Commit

Permalink
change code
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzz465 committed Mar 25, 2019
1 parent ab810d8 commit d8c9a15
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ def download_DB(): #shakeyourbunny's code. thank you!
except:
try:
log.warning('cannot download DB from server. loading local DB files...')
with open('DB_template.json', mode='w') as jsonlocal:
currentpath = os.getcwd() # 설마..

from core import RWmanager
xmlpath = RWmanager.askfiledir(titlename="select DB_template.json", filetype=[('*.*', '*.*')])
os.chdir(os.path.dirname(xmlpath))
with open('DB_template.json', mode='r') as jsonlocal:
dbrawdata = jsonlocal.read()


os.chdir(currentpath) #FIXME change to more better code.

return json.loads(dbrawdata)

except:
Expand Down

0 comments on commit d8c9a15

Please sign in to comment.