Dirk Alders 3 years ago
parent
commit
8a8522d26b
3 changed files with 8295 additions and 8232 deletions
  1. 7
    4
      __init__.py
  2. 8288
    8228
      _testresults_/unittest.json
  3. BIN
      _testresults_/unittest.pdf

+ 7
- 4
__init__.py View File

36
 import time
36
 import time
37
 
37
 
38
 
38
 
39
-logger_name = 'SOCKET_PROTOCOL'
40
-logger = logging.getLogger(logger_name)
39
+try:
40
+    from config import APP_NAME as ROOT_LOGGER_NAME
41
+except ImportError:
42
+    ROOT_LOGGER_NAME = 'root'
43
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
41
 
44
 
42
 
45
 
43
 __DESCRIPTION__ = """The Module {\\tt %s} is designed to pack and unpack data for serial transportation.
46
 __DESCRIPTION__ = """The Module {\\tt %s} is designed to pack and unpack data for serial transportation.
75
             return self[None][None]
78
             return self[None][None]
76
         except KeyError:
79
         except KeyError:
77
             pass  # nothing to append
80
             pass  # nothing to append
78
-        return None
81
+        return (None, None, None)
79
 
82
 
80
     def add(self, service_id, data_id, callback, *args, **kwargs):
83
     def add(self, service_id, data_id, callback, *args, **kwargs):
81
-        if self.get(service_id, data_id) is not None:
84
+        if self.get(service_id, data_id) != (None, None, None):
82
             raise RegistrationError("Callback for service_id (%s) and data_id (%s) already exists" % (repr(service_id), repr(data_id)))
85
             raise RegistrationError("Callback for service_id (%s) and data_id (%s) already exists" % (repr(service_id), repr(data_id)))
83
         if service_id not in self:
86
         if service_id not in self:
84
             self[service_id] = {}
87
             self[service_id] = {}

+ 8288
- 8228
_testresults_/unittest.json
File diff suppressed because it is too large
View File


BIN
_testresults_/unittest.pdf View File


Loading…
Cancel
Save