From 886c5740e5b9c550d407126ade7145bdfddcbc51 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 18 Jun 2020 15:34:39 +0100 Subject: [PATCH 01/14] Changes CAPI CLIENT_ID to one under Athanasius' Frontier account --- companion.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/companion.py b/companion.py index 3dab1ab6..38debd11 100644 --- a/companion.py +++ b/companion.py @@ -23,7 +23,9 @@ holdoff = 60 # be nice timeout = 10 # requests timeout auth_timeout = 30 # timeout for initial auth -CLIENT_ID = os.getenv('CLIENT_ID') or '227cd239-ab8c-4728-9d3c-d8f588f247bd' # Obtain from https://auth.frontierstore.net/client/signup +# Currently the "Elite Dangerous Market Connector (EDCD/Athanasius)" one in +# Athanasius' Frontier account +CLIENT_ID = os.getenv('CLIENT_ID') or 'fb88d428-9110-475f-a3d2-dc151c2b9c7a' # Obtain from https://auth.frontierstore.net/client/signup SERVER_AUTH = 'https://auth.frontierstore.net' URL_AUTH = '/auth' URL_TOKEN = '/token' From 6e72806bb77da1559a89a4565dfe6f66f824be1a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 18 Jun 2020 15:38:34 +0100 Subject: [PATCH 02/14] Merge coriolis-data from upstream after fresh pull --- coriolis-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coriolis-data b/coriolis-data index cee78b31..bb1e5ba8 160000 --- a/coriolis-data +++ b/coriolis-data @@ -1 +1 @@ -Subproject commit cee78b312a862df6b8ef9c1eff077108f24a0b9e +Subproject commit bb1e5ba89acb940465714363b12c250ba399b5b9 From 690ef067b07581e79a8714bf8ab4b129941931af Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Fri, 24 Apr 2020 15:41:25 +0200 Subject: [PATCH 03/14] keep track of system location if fleet carrier jumps while docked --- monitor.py | 4 ++-- plugins/eddn.py | 4 ++-- plugins/edsm.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/monitor.py b/monitor.py index 78ced29c..2d223b7b 100644 --- a/monitor.py +++ b/monitor.py @@ -431,8 +431,8 @@ class EDLogs(FileSystemEventHandler): self.station = None self.stationtype = None self.stationservices = None - elif entry['event'] in ['Location', 'FSDJump', 'Docked']: - if entry['event'] == 'Location': + elif entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']: + if entry['event'] in ('Location', 'CarrierJump'): self.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None elif entry['event'] == 'FSDJump': self.planet = None diff --git a/plugins/eddn.py b/plugins/eddn.py index 17170ae1..83a3a4d2 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -396,8 +396,8 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): return filtered # Track location - if entry['event'] in ['Location', 'FSDJump', 'Docked']: - if entry['event'] == 'Location': + if entry['event'] in ['Location', 'FSDJump', 'Docked', 'CarrierJump']: + if entry['event'] in ('Location', 'CarrierJump'): this.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None elif entry['event'] == 'FSDJump': this.planet = None diff --git a/plugins/edsm.py b/plugins/edsm.py index f0ac9780..c055aea0 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -298,7 +298,7 @@ def worker(): plug.show_error(_('Error: EDSM {MSG}').format(MSG=msg)) else: for e, r in zip(pending, reply['events']): - if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump']: + if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump', 'CarrierJump']: # Update main window's system status this.lastlookup = r this.system.event_generate('<>', when="tail") # calls update_status in main thread @@ -345,13 +345,13 @@ def should_send(entries): return False -# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event +# Call edsm_notify_system() in this and other interested plugins with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event def update_status(event=None): for plugin in plug.provides('edsm_notify_system'): plug.invoke(plugin, None, 'edsm_notify_system', this.lastlookup) -# Called with EDSM's response to a 'StartUp', 'Location' or 'FSDJump' event. https://www.edsm.net/en/api-journal-v1 +# Called with EDSM's response to a 'StartUp', 'Location', 'FSDJump' or 'CarrierJump' event. https://www.edsm.net/en/api-journal-v1 # msgnum: 1xx = OK, 2xx = fatal error, 3xx = error, 4xx = ignorable errors. def edsm_notify_system(reply): if not reply: From 8db229585d81799d148b8895e99b331991671607 Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Fri, 24 Apr 2020 15:42:14 +0200 Subject: [PATCH 04/14] send 'CarrierJump' event to EDDN --- plugins/eddn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index 83a3a4d2..faab12f6 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -413,7 +413,7 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): # Send interesting events to EDDN, but not when on a crew if (config.getint('output') & config.OUT_SYS_EDDN and not state['Captain'] and - (entry['event'] in ('Location', 'FSDJump', 'Docked', 'Scan', 'SAASignalsFound')) and + (entry['event'] in ('Location', 'FSDJump', 'Docked', 'Scan', 'SAASignalsFound', 'CarrierJump')) and ('StarPos' in entry or this.coordinates)): # strip out properties disallowed by the schema for thing in ['ActiveFine', 'CockpitBreach', 'BoostUsed', 'FuelLevel', 'FuelUsed', 'JumpDist', 'Latitude', 'Longitude', 'Wanted']: From b45df6b4fde2155d13818e04302766c3cd769af8 Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Sat, 2 May 2020 14:52:41 +0200 Subject: [PATCH 05/14] keep track of location if the carrier you're docked at jumps --- plugins/inara.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/inara.py b/plugins/inara.py index 1be99c52..35330bee 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -377,6 +377,18 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): ('minorfactionReputation', f['MyReputation']/100.0), ]) for f in entry['Factions'] ]) + elif entry['event'] == 'CarrierJump': + # There is no (add|set)CommanderTravelCarrierJump() yet + # Use setCommanderTravelLocation() for now because it's like an 'Location' event + this.system = None + add_event('setCommanderTravelLocation', entry['timestamp'], + OrderedDict([ + ('starsystemName', entry['StarSystem']), + ('stationName', entry['StationName']), + ('marketID', entry['MarketID']), + ])) + # Ignore the following 'Docked' event + this.suppress_docked = True # Override standard URL functions if config.get('system_provider') == 'Inara': From 02649b8c6ffc6e59667835809dfd737c87420879 Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Sat, 2 May 2020 15:02:09 +0200 Subject: [PATCH 06/14] there is also a 'Factions' list in the 'CarrierJump' event --- plugins/inara.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/inara.py b/plugins/inara.py index 35330bee..0085c848 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -387,6 +387,14 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): ('stationName', entry['StationName']), ('marketID', entry['MarketID']), ])) + if entry.get('Factions'): + add_event('setCommanderReputationMinorFaction', entry['timestamp'], + [ + OrderedDict([ + ('minorfactionName', f['Name']), + ('minorfactionReputation', f['MyReputation']/100.0), + ]) for f in entry['Factions'] + ]) # Ignore the following 'Docked' event this.suppress_docked = True From 098613ea0aa4e07af9341463b5f7b7b76facf3ba Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Fri, 29 May 2020 16:13:39 +0200 Subject: [PATCH 07/14] There is now an api event for 'CarrierJump' -> 'addCommanderTravelCarrierJump' --- plugins/inara.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/inara.py b/plugins/inara.py index 0085c848..7a576b00 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -378,14 +378,12 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): ]) for f in entry['Factions'] ]) elif entry['event'] == 'CarrierJump': - # There is no (add|set)CommanderTravelCarrierJump() yet - # Use setCommanderTravelLocation() for now because it's like an 'Location' event this.system = None - add_event('setCommanderTravelLocation', entry['timestamp'], + add_event('addCommanderTravelCarrierJump', entry['timestamp'], OrderedDict([ ('starsystemName', entry['StarSystem']), - ('stationName', entry['StationName']), - ('marketID', entry['MarketID']), + ('shipType', state['ShipType']), + ('shipGameID', state['ShipID']), ])) if entry.get('Factions'): add_event('setCommanderReputationMinorFaction', entry['timestamp'], @@ -846,7 +844,7 @@ def worker(): print 'Inara\t%s %s\t%s' % (reply_event['eventStatus'], reply_event.get('eventStatusText', ''), json.dumps(data_event)) if reply_event['eventStatus'] // 100 != 2: plug.show_error(_('Error: Inara {MSG}').format(MSG = '%s, %s' % (data_event['eventName'], reply_event.get('eventStatusText', reply_event['eventStatus'])))) - if data_event['eventName'] in ['addCommanderTravelDock', 'addCommanderTravelFSDJump', 'setCommanderTravelLocation']: + if data_event['eventName'] in ['addCommanderTravelCarrierJump', 'addCommanderTravelDock', 'addCommanderTravelFSDJump', 'setCommanderTravelLocation']: this.lastlocation = reply_event.get('eventData', {}) this.system_link.event_generate('<>', when="tail") # calls update_location in main thread elif data_event['eventName'] in ['addCommanderShip', 'setCommanderShip']: From 38ba48c713aa430717965ed188a7b74fc1250bf4 Mon Sep 17 00:00:00 2001 From: Bernd Gollesch Date: Sun, 14 Jun 2020 17:58:45 +0200 Subject: [PATCH 08/14] added carrier data to CarrierJump event --- plugins/inara.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/inara.py b/plugins/inara.py index 7a576b00..ac643cd1 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -382,6 +382,8 @@ def journal_entry(cmdr, is_beta, system, station, entry, state): add_event('addCommanderTravelCarrierJump', entry['timestamp'], OrderedDict([ ('starsystemName', entry['StarSystem']), + ('stationName', entry['StationName']), + ('marketID', entry['MarketID']), ('shipType', state['ShipType']), ('shipGameID', state['ShipID']), ])) From 2aa5154a1ad0f1528cdff8294318ff6e163690bd Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 18 Jun 2020 18:26:20 +0100 Subject: [PATCH 09/14] config: Bump version to 3.4.6.0 so it shows up in testing As the new Fleet Carrier code needs testing we need to be able to filter down to our test messages if needs be. --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 1e6c47fd..b9f9a638 100644 --- a/config.py +++ b/config.py @@ -8,7 +8,7 @@ from sys import platform appname = 'EDMarketConnector' applongname = 'E:D Market Connector' appcmdname = 'EDMC' -appversion = '3.4.4.0' +appversion = '3.4.6.0' update_feed = 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases/edmarketconnector.xml' update_interval = 47*60*60 From d3abb6fa1f75dddb2fb34f1bc812f7224481a4e1 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 18 Jun 2020 19:40:46 +0100 Subject: [PATCH 10/14] Detect plugins without Python 3.x support and warn user. To allow users to sort out their plugins before EDMC itself moves to Python 3.x warn them if any of their enabled, non-stock, plugins do not have a plugin_start3() method. * If any are found without support there's a popup triggered at the end of AppWindow initialisation. * Then the user can check Settings > Plugins to see a list of the plugins without Python 3.x support. --- EDMarketConnector.py | 7 +++++++ plug.py | 9 +++++++++ prefs.py | 12 ++++++++++++ 3 files changed, 28 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 36898f3f..cee1a52a 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -299,6 +299,13 @@ class AppWindow: self.postprefs(False) # Companion login happens in callback from monitor + if len(plug.PLUGINS_not_py3): + import tkMessageBox + tkMessageBox.showinfo('Plugins Without Python 3.x Support', + "One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the 'Plugins' tab of 'File' > 'Settings'. You should check if there is an updated version available, else alert the developer that they will need to update the code when EDMC moves to Python 3.x" + ) + + # callback after the Preferences dialog is applied def postprefs(self, dologin=True): self.prefsdialog = None diff --git a/plug.py b/plug.py index e6b0e87d..0577c607 100644 --- a/plug.py +++ b/plug.py @@ -65,6 +65,7 @@ GuiFocusCodex = 11 # List of loaded Plugins PLUGINS = [] +PLUGINS_not_py3 = [] # For asynchronous error display last_error = { @@ -195,6 +196,14 @@ def load_plugins(master): print_exc() PLUGINS.extend(sorted(found, key = lambda p: operator.attrgetter('name')(p).lower())) + ######################################################### + # Detect plugins that aren't yet ready for Python 3.x + ######################################################### + for p in PLUGINS: + if p.module and p.folder and not p._get_func('plugin_start3'): + PLUGINS_not_py3.append(p) + ######################################################### + imp.release_lock() def provides(fn_name): diff --git a/prefs.py b/prefs.py index 5096d194..3a5024c8 100644 --- a/prefs.py +++ b/prefs.py @@ -273,6 +273,18 @@ class PreferencesDialog(tk.Toplevel): label = nb.Label(plugsframe, text='%s (%s)' % (plugin.folder, plugin.name)) label.grid(columnspan=2, padx=PADX*2, sticky=tk.W) + ############################################################ + # Show which plugins don't have Python 3.x support + ############################################################ + if len(plug.PLUGINS_not_py3): + ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW) + nb.Label(plugsframe, text=_('Plugins Without Python 3.x Support')+':').grid(padx=PADX, sticky=tk.W) # List of plugins in settings + for plugin in plug.PLUGINS_not_py3: + if plugin.folder: # 'system' ones have this set to None to suppress listing in Plugins prefs tab + nb.Label(plugsframe, text=plugin.name).grid(columnspan=2, padx=PADX*2, sticky=tk.W) + + ############################################################ + disabled_plugins = [x for x in plug.PLUGINS if x.folder and not x.module] if len(disabled_plugins): ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW) From 9c285a79e70ed7049d421a9f291d1ff651a6e4cf Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 19 Jun 2020 07:29:17 +0100 Subject: [PATCH 11/14] config: Change update_interval to 8 hours --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index b9f9a638..95455bc5 100644 --- a/config.py +++ b/config.py @@ -11,7 +11,7 @@ appcmdname = 'EDMC' appversion = '3.4.6.0' update_feed = 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases/edmarketconnector.xml' -update_interval = 47*60*60 +update_interval = 8*60*60 if platform=='darwin': From 670842e8f6712f2da722fecbbdea305879291d7d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 19 Jun 2020 19:43:12 +0100 Subject: [PATCH 12/14] Adds link to plugin migration guide to Settings > Plugins --- prefs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prefs.py b/prefs.py index 3a5024c8..c1d7e1cc 100644 --- a/prefs.py +++ b/prefs.py @@ -278,10 +278,12 @@ class PreferencesDialog(tk.Toplevel): ############################################################ if len(plug.PLUGINS_not_py3): ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW) - nb.Label(plugsframe, text=_('Plugins Without Python 3.x Support')+':').grid(padx=PADX, sticky=tk.W) # List of plugins in settings + nb.Label(plugsframe, text=_('Plugins Without Python 3.x Support:')+':').grid(padx=PADX, sticky=tk.W) for plugin in plug.PLUGINS_not_py3: if plugin.folder: # 'system' ones have this set to None to suppress listing in Plugins prefs tab nb.Label(plugsframe, text=plugin.name).grid(columnspan=2, padx=PADX*2, sticky=tk.W) + HyperlinkLabel(plugsframe, text=_('Information on migrating plugins'), background=nb.Label().cget('background'), url='https://github.com/EDCD/EDMarketConnector/blob/master/PLUGINS.md#migration-to-python-37', underline=True).grid(columnspan=2, padx=PADX, sticky=tk.W) + ############################################################ From aa8df90e555004d30c6602b4f3571b59ec10311f Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 20 Jun 2020 14:29:00 +0100 Subject: [PATCH 13/14] Only warn once in 24 hours about plugins not ready for python 3.x --- EDMarketConnector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index cee1a52a..4b599d68 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -299,11 +299,13 @@ class AppWindow: self.postprefs(False) # Companion login happens in callback from monitor - if len(plug.PLUGINS_not_py3): + plugins_not_py3_last = config.getint('plugins_not_py3_last') or int(time()) + if (plugins_not_py3_last + 86400) < int(time()) and len(plug.PLUGINS_not_py3): import tkMessageBox tkMessageBox.showinfo('Plugins Without Python 3.x Support', "One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the 'Plugins' tab of 'File' > 'Settings'. You should check if there is an updated version available, else alert the developer that they will need to update the code when EDMC moves to Python 3.x" ) + config.set('plugins_not_py3_last', int(time())) # callback after the Preferences dialog is applied From 4d5fa590af9d3a77eac6b97de597de9dd18584b9 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 20 Jun 2020 20:46:05 +0100 Subject: [PATCH 14/14] New option to NOT check for app updates automatically if in-game. * Stores disable_autoappupdatecheckingame in settings. * If 'disable' is active then once you're in-game WinSparkle auto check for updates is disabled. * Whatever the state of the option WinSparkle auto updates are (re-)enabled when you exit the game to Main Menu or fully. * Using 'Help' > 'Check for updates' manually will still always work. It has been difficult to test the code fully because it isn't easy to get WinSparkle's registry data about last update check time set just right to not check immediately, but to do so some reasonable time after you're in-game and have confirmed the new option setting isn't easy. Worst case people won't learn about an update until the next time they run EDMC. --- EDMarketConnector.py | 10 ++++++++++ prefs.py | 12 ++++++++++++ update.py | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 4b599d68..85746985 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -583,6 +583,10 @@ class AppWindow: return # Startup or in CQC if entry['event'] in ['StartUp', 'LoadGame'] and monitor.started: + # Disable WinSparkle automatic update checks, IFF configured to do so when in-game + if config.getint('disable_autoappupdatecheckingame') and 1: + self.updater.setAutomaticUpdatesCheck(False) + print 'Monitor: Disable WinSparkle automatic update checks' # Can start dashboard monitoring if not dashboard.start(self.w, monitor.started): print "Can't start Status monitoring" @@ -602,6 +606,12 @@ class AppWindow: if entry['event'] in ['StartUp', 'Location', 'Docked'] and monitor.station and not config.getint('output') & config.OUT_MKT_MANUAL and config.getint('output') & config.OUT_STATION_ANY and companion.session.state != companion.Session.STATE_AUTH: self.w.after(int(SERVER_RETRY * 1000), self.getandsend) + if entry['event'] == 'ShutDown': + # Enable WinSparkle automatic update checks + # NB: Do this blindly, in case option got changed whilst in-game + self.updater.setAutomaticUpdatesCheck(True) + print 'Monitor: Enable WinSparkle automatic update checks' + # cAPI auth def auth(self, event=None): try: diff --git a/prefs.py b/prefs.py index c1d7e1cc..94a8628e 100644 --- a/prefs.py +++ b/prefs.py @@ -184,6 +184,13 @@ class PreferencesDialog(tk.Toplevel): self.hotkey_play_btn = nb.Checkbutton(configframe, text=_('Play sound'), variable=self.hotkey_play, state = self.hotkey_code and tk.NORMAL or tk.DISABLED) # Hotkey/Shortcut setting self.hotkey_play_btn.grid(columnspan=4, padx=PADX, sticky=tk.W) + # Option to disabled Automatic Check For Updates whilst in-game + ttk.Separator(configframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY*4, sticky=tk.EW) + self.disable_autoappupdatecheckingame = tk.IntVar(value = config.getint('disable_autoappupdatecheckingame')) + self.disable_autoappupdatecheckingame_btn = nb.Checkbutton(configframe, text=_('Disable Automatic Application Updates Check when in-game'), variable=self.disable_autoappupdatecheckingame, command=self.disable_autoappupdatecheckingame_changed) + self.disable_autoappupdatecheckingame_btn.grid(columnspan=4, padx=PADX, sticky=tk.W) + + ttk.Separator(configframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY*4, sticky=tk.EW) nb.Label(configframe, text=_('Preferred websites')).grid(row=30, columnspan=4, padx=PADX, sticky=tk.W) # Settings prompt for preferred ship loadout, system and station info websites @@ -433,6 +440,11 @@ class PreferencesDialog(tk.Toplevel): self.logdir.set(config.default_journal_dir) self.outvarchanged() + def disable_autoappupdatecheckingame_changed(self): + config.set('disable_autoappupdatecheckingame', self.disable_autoappupdatecheckingame.get()) + # If it's now False, re-enable WinSparkle ? Need access to the AppWindow.updater variable to call down + + def themecolorbrowse(self, index): (rgb, color) = tkColorChooser.askcolor(self.theme_colors[index], title=self.theme_prompts[index], parent=self.parent) if color: diff --git a/update.py b/update.py index 1cbf187a..ef58b68a 100644 --- a/update.py +++ b/update.py @@ -19,6 +19,9 @@ if not getattr(sys, 'frozen', False): def __init__(self, master): self.root = master + def setAutomaticUpdatesCheck(self, onoroff): + return + def checkForUpdates(self): thread = threading.Thread(target = self.worker, name = 'update worker') thread.daemon = True @@ -56,6 +59,10 @@ elif sys.platform=='darwin': # can't load framework - not frozen or not included in app bundle? self.updater = None + def setAutomaticUpdatesCheck(self, onoroff): + if self.updater: + self.updater.win_sparkle_set_automatic_check_for_updates(onoroff) + def checkForUpdates(self): if self.updater: self.updater.checkForUpdates_(None) @@ -98,6 +105,10 @@ elif sys.platform=='win32': print_exc() self.updater = None + def setAutomaticUpdatesCheck(self, onoroff): + if self.updater: + self.updater.win_sparkle_set_automatic_check_for_updates(onoroff) + def checkForUpdates(self): if self.updater: self.updater.win_sparkle_check_update_with_ui()