home
/
code
/
khatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
438d0d5
)
Refactor msg reading function
author
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 29 Jul 2018 04:00:15 +0000
(
00:00
-0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 29 Jul 2018 04:00:15 +0000
(
00:00
-0400)
bin/khatus_loop
patch
|
blob
|
blame
|
history
diff --git
a/bin/khatus_loop
b/bin/khatus_loop
index
3bd112d
..
3603e25
100755
(executable)
--- a/
bin/khatus_loop
+++ b/
bin/khatus_loop
@@
-34,24
+34,22
@@
read_and_react() {
'
/^in:WEATHER:/\
{
- chop_off_msg_tag()
- db["weather_temperature"] = $0
+ db["weather_temperature"] = read_msg()
}
/^in:DATE_TIME:/\
{
- chop_off_msg_tag()
- db["datetime"] = $0
+ db["datetime"] = read_msg()
}
/^out:BAR:/\
{
- chop_off_msg_tag()
print make_bar()
}
- function
chop_off_msg_ta
g() {
+ function
read_ms
g() {
sub("^" $1 " +", "")
+ return $0
}
function make_bar( position, bar, i) {
This page took
0.02822 seconds
and
4
git commands to generate.