From: timv Date: Thu, 13 Dec 2012 21:59:31 +0000 (-0500) Subject: tweaks X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=630a92c2a00364138c66cbe74ac98f7f1c2b42ea;p=dyna2 tweaks --- diff --git a/bin/stdlib.py b/bin/stdlib.py index f2f904a..366bb5a 100644 --- a/bin/stdlib.py +++ b/bin/stdlib.py @@ -119,7 +119,7 @@ def pretty(item): def prettify(x): if isinstance(x, tuple): return pretty(x) - elif isinstance(x, list): + elif hasattr(x, '__iter__'): return map(pretty, x) elif isinstance(x, Chart): return {pretty((x.name, k)): v for k,v in x.data.iteritems()} @@ -342,7 +342,8 @@ class UserChart(object): # timv: technically, should restrict to ":=" and extensional aggregator[item].clear() - aggregator[item][now] += 1 + if now is not None: + aggregator[item][now] += 1 agenda.add(item) foundone = True @@ -351,7 +352,8 @@ class UserChart(object): idx = self._chart.insert(item + (None,)) item = (self.name, idx) aggregator[item].clear() - aggregator[item][now] += 1 + if now is not None: + aggregator[item][now] += 1 agenda.add(item) go() diff --git a/debug b/debug new file mode 100755 index 0000000..0e66300 --- /dev/null +++ b/debug @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +python bin/prototype.py $@ diff --git a/dyna b/dyna new file mode 100755 index 0000000..8966f49 --- /dev/null +++ b/dyna @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +python bin/stdlib.py $@