diff options
author | Lance Stout <lancestout@gmail.com> | 2014-08-18 13:34:15 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2014-08-18 13:34:15 -0700 |
commit | e5e2fbb16b4d9c11fc676925c6a13943282a3c66 (patch) | |
tree | 5dc018384ad03253608ff79c9fdbb577b84d2d2f /sleekxmpp/plugins/xep_0325/stanza | |
parent | a20582aba4de85f5a193395df2d0ed8c75220bfb (diff) | |
parent | 3dd379cdf12d885e26f8ec26c54879a95d5f0b84 (diff) | |
download | slixmpp-e5e2fbb16b4d9c11fc676925c6a13943282a3c66.tar.gz slixmpp-e5e2fbb16b4d9c11fc676925c6a13943282a3c66.tar.bz2 slixmpp-e5e2fbb16b4d9c11fc676925c6a13943282a3c66.tar.xz slixmpp-e5e2fbb16b4d9c11fc676925c6a13943282a3c66.zip |
Merge pull request #311 from Mayflower/develop
Revert "cleanup semicolons, whitespace and mutable default arguments"
Diffstat (limited to 'sleekxmpp/plugins/xep_0325/stanza')
-rw-r--r-- | sleekxmpp/plugins/xep_0325/stanza/control.py | 123 |
1 files changed, 61 insertions, 62 deletions
diff --git a/sleekxmpp/plugins/xep_0325/stanza/control.py b/sleekxmpp/plugins/xep_0325/stanza/control.py index 1fd5c35d..67107ecb 100644 --- a/sleekxmpp/plugins/xep_0325/stanza/control.py +++ b/sleekxmpp/plugins/xep_0325/stanza/control.py @@ -26,7 +26,7 @@ class ControlSet(ElementBase): interfaces = set(['nodes','datas']) def __init__(self, xml=None, parent=None): - ElementBase.__init__(self, xml, parent) + ElementBase.__init__(self, xml, parent); self._nodes = set() self._datas = set() @@ -53,7 +53,7 @@ class ControlSet(ElementBase): Arguments: nodeId -- The ID for the node. sourceId -- [optional] identifying the data source controlling the device - cacheType -- [optional] narrowing down the search to a specific kind of node + cacheType -- [optional] narrowing down the search to a specific kind of node """ if nodeId not in self._nodes: self._nodes.add((nodeId)) @@ -117,40 +117,40 @@ class ControlSet(ElementBase): def add_data(self, name, typename, value): """ - Add a new data element. + Add a new data element. Arguments: name -- The name of the data element - typename -- The type of data element - (boolean, color, string, date, dateTime, + typename -- The type of data element + (boolean, color, string, date, dateTime, double, duration, int, long, time) value -- The value of the data element """ if name not in self._datas: - dataObj = None + dataObj = None; if typename == "boolean": - dataObj = BooleanParameter(parent=self) + dataObj = BooleanParameter(parent=self); elif typename == "color": - dataObj = ColorParameter(parent=self) + dataObj = ColorParameter(parent=self); elif typename == "string": - dataObj = StringParameter(parent=self) + dataObj = StringParameter(parent=self); elif typename == "date": - dataObj = DateParameter(parent=self) + dataObj = DateParameter(parent=self); elif typename == "dateTime": - dataObj = DateTimeParameter(parent=self) + dataObj = DateTimeParameter(parent=self); elif typename == "double": - dataObj = DoubleParameter(parent=self) + dataObj = DoubleParameter(parent=self); elif typename == "duration": - dataObj = DurationParameter(parent=self) + dataObj = DurationParameter(parent=self); elif typename == "int": - dataObj = IntParameter(parent=self) + dataObj = IntParameter(parent=self); elif typename == "long": - dataObj = LongParameter(parent=self) + dataObj = LongParameter(parent=self); elif typename == "time": - dataObj = TimeParameter(parent=self) + dataObj = TimeParameter(parent=self); - dataObj['name'] = name - dataObj['value'] = value + dataObj['name'] = name; + dataObj['value'] = value; self._datas.add(name) self.iterables.append(dataObj) @@ -217,7 +217,7 @@ class ControlSetResponse(ElementBase): interfaces = set(['responseCode']) def __init__(self, xml=None, parent=None): - ElementBase.__init__(self, xml, parent) + ElementBase.__init__(self, xml, parent); self._nodes = set() self._datas = set() @@ -244,7 +244,7 @@ class ControlSetResponse(ElementBase): Arguments: nodeId -- The ID for the node. sourceId -- [optional] identifying the data source controlling the device - cacheType -- [optional] narrowing down the search to a specific kind of node + cacheType -- [optional] narrowing down the search to a specific kind of node """ if nodeId not in self._nodes: self._nodes.add(nodeId) @@ -308,7 +308,7 @@ class ControlSetResponse(ElementBase): def add_data(self, name): """ - Add a new ResponseParameter element. + Add a new ResponseParameter element. Arguments: name -- Name of the parameter @@ -316,7 +316,7 @@ class ControlSetResponse(ElementBase): if name not in self._datas: self._datas.add(name) data = ResponseParameter(parent=self) - data['name'] = name + data['name'] = name; self.iterables.append(data) return data return None @@ -383,26 +383,26 @@ class Error(ElementBase): value -- string """ - self.xml.text = value + self.xml.text = value; return self def del_text(self): """Remove the contents inside the XML tag.""" self.xml.text = "" - return self + return self class ResponseParameter(ElementBase): - """ - Parameter element in ControlSetResponse. - """ + """ + Parameter element in ControlSetResponse. + """ namespace = 'urn:xmpp:iot:control' name = 'parameter' plugin_attrib = name - interfaces = set(['name']) + interfaces = set(['name']); class BaseParameter(ElementBase): - """ + """ Parameter element in SetCommand. This is a base class, all instances of parameters added to SetCommand must be of types: BooleanParameter @@ -415,91 +415,90 @@ class BaseParameter(ElementBase): IntParameter LongParameter TimeParameter - """ + """ namespace = 'urn:xmpp:iot:control' name = 'baseParameter' plugin_attrib = name - interfaces = set(['name','value']) + interfaces = set(['name','value']); def _get_typename(self): - return self.name - + return self.name; class BooleanParameter(BaseParameter): - """ - Field data of type boolean. - Note that the value is expressed as a string. + """ + Field data of type boolean. + Note that the value is expressed as a string. """ name = 'boolean' plugin_attrib = name class ColorParameter(BaseParameter): - """ - Field data of type color. - Note that the value is expressed as a string. + """ + Field data of type color. + Note that the value is expressed as a string. """ name = 'color' plugin_attrib = name class StringParameter(BaseParameter): - """ - Field data of type string. + """ + Field data of type string. """ name = 'string' plugin_attrib = name class DateParameter(BaseParameter): - """ - Field data of type date. - Note that the value is expressed as a string. + """ + Field data of type date. + Note that the value is expressed as a string. """ name = 'date' plugin_attrib = name class DateTimeParameter(BaseParameter): - """ - Field data of type dateTime. - Note that the value is expressed as a string. + """ + Field data of type dateTime. + Note that the value is expressed as a string. """ name = 'dateTime' plugin_attrib = name class DoubleParameter(BaseParameter): - """ - Field data of type double. - Note that the value is expressed as a string. + """ + Field data of type double. + Note that the value is expressed as a string. """ name = 'double' plugin_attrib = name class DurationParameter(BaseParameter): - """ - Field data of type duration. - Note that the value is expressed as a string. + """ + Field data of type duration. + Note that the value is expressed as a string. """ name = 'duration' plugin_attrib = name class IntParameter(BaseParameter): - """ - Field data of type int. - Note that the value is expressed as a string. + """ + Field data of type int. + Note that the value is expressed as a string. """ name = 'int' plugin_attrib = name class LongParameter(BaseParameter): - """ - Field data of type long (64-bit int). - Note that the value is expressed as a string. + """ + Field data of type long (64-bit int). + Note that the value is expressed as a string. """ name = 'long' plugin_attrib = name class TimeParameter(BaseParameter): - """ - Field data of type time. - Note that the value is expressed as a string. + """ + Field data of type time. + Note that the value is expressed as a string. """ name = 'time' plugin_attrib = name |