Skip to content

Commit

Permalink
Cleaned up PEP 8 issues with autopep8. Should fix #53
Browse files Browse the repository at this point in the history
  • Loading branch information
Valiec committed Jul 17, 2019
1 parent 163aa19 commit 11ca1cb
Show file tree
Hide file tree
Showing 9 changed files with 1,706 additions and 1,493 deletions.
589 changes: 321 additions & 268 deletions src/delta_gui.py

Large diffs are not rendered by default.

87 changes: 46 additions & 41 deletions src/delta_importexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,59 @@
execdir = "@ERROR@"
instance = "@ERROR@"

def init_config_importexport(data): #data is a 5-tuple
global modfolder, jarfolder, mc_version, execdir, instance, gui #makes it edit the global vars rather than create new ones
modfolder, jarfolder, mc_version, execdir, instance, gui = data

def init_config_importexport(data): # data is a 5-tuple
# makes it edit the global vars rather than create new ones
global modfolder, jarfolder, mc_version, execdir, instance, gui
modfolder, jarfolder, mc_version, execdir, instance, gui = data


def recieve_tkinst_importexport(data):
global tkinst
tkinst = data
global tkinst
tkinst = data


def export_mods(filename):
if (filename == None):
filename = cinput("What would you like your new modlist to be called?")
os.chdir(execdir)
os.chdir("LocalData/Modlists")
mods = []
if(os.path.exists(execdir + "/LocalData/ModsDownloaded/"+instance)):
mods = os.listdir(execdir + "/LocalData/ModsDownloaded/"+instance)
i = 0
for modtmp in mods:
cprint(modtmp)
modtmp = modtmp[:-10]
modtmp = '"' + modtmp + '"'
cprint(modtmp)
mods[i] = modtmp
i += 1
cprint('{ "Mods":' + json.dumps(mods) + "}")
f = open(filename + '.modlist', 'w')
f.write('{ "Mods":' + json.dumps(mods) + '}')
f.close()
cprint("Done! now in LocalData/Modlists.")
os.chdir(execdir)
else:
return
if (filename == None):
filename = cinput("What would you like your new modlist to be called?")
os.chdir(execdir)
os.chdir("LocalData/Modlists")
mods = []
if(os.path.exists(execdir + "/LocalData/ModsDownloaded/"+instance)):
mods = os.listdir(execdir + "/LocalData/ModsDownloaded/"+instance)
i = 0
for modtmp in mods:
cprint(modtmp)
modtmp = modtmp[:-10]
modtmp = '"' + modtmp + '"'
cprint(modtmp)
mods[i] = modtmp
i += 1
cprint('{ "Mods":' + json.dumps(mods) + "}")
f = open(filename + '.modlist', 'w')
f.write('{ "Mods":' + json.dumps(mods) + '}')
f.close()
cprint("Done! now in LocalData/Modlists.")
os.chdir(execdir)
else:
return


def import_mods(path):
if (path == None):
path = cinput("Please enter the path to the modlist.")
if (path == None):
path = cinput("Please enter the path to the modlist.")

if(os.path.exists(path)): # Telling user that file exists
cprint(path + " found.")
else:
cprint(path + " not found.")
return
if(os.path.exists(path)): # Telling user that file exists
cprint(path + " found.")
else:
cprint(path + " not found.")
return

json_data = json.load(path)
json_data = json.load(path)

mods = []
mods = []

mods = json_data["Mods"]
for mod in mods:
cprint(mod)
delta_install.install_mod(mod)
mods = json_data["Mods"]
for mod in mods:
cprint(mod)
delta_install.install_mod(mod)
Loading

0 comments on commit 11ca1cb

Please sign in to comment.