Skip to content

Commit 85de899

Browse files
committed
Insignificant revisions.
1 parent 253cd82 commit 85de899

File tree

4 files changed

+44
-43
lines changed

4 files changed

+44
-43
lines changed

_changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
v0.7.33
22
- Further improves maintenance of legacy props in all chart devices.
3-
- Moves maintenance tasks to module.
3+
- Moves maintenance tasks to separate module.
44

55
v0.7.32
66
- Further improves maintenance of legacy props in all chart devices.

matplotlib.indigoPlugin/Contents/Server Plugin/DLFramework/DLFramework.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,43 @@ def pluginEnvironment(self):
3636
The pluginEnvironment method prints selected information about the
3737
pluginEnvironment that the plugin is running in. It pulls some of this
3838
information from the calling plugin and some from the server
39-
pluginEnvironment.
39+
pluginEnvironment. It uses the legacy "indigo.server.log" method to
40+
write to the log.
4041
"""
4142
self.plugin.debugLog(u"DLFramework pluginEnvironment method called.")
4243

4344
indigo.server.log(u"")
44-
indigo.server.log(u"{0:=^130}".format(" Initializing New Plugin Session "))
45+
indigo.server.log(u"{0:{1}^135}".format(" Initializing New Plugin Session ", "="))
4546
indigo.server.log(u"{0:<31} {1}".format("Plugin name:", self.plugin.pluginDisplayName))
4647
indigo.server.log(u"{0:<31} {1}".format("Plugin version:", self.plugin.pluginVersion))
4748
indigo.server.log(u"{0:<31} {1}".format("Plugin ID:", self.plugin.pluginId))
4849
indigo.server.log(u"{0:<31} {1}".format("Indigo version:", indigo.server.version))
4950
indigo.server.log(u"{0:<31} {1}".format("Python version:", sys.version.replace('\n', '')))
5051
indigo.server.log(u"{0:<31} {1}".format("Mac OS Version:", platform.mac_ver()[0]))
5152
indigo.server.log(u"{0:<31} {1}".format("Process ID:", os.getpid()))
52-
indigo.server.log(u"{0:=^130}".format(""))
53+
indigo.server.log(u"{0:{1}^135}".format("", "="))
5354

5455
def pluginEnvironmentLogger(self):
5556
"""
56-
The pluginEnvironment method prints selected information about the
57-
pluginEnvironment that the plugin is running in. It pulls some of this
58-
information from the calling plugin and some from the server
59-
pluginEnvironment. This method differs from the pluginEnvironment
57+
The pluginEnvironmentLogger method prints selected information about
58+
the pluginEnvironment that the plugin is running in. It pulls some of
59+
this information from the calling plugin and some from the server
60+
pluginEnvironment. This method differs from the pluginEnvironment
6061
method in that it leverages Indigo's logging hooks using the Python
6162
Logger framework.
6263
"""
6364
self.plugin.logger.debug(u"DLFramework pluginEnvironment method called.")
6465

6566
self.plugin.logger.info(u"")
66-
self.plugin.logger.info(u"{0:=^130}".format(" Initializing New Plugin Session "))
67+
self.plugin.logger.info(u"{0:{1}^135}".format(" Initializing New Plugin Session ", "="))
6768
self.plugin.logger.info(u"{0:<31} {1}".format("Plugin name:", self.plugin.pluginDisplayName))
6869
self.plugin.logger.info(u"{0:<31} {1}".format("Plugin version:", self.plugin.pluginVersion))
6970
self.plugin.logger.info(u"{0:<31} {1}".format("Plugin ID:", self.plugin.pluginId))
7071
self.plugin.logger.info(u"{0:<31} {1}".format("Indigo version:", indigo.server.version))
7172
self.plugin.logger.info(u"{0:<31} {1}".format("Python version:", sys.version.replace('\n', '')))
7273
self.plugin.logger.info(u"{0:<31} {1}".format("Mac OS Version:", platform.mac_ver()[0]))
7374
self.plugin.logger.info(u"{0:<31} {1}".format("Process ID:", os.getpid()))
74-
self.plugin.logger.info(u"{0:=^130}".format(""))
75+
self.plugin.logger.info(u"{0:{1}^135}".format("", "="))
7576

7677
def convertDebugLevel(self, debug_val):
7778
"""

matplotlib.indigoPlugin/Contents/Server Plugin/maintenance.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,32 @@ def clean_props(self):
444444

445445
self.plugin.logger.debug(u"[{0}] prefs cleaned.".format(dev.name))
446446

447+
# def clean_dev_props(self, dev):
448+
#
449+
# import xml.etree.ElementTree as ET
450+
#
451+
# current_prefs = []
452+
# dead_prefs = []
453+
#
454+
# # Get the device's current Devices.xml config
455+
# config_prefs = self.plugin.devicesTypeDict[dev.deviceTypeId]["ConfigUIRawXml"]
456+
# config_prefs = ET.ElementTree(ET.fromstring(config_prefs))
457+
#
458+
# # Iterate the XML to get the field IDs
459+
# for pref in config_prefs.findall('Field'):
460+
# dev_id = unicode(pref.get('id'))
461+
# current_prefs.append(dev_id)
462+
#
463+
# self.plugin.logger.info(u"Current config prefs: {0}".format(sorted(current_prefs)))
464+
#
465+
# # Get the device's current config. There may be prefs here that are not
466+
# # in Devices.xml but are still valid (they may have been added dynamically).
467+
# dev_prefs = dev.pluginProps
468+
# self.plugin.logger.info(u"Current device prefs: {0}".format(sorted(dict(dev_prefs).keys())))
469+
#
470+
# # prefs in the device that aren't in the config
471+
# for pref in dev_prefs:
472+
# if pref not in current_prefs:
473+
# dead_prefs.append(pref)
474+
#
475+
# self.plugin.logger.info(u"Device prefs not in current config: {0}".format(sorted(dead_prefs)))

matplotlib.indigoPlugin/Contents/Server Plugin/plugin.py

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
# TODO: NEW -- Add config dialog to rcparams device that's generated
2727
# automatically?
2828
# TODO: Support substitutions for certain fields (like save location).
29-
# TODO: Try to molify annotation collisions.
29+
# TODO: Try to address annotation collisions.
3030

31+
# TODO: Iterate CSV engine devices and warn if any are writing to same file.
3132
# TODO: Wrap long names for battery health device?
3233
# TODO: Add facility to have different Y1 and Y2. Add a new group of controls
3334
# (like Y1) for Y2 and then have a control to allow user to elect when Y
3435
# axis to assign the line to.
35-
# TODO: Iterate CSV engine devices and warn if any are writing to same file.
3636
# TODO: Remove matplotlib_version.html after deprecation
3737
# TODO: if the csv save location is a share, and the share is unreachable, it
3838
# blows up.
@@ -54,7 +54,6 @@
5454
import os
5555
import traceback
5656
import unicodedata
57-
import re
5857

5958
import matplotlib
6059
matplotlib.use('AGG') # Note: this statement must be run before any other matplotlib imports are done.
@@ -209,7 +208,7 @@ def closedPrefsConfigUi(self, valuesDict, userCancelled):
209208
self.logger.warning(u"Verbose logging is on. It is best not to leave this turned on for very long.")
210209
else:
211210
self.plugin_file_handler.setLevel(10)
212-
self.logger.info(u"Verbose logging is off.")
211+
self.logger.info(u"Verbose logging is off. It is best to leave this turned off unless directed.")
213212

214213
self.logger.threaddebug(u"Configuration complete.")
215214

@@ -228,7 +227,7 @@ def deviceStartComm(self, dev):
228227
# If chartLastUpdated is empty, set it to the epoch
229228
if dev.deviceTypeId != 'csvEngine' and dev.states['chartLastUpdated'] == "":
230229
dev.updateStateOnServer(key='chartLastUpdated', value='1970-01-01 00:00:00.000000')
231-
self.logger.threaddebug(u"CSV last update unknow. Coercing update.")
230+
self.logger.threaddebug(u"CSV last update unknown. Coercing update.")
232231

233232
# If the refresh interval is greater than zero
234233
# Note that we check for the existence of the device state before trying to
@@ -250,34 +249,6 @@ def deviceStartComm(self, dev):
250249
dev.stateListOrDisplayStateIdChanged()
251250
dev.updateStateImageOnServer(indigo.kStateImageSel.SensorOff)
252251

253-
# TODO: isolate this function and fold it into the __clean_prefs method.
254-
# =============================================================================
255-
# current_prefs = []
256-
# dead_prefs = []
257-
#
258-
# # Get the device's current Devices.xml config
259-
# config_prefs = self.devicesTypeDict[dev.deviceTypeId]["ConfigUIRawXml"]
260-
# config_prefs = ET.ElementTree(ET.fromstring(config_prefs))
261-
#
262-
# # Iterate the XML to get the field IDs
263-
# for pref in config_prefs.findall('Field'):
264-
# dev_id = unicode(pref.get('id'))
265-
# current_prefs.append(dev_id)
266-
#
267-
# self.logger.info(u"Current config prefs: {0}".format(sorted(current_prefs)))
268-
#
269-
# Get the device's current config. There may be prefs here that are not
270-
# in Devices.xml but are still valid (they may have been added dynamically).
271-
# dev_prefs = dev.pluginProps
272-
# self.logger.info(u"Current device prefs: {0}".format(sorted(dict(dev_prefs).keys())))
273-
#
274-
# # prefs in the device that aren't in the config
275-
# for pref in dev_prefs:
276-
# if pref not in current_prefs:
277-
# dead_prefs.append(pref)
278-
#
279-
# self.logger.info(u"Device prefs not in current config: {0}".format(sorted(dead_prefs)))
280-
281252
# =============================================================================
282253
def deviceStopComm(self, dev):
283254

0 commit comments

Comments
 (0)