Skip to content

Commit

Permalink
reorganize imports for FunkiiU
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-roelofs committed Apr 19, 2017
1 parent de7ea8d commit 5589822
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
1 change: 0 additions & 1 deletion config.json

This file was deleted.

12 changes: 8 additions & 4 deletions frontend.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/usr/bin/python

from util import *
if not os.path.isfile("FunKiiU.py"):
download_funkiiu()

from Tkinter import *
from ttk import *
import tkFileDialog
Expand Down Expand Up @@ -165,6 +161,14 @@ def download_games():
downloader.add_game(current_selected)
refresh_download_listbox()

def download_funkiiu():
try:
urllib.urlretrieve(funkiiu_url, "FunKiiU.py")
log("FunKiiU successfully downloaded.")
except Exception as error:
log(error)




search_tab = Frame(note)
Expand Down
25 changes: 13 additions & 12 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@
funkiiu_url = "https://raw.githubusercontent.com/llakssz/FunKiiU/master/FunKiiU.py"
wiiutdb_url = "http://www.gametdb.com/wiiutdb.zip"

try:
import FunKiiU as fnk
except Exception as e:
pass
def download_funkiiu():
try:
urllib.urlretrieve(funkiiu_url, "FunKiiU.py")
log("FunKiiU successfully downloaded.")
except Exception as error:
log(error)


if not os.path.isfile("FunKiiU.py"):
download_funkiiu()

import FunKiiU as fnk


def unpack_zip(zip_name):
try:
Expand Down Expand Up @@ -94,11 +103,3 @@ def get_title_size(titleid):
total_size += int(binascii.hexlify(tmd[c_offs + 0x08:c_offs + 0x10]), 16)
return fnk.bytes2human(total_size)

def download_funkiiu():
try:
urllib.urlretrieve(funkiiu_url, "FunKiiU.py")
log("FunKiiU successfully downloaded.")
except Exception as error:
log(error)


0 comments on commit 5589822

Please sign in to comment.