# Path: omnitool/colorlib.py

# 
# Path: omnitool/database.py
# def get_custom_db(txt):
# def parse():
# 
# Path: omnitool/pgu_override.py
# class Quitbutton(Button):
#     def __init__(self, app, text):
#         Button.__init__(self, text, width=300, height=40)
#         try:
#             self.connect(CLICK, app.quit, None)
#         except AttributeError:
#             self.connect(CLICK, app.close, None)
# 
# Path: omnitool/shared.py



import sys
import os
import pygame
import tempfile
import colorsys
import io
            import traceback
        import time
from random import randint
from time import sleep
from pgu import gui
from omnitool.colorlib import data, bad
from omnitool.database import multitiles, names
from omnitool.tlib import *
from omnitool.pgu_override import Quitbutton
from omnitool.shared import lang, theme, exit_prog, exit_prog, __version__
            from plugins.worldify_lib import jsonparse
                print("No Image supplied, please drag and drop an image onto the program")
                sleep(3)
                sys.exit(1000)
            else:

                app = gui.Desktop(theme=theme)
                app.connect(gui.QUIT, exit_prog, None)
                app.connect(gui.CLOSE, exit_prog, None)
                main = gui.dialog.FileDialog()
                main.connect(gui.CLOSE, app.quit, main)
                main.connect(gui.CHANGE, app.quit, main)
                main.open()
                app.run(main)
                pygame.display.quit()
                imagepath = main.value
        else:
            imagepath = sys.argv[1]


        local = os.listdir(os.getcwd())
        if "db.txt" in local:
            print("Found external database, starting parsing..")

            jsonparse.load()
            print("Database injection successful")
            ext = True
        else:
            ext = False
        pygame.display.init()
        pygame.display.set_caption("Worldify")

# Path: omnitool/colorlib.py

# 
# Path: omnitool/database.py
# def get_custom_db(txt):
# def parse():
# 
# Path: omnitool/pgu_override.py
# class Quitbutton(Button):
#     def __init__(self, app, text):
#         Button.__init__(self, text, width=300, height=40)
#         try:
#             self.connect(CLICK, app.quit, None)
#         except AttributeError:
#             self.connect(CLICK, app.close, None)
# 
# Path: omnitool/shared.py



# Path: plugins/worldify.py
import sys
import os
import pygame
import tempfile
import colorsys
import io
            import traceback
        import time
from random import randint
from time import sleep
from pgu import gui
from omnitool.colorlib import data, bad
from omnitool.database import multitiles, names
from omnitool.tlib import *
from omnitool.pgu_override import Quitbutton
from omnitool.shared import lang, theme, exit_prog, exit_prog, __version__
            from plugins.worldify_lib import jsonparse

                print("No Image supplied, please drag and drop an image onto the program")
                sleep(3)
                sys.exit(1000)
            else:

                app = gui.Desktop(theme=theme)
                app.connect(gui.QUIT, exit_prog, None)
                app.connect(gui.CLOSE, exit_prog, None)
                main = gui.dialog.FileDialog()
                main.connect(gui.CLOSE, app.quit, main)
                main.connect(gui.CHANGE, app.quit, main)
                main.open()
                app.run(main)
                pygame.display.quit()
                imagepath = main.value
        else:
            imagepath = sys.argv[1]


        local = os.listdir(os.getcwd())
        if "db.txt" in local:
            print("Found external database, starting parsing..")

            jsonparse.load()
            print("Database injection successful")
            ext = True
        else:
            ext = False
        pygame.display.init()
        pygame.display.set_caption("Worldify")

        colors = data