Skip to content
Snippets Groups Projects
Commit 00ce996f authored by jkerdreu's avatar jkerdreu
Browse files

Check the add_timer call to avoid issue w/ value = 0

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2380 b32b6428-25c9-4566-ad07-03861ab6144f
parent a135f3ca
No related branches found
No related tags found
No related merge requests found
......@@ -263,6 +263,8 @@ class Engine(object):
period: period in second
counter: number of repeat, -1 => always
"""
if counter == 0:
raise EngineError("Timer counter should =-1 or >0")
t = Timer(func,period,counter)
self.timers.append(t)
return t
......
......@@ -52,7 +52,7 @@ class Attribute(object):
self.__value = value
def __repr__(self):
return "<xaal.lib.devices.Attribute: '%s' at 0x%x>" % (self.name, id(self))
return f"<{self.__module__}.Attribute {self.name} at 0x{id(self):x}>"
class Attributes(list):
......
......@@ -3,6 +3,7 @@
class DeviceError(Exception):pass
# core.py
class EngineError(Exception):pass
class XAALError(Exception):pass
class CallbackError(Exception):
def __init__(self, code, desc):
......@@ -16,4 +17,4 @@ class MessageError(Exception):pass
# addresses.py
class UUIDError(Exception):pass
__all__ = ["DeviceError","XAALError","CallbackError","MessageParserError","MessageError"]
__all__ = ["DeviceError","EngineError","XAALError","CallbackError","MessageParserError","MessageError"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment