mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-17 21:56:07 -04:00
The next generation branch has been added
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
# -- coding: utf-8 -*-
|
||||
from wx.lib.newevent import NewEvent
|
||||
import wx
|
||||
EVT_DELETED = wx.NewEventType()
|
||||
MyEVT_DELETED = wx.PyEventBinder(EVT_DELETED, 1)
|
||||
EVT_STARTED = wx.NewEventType()
|
||||
MyEVT_STARTED = wx.PyEventBinder(EVT_STARTED, 1)
|
||||
EVT_OBJECT = wx.NewEventType()
|
||||
MyEVT_OBJECT = wx.PyEventBinder(EVT_OBJECT, 1)
|
||||
|
||||
ResultEvent, EVT_RESULT = NewEvent()
|
||||
#DeletedEvent, EVT_DELETED = NewEvent()
|
||||
|
||||
class event(wx.PyCommandEvent):
|
||||
def __init__(self, evtType, id):
|
||||
self.text = ""
|
||||
wx.PyCommandEvent.__init__(self, evtType, id)
|
||||
|
||||
def SetItem(self, item):
|
||||
self.item = item
|
||||
|
||||
def GetItem(self):
|
||||
return self.item
|
||||
|
||||
def SetAnnounce(self, text ):
|
||||
self.text = text
|
||||
|
||||
def GetAnnounce(self):
|
||||
try: return self.text
|
||||
except: pass
|
||||
|
||||
class infoEvent(event):
|
||||
def __init__(self, evtType, id):
|
||||
event.__init__(self, evtType, id)
|
||||
|
||||
def SetItem(self, page, items):
|
||||
self.page = page
|
||||
self.items = items
|
||||
|
||||
def GetItem(self):
|
||||
return [self.page, self.items]
|
@@ -1,38 +0,0 @@
|
||||
import platform
|
||||
import os
|
||||
import sys
|
||||
|
||||
from functools import wraps
|
||||
|
||||
def merge_paths(func):
|
||||
@wraps(func)
|
||||
def merge_paths_wrapper(*a):
|
||||
return unicode(os.path.join(func(), *a))
|
||||
return merge_paths_wrapper
|
||||
|
||||
@merge_paths
|
||||
def app_path():
|
||||
if hasattr(sys, "frozen"):
|
||||
from win32api import GetModuleFileName #We should only be here if using py2exe hence windows
|
||||
app_path = os.path.dirname(GetModuleFileName(0))
|
||||
else:
|
||||
app_path = os.path.normpath(os.path.dirname(__file__))
|
||||
return app_path
|
||||
|
||||
@merge_paths
|
||||
def config_path():
|
||||
path = app_path(u"config")
|
||||
if not os.path.exists(path):
|
||||
os.mkdir(path)
|
||||
return path
|
||||
|
||||
@merge_paths
|
||||
def data_path(app_name='Blu JM'):
|
||||
# if platform.system() == "Windows":
|
||||
# import shlobj
|
||||
# data_path = os.path.join(shlobj.SHGetFolderPath(0, shlobj.CSIDL_APPDATA), app_name)
|
||||
# else:
|
||||
data_path = os.path.join(os.environ['HOME'], ".%s" % app_name)
|
||||
if not os.path.exists(data_path):
|
||||
os.mkdir(data_path)
|
||||
return data_path
|
@@ -27,8 +27,8 @@ class RepeatingTimer(threading.Thread):
|
||||
while not self.finished.is_set():
|
||||
self.finished.wait(self.interval)
|
||||
if not self.finished.is_set(): #In case someone has canceled while waiting
|
||||
try:
|
||||
self.function(*self.args, **self.kwargs)
|
||||
except:
|
||||
pass
|
||||
# try:
|
||||
self.function(*self.args, **self.kwargs)
|
||||
# except:
|
||||
# pass
|
||||
# logging.exception("Execution failed. Function: %r args: %r and kwargs: %r" % (self.function, self.args, self.kwargs))
|
||||
|
Reference in New Issue
Block a user