From be484767c5a9da59e40ec8af69f4b1756afe0854 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sat, 3 Mar 2018 00:41:14 +0100 Subject: [PATCH] Move code into grzegorz_clients folder in preperation of making this into a pytohn module --- grzegorz_clients/__init__.py | 2 ++ api.py => grzegorz_clients/api.py | 2 +- gui.py => grzegorz_clients/gui.py | 5 ++--- utils.py => grzegorz_clients/utils.py | 0 main.py | 6 +++--- 5 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 grzegorz_clients/__init__.py rename api.py => grzegorz_clients/api.py (99%) rename gui.py => grzegorz_clients/gui.py (98%) rename utils.py => grzegorz_clients/utils.py (100%) diff --git a/grzegorz_clients/__init__.py b/grzegorz_clients/__init__.py new file mode 100644 index 0000000..2ebbd0c --- /dev/null +++ b/grzegorz_clients/__init__.py @@ -0,0 +1,2 @@ +from . import api +from . import gui diff --git a/api.py b/grzegorz_clients/api.py similarity index 99% rename from api.py rename to grzegorz_clients/api.py index a955b62..c60120f 100644 --- a/api.py +++ b/grzegorz_clients/api.py @@ -1,7 +1,7 @@ import requests, json from urllib.parse import urlencode from functools import wraps -import api +from . import api # This must be set to be able to use it on remote hosts BASE_URL = "http://localhost:8080/api" diff --git a/gui.py b/grzegorz_clients/gui.py similarity index 98% rename from gui.py rename to grzegorz_clients/gui.py index 70c0648..75b962b 100644 --- a/gui.py +++ b/grzegorz_clients/gui.py @@ -2,9 +2,8 @@ import random, os, time, shutil, sys from threading import Timer import remi.gui as gui from remi import App -from utils import Namespace, call_as_thread, get_youtube_metadata - -import api +from .utils import Namespace, call_as_thread, get_youtube_metadata +from . import api #globals: COLOR_BLUE = "rgb(33, 150, 243)" diff --git a/utils.py b/grzegorz_clients/utils.py similarity index 100% rename from utils.py rename to grzegorz_clients/utils.py diff --git a/main.py b/main.py index d654fb9..5a9fca3 100755 --- a/main.py +++ b/main.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -from remi import start import os -import api -import gui +from remi import start +from grzegorz_clients import api, gui + # config must be a object with the attributes seen in default_config.py: def main(config):