diff --git a/_constants.py b/_constants.py index d9a62cc..65a573e 100644 --- a/_constants.py +++ b/_constants.py @@ -1,4 +1,4 @@ -VERSION = "1.5.1" -BUILD_DATE = "2018-09-15T13:18:39.248598" +VERSION = "1.5.2" +BUILD_DATE = "2018-09-17T12:50:39.163864" AUTHOR = "Sawyer McLane" -DEBUGGING = False \ No newline at end of file +DEBUGGING = True diff --git a/debug.spec b/debug.spec index 91fc15a..89e29d2 100644 --- a/debug.spec +++ b/debug.spec @@ -3,7 +3,7 @@ import datetime bd = datetime.datetime.now().isoformat() auth = "Sawyer McLane" -vers = "1.5.1" +vers = "1.5.2" is_debug = True # Write version info into _constants.py resource file @@ -26,7 +26,7 @@ with open('default.ini', 'w') as f: block_cipher = None -a = Analysis(['gui.pyw', 'color_thread.py', 'audio.py', 'settings.py', 'SysTrayIcon.py', 'utils.py', '_constants.py', 'splashscreen.py'], +a = Analysis(['gui.pyw', 'utilities//color_thread.py', 'utilities//audio.py', 'ui//settings.py', 'ui//SysTrayIcon.py', 'utilities//utils.py', '_constants.py', 'ui//splashscreen.py'], pathex=['\\.'], binaries=[], datas=[], diff --git a/default.ini b/default.ini index 243805b..7f136b1 100644 --- a/default.ini +++ b/default.ini @@ -8,6 +8,6 @@ defaultmonitor = get_primary_monitor() # Used for diagnostic purposes. Please do not change. [Info] -version = 1.5.1 +version = 1.5.2 author = Sawyer McLane -builddate = 2018-09-15T13:18:39.248598 +builddate = 2018-09-17T12:50:39.163864 diff --git a/demo.spec b/demo.spec index f90ec45..f6e95c9 100644 --- a/demo.spec +++ b/demo.spec @@ -3,7 +3,7 @@ import datetime bd = datetime.datetime.now().isoformat() auth = "Sawyer McLane" -vers = "1.5.1" +vers = "1.5.2" is_debug = True # Write version info into _constants.py resource file @@ -13,7 +13,7 @@ with open('_constants.py', 'w') as f: f.write("AUTHOR = \"{}\"\n".format(auth)) f.write("DEBUGGING = {}".format(str(is_debug))) -# Write version info into default config file +# Write version info into default config file/ with open('default.ini', 'r') as f: initdata = f.readlines() initdata[-1] = "builddate = {}\n".format(bd) @@ -25,7 +25,7 @@ with open('default.ini', 'w') as f: block_cipher = None -a = Analysis(['dummy_devices.py', 'gui.pyw', 'color_thread.py', 'audio.py', 'settings.py', 'SysTrayIcon.py', 'utils.py', '_constants.py', 'splashscreen.py'], +a = Analysis(['tests//dummy_devices.py', 'gui.pyw', 'utilities//color_thread.py', 'utilities//audio.py', 'ui//settings.py', 'ui//SysTrayIcon.py', 'utilities//utils.py', '_constants.py', 'ui//splashscreen.py'], pathex=['\\.'], binaries=[], datas=[], diff --git a/gui.pyw b/gui.pyw index ef7f11f..c6d73e8 100644 --- a/gui.pyw +++ b/gui.pyw @@ -12,16 +12,14 @@ from PIL import Image as pImage from lifxlan import * from lifxlan import errors -import SysTrayIcon -import audio -import color_thread -import settings +from ui import SysTrayIcon, settings +from utilities import audio, color_thread from _constants import * -from colorscale import ColorScale -from keypress import Keystroke_Watcher -from settings import config -from splashscreen import Splash -from utils import * +from ui.colorscale import ColorScale +from utilities.keypress import Keystroke_Watcher +from ui.settings import config +from ui.splashscreen import Splash +from utilities.utils import * HEARTBEAT_RATE = 3000 # 3 seconds LOGFILE = 'lifx-control-panel.log' @@ -144,9 +142,12 @@ class LifxFrame(ttk.Frame): # Setup tray icon tray_options = (('Adjust Lights', None, lambda *_: self.master.deiconify()),) + def lambda_factory(self): + return lambda *_: self.on_closing() + def run_tray_icon(): SysTrayIcon.SysTrayIcon(resource_path('res/icon_vector_9fv_icon.ico'), "LIFX-Control-Panel", tray_options, - on_quit=lambda *_: self.on_closing) + on_quit=lambda_factory(self)) self.systray_thread = threading.Thread(target=run_tray_icon, daemon=True) self.systray_thread.start() diff --git a/main.spec b/main.spec index 8bb1a34..2a1b2c0 100644 --- a/main.spec +++ b/main.spec @@ -3,7 +3,7 @@ import datetime bd = datetime.datetime.now().isoformat() auth = "Sawyer McLane" -vers = "1.5.1" +vers = "1.5.2" is_debug = False # Write version info into _constants.py resource file @@ -26,7 +26,7 @@ with open('default.ini', 'w') as f: block_cipher = None -a = Analysis(['gui.pyw', 'color_thread.py', 'audio.py', 'settings.py', 'SysTrayIcon.py', 'utils.py', '_constants.py', 'splashscreen.py'], +a = Analysis(['gui.pyw', 'utilities//color_thread.py', 'utilities//audio.py', 'ui//settings.py', 'ui//SysTrayIcon.py', 'utilities//utils.py', '_constants.py', 'ui//splashscreen.py'], pathex=['\\.'], binaries=[], datas=[], diff --git a/dummy_devices.py b/tests/dummy_devices.py similarity index 99% rename from dummy_devices.py rename to tests/dummy_devices.py index 919b425..abad7bb 100644 --- a/dummy_devices.py +++ b/tests/dummy_devices.py @@ -10,7 +10,7 @@ from lifxlan import product_map, Group from gui import Color as DummyColor -from utils import resource_path +from utilities.utils import resource_path LOGFILE = 'lifx-control-panel.log' diff --git a/tests.py b/tests/tests.py similarity index 98% rename from tests.py rename to tests/tests.py index 4ccafa5..3ccc7e6 100644 --- a/tests.py +++ b/tests/tests.py @@ -1,5 +1,5 @@ import unittest -from dummy_devices import * +from tests.dummy_devices import * from gui import Color import random import string diff --git a/SysTrayIcon.py b/ui/SysTrayIcon.py similarity index 100% rename from SysTrayIcon.py rename to ui/SysTrayIcon.py diff --git a/ui/__init__.py b/ui/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/colorscale.py b/ui/colorscale.py similarity index 98% rename from colorscale.py rename to ui/colorscale.py index 192e274..d8ae8e9 100644 --- a/colorscale.py +++ b/ui/colorscale.py @@ -1,6 +1,6 @@ import tkinter as tk -from utils import tuple2hex, HueToRGB, KelvinToRGB +from utilities.utils import tuple2hex, HueToRGB, KelvinToRGB class ColorScale(tk.Canvas): diff --git a/settings.py b/ui/settings.py similarity index 99% rename from settings.py rename to ui/settings.py index 9ae8368..99c5907 100644 --- a/settings.py +++ b/ui/settings.py @@ -11,8 +11,8 @@ from lifxlan import * from lifxlan.utils import RGBtoHSBK -from utils import resource_path -from keypress import Keystroke_Watcher +from utilities.utils import resource_path +from utilities.keypress import Keystroke_Watcher from _constants import * config = configparser.ConfigParser() diff --git a/splashscreen.py b/ui/splashscreen.py similarity index 100% rename from splashscreen.py rename to ui/splashscreen.py diff --git a/utilities/__init__.py b/utilities/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/audio.py b/utilities/audio.py similarity index 100% rename from audio.py rename to utilities/audio.py diff --git a/color_thread.py b/utilities/color_thread.py similarity index 97% rename from color_thread.py rename to utilities/color_thread.py index 71cd875..809eee2 100644 --- a/color_thread.py +++ b/utilities/color_thread.py @@ -7,10 +7,9 @@ from PIL import Image from desktopmagic.screengrab_win32 import * -from lifxlan import LifxLAN, utils +from lifxlan import utils -from utils import get_primary_monitor -from settings import config +from ui.settings import config def avg_screen_color(initial_color): diff --git a/keypress.py b/utilities/keypress.py similarity index 100% rename from keypress.py rename to utilities/keypress.py diff --git a/utils.py b/utilities/utils.py similarity index 100% rename from utils.py rename to utilities/utils.py