aboutsummaryrefslogtreecommitdiff
path: root/rumba/storyboard.py
diff options
context:
space:
mode:
Diffstat (limited to 'rumba/storyboard.py')
-rw-r--r--rumba/storyboard.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/rumba/storyboard.py b/rumba/storyboard.py
index 799c78e..8570690 100644
--- a/rumba/storyboard.py
+++ b/rumba/storyboard.py
@@ -1251,6 +1251,8 @@ class Event(object):
pass
def _start(self):
+ logger.debug("Running event %s, action %s",
+ self.id, self._action_repr())
self.pre_exec()
if self.done:
raise ValueError('Event %s has already ran' % self.id)
@@ -1385,7 +1387,6 @@ class _Script(object):
"""
while len(self._events_ready):
event = self._events_ready.pop()
- logger.debug("Running event %s.", event.id)
event.run()
def _nested_iterator(self, d):
@@ -1433,17 +1434,22 @@ class _Script(object):
args.append(arg_s)
else:
quotes_part = arg_s
- else:
+ else: # Not a string
if arg_s.startswith('$'):
args.append(self._resolve_entity(arg_s[1:]))
- else:
- try:
- args.append(float(arg_s))
- except ValueError:
- raise ValueError('Syntax error: %s is not a float. '
- 'If it is supposed to be a string, '
- 'enclose it in single quotes.'
- % (arg_s,))
+ continue
+ try: # No string, no entity, it must be a number
+ args.append(int(arg_s))
+ continue
+ except ValueError:
+ pass # Try to parse it as float
+ try:
+ args.append(float(arg_s))
+ except ValueError:
+ raise ValueError('Syntax error: %s is not a valid value. '
+ 'If it is supposed to be a string, '
+ 'enclose it in single quotes.'
+ % (arg_s,))
return args
def _parse_prefix(self, prefix):