Example #1
0
    def update_button_sizes(self):
        thumbnail_size_map = {
            "tiny": (style.tiny_thumbnail_height, style.tiny_thumbnail_width),
            "small":
            (style.small_thumbnail_height, style.small_thumbnail_width),
            "medium":
            (style.medium_thumbnail_height, style.medium_thumbnail_width),
            "large":
            (style.large_thumbnail_height, style.large_thumbnail_width),
            "huge": (style.huge_thumbnail_height, style.huge_thumbnail_width)
        }

        thumbnail_size = settings.get_setting("thumbnail_size")
        thumbnail_size = thumbnail_size_map.get(thumbnail_size)

        if thumbnail_size:
            self.thumbnailheight = thumbnail_size[0]
            self.thumbnailwidth = thumbnail_size[1]
Example #2
0
def startGUI(args=None):
    # frameManager serves to load all pages and stack them on top of each other (all 2 of them)
    # also serves to make many important objects and functions easily
    # available to children frames
    gui = frameManager(
        pagelist, args, {
            "width": settings.get_setting("width"),
            "height": settings.get_setting("height")
        })

    # Set title formatted with version
    gui.set_version(version_string)
    gui.title(version_string)
    # Wheteher to keep window topmost
    gui.attributes(
        "-topmost",
        True if settings.get_setting("keep_topmost") == "true" else False)

    maximized_options = {
        "fullscreen": "-fullscreen",
        "maximized": "-zoomed",
        "windowed": None
    }
    if maximized_options[settings.get_setting("maximized")]:
        opt = maximized_options[settings.get_setting("maximized")]

        if platform.system() == 'Windows':
            try:
                gui.state(opt.strip("-"))
            except Exception as e:
                print(
                    "Error setting window launch type for Windows, this is a bug please report it:\n     {}"
                    .format(e))
        else:
            gui.attributes(opt, True)

    # Set icon
    favicon = None
    if platform.system() in ['Windows', 'Linux']:
        print("{} detected, setting icon".format(platform.system()))
        favicon = 'assets/favicon.png'
    elif platform.system() == "Darwin":
        print("MacOS detected, not setting icon as it is not supported")

    if favicon:
        if os.path.exists(favicon):
            # Set icon
            gui.tk.call('wm', 'iconphoto', gui._w, tk.PhotoImage(file=favicon))
        else:
            print("Icon file not found, not setting favicon")

    if (True if settings.get_setting("borderless") == "true" else False):
        if platform.system() in ['Windows']:
            gui.overrideredirect(1)
        else:
            try:
                if TKVERSION > 8.5:
                    if gui.tk.call('tk', 'windowingsystem') == "x11":
                        gui.wm_attributes('-type', 'splash')
            except:
                print("Failed to set window type to borderless")

    gui.mainloop()
Example #3
0
import os
import sys
from settings_tool import settings

if __name__ == "__main__":
    sys.exit(
        "This file was not meant to be run, try running appstoreworkbench.py")

WII = "Wii - alpha - spinnarak (brewtools.dev)"
WII_OSC = "Wii - beta - osc-redist (brewtools.dev)"
WIIU = "WiiU - (wiiubru.com)"
SWITCH = "Switch - (switchbru.com)"

CONSOLE = settings.get_setting("console")

if CONSOLE == WII_OSC:
    REPO_URL = "http://brewtools.dev/osc-redist/"  #LyfeOnEdges Temporary Site
    LIBGET_DIR = "wii/apps/appstore/.get/packages"

elif CONSOLE == WII:
    REPO_URL = "http://www.brewtools.dev/wii-spinarak/"  #LyfeOnEdges Temporary Site
    LIBGET_DIR = "wii/apps/appstore/.get/packages"

elif CONSOLE == WIIU:
    REPO_URL = "http://wiiubru.com/appstore/"
    LIBGET_DIR = "wiiu/apps/appstore/.get/packages"

elif CONSOLE == SWITCH:
    REPO_URL = "https://www.switchbru.com/appstore/"
    LIBGET_DIR = "switch/appstore/.get/packages"
Example #4
0
from locations import update_url
from asyncthreader import threader
from github_updater import updater
from pages import pagelist
from fusee_wrapper import injector
from settings_tool import settings
import style

print("Checking for updates...")
if updater.check_for_update(version):
	print("Update detected.")
else:
	print("Up to date.")

#Async threader tool for getting downloads and other functions asyncronously
threader.set_max_threads(int(settings.get_setting("gui_threads")))

def create_arg_parser():
	parser = argparse.ArgumentParser(description='pass a repo.json to load a local one instead of one downloaded from github')
	parser.add_argument('repo',
					help='repo.json path')
	return parser

parsed_args = None
if len(sys.argv) > 1:
	arg_parser = create_arg_parser()
	parsed_args = arg_parser.parse_args(sys.argv[1:])

toolsfolder = os.path.join(sys.path[0], "tools")
if not os.path.isdir(toolsfolder):
	print("Initing tools folder")