-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathriver
More file actions
executable file
·46 lines (36 loc) · 1.33 KB
/
river
File metadata and controls
executable file
·46 lines (36 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
import argparse
import sys
from pyriver.api import create_app
from pyriver.builtin import (
build,
deploy,
init,
get,
run,
up
)
def backfill():
pass
commands = {
"build": build.execute,
"deploy": deploy.execute,
"init": init.execute,
"get": get.execute,
"run": run.execute,
"up": up.execute,
"backfill": backfill
}
def get_params():
parser = argparse.ArgumentParser(description="River")
parser.add_argument("command", type=str, metavar="command", help="The command you wish to run")
parser.add_argument("--stream", dest="stream", type=str, metavar="user/stream", help="The name of a stream")
parser.add_argument("--interval", dest="interval", type=str, metavar="interval", help="The interval on which your stream runs")
parser.add_argument("--start_date", type=str, metavar="start_date", help="The first date in the range to retrieve events from.")
parser.add_argument("--end_date", type=str, metavar="end_date", help="The end date in the range to retrieve events from.")
parser.add_argument("--detach", action="store_true", help="Detach the current process from the command.")
return parser.parse_args()
if __name__ == "__main__":
with create_app().app_context():
params = get_params()
commands[params.command](params)