From f7a307c9dd7c85034358f381765f54d0c1a22327 Mon Sep 17 00:00:00 2001 From: Ryan Huber Date: Mon, 17 Nov 2014 21:22:37 -0800 Subject: [PATCH] examples moved to doc --- doc/example/counter.py | 9 +++++++++ doc/example/repeat.py | 8 ++++++++ doc/example/repeat2.py | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 doc/example/counter.py create mode 100644 doc/example/repeat.py create mode 100644 doc/example/repeat2.py diff --git a/doc/example/counter.py b/doc/example/counter.py new file mode 100644 index 0000000..5846c94 --- /dev/null +++ b/doc/example/counter.py @@ -0,0 +1,9 @@ +import time +crontable = [] +outputs = [] + +#crontable.append([.5,"add_number"]) +crontable.append([5,"say_time"]) + +def say_time(): + outputs.append(["D030GJLM2", time.time()]) diff --git a/doc/example/repeat.py b/doc/example/repeat.py new file mode 100644 index 0000000..e13a51b --- /dev/null +++ b/doc/example/repeat.py @@ -0,0 +1,8 @@ +import time +crontable = [] +outputs = [] + +def process_message(data): + if data['channel'].startswith("D"): + outputs.append([data['channel'], "from repeat1: " + data['text']]) + diff --git a/doc/example/repeat2.py b/doc/example/repeat2.py new file mode 100644 index 0000000..95738fc --- /dev/null +++ b/doc/example/repeat2.py @@ -0,0 +1,8 @@ +import time +crontable = [] +outputs = [] + +def process_message(data): + if data['channel'].startswith("D"): + outputs.append([data['channel'], "from repeat2: " + data['text']]) +