-
Notifications
You must be signed in to change notification settings - Fork 9
/
cityscopy.py
executable file
·85 lines (64 loc) · 2.31 KB
/
cityscopy.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/python
import argparse
from cityscopy.Scanner.Scanner import Scanner
from cityscopy.Setup.Setup import Setup
import sys
import os
def main():
parser = argparse.ArgumentParser(
prog="cityscopy",
description="CityScoPY: A Scanner for MIT CityScope",
epilog="Thank you for using CityScope!",
)
parser.add_argument('--cityscopy', '-c',
default=None,
required=True,
const='all',
nargs='?',
choices=['scan', 'keystone', 'setup'],
help='list servers, storage, or both (default: %(default)s)')
parser.add_argument('--table_name', '-t',
action='store',
required=True,
help='table\'s name')
args = parser.parse_args()
# get the table name and make it lower case
args.table_name = args.table_name.lower()
# run the right command based on the input argument
if args.cityscopy == 'scan':
scanner = Scanner(CITYSCOPE_PRJ_NAME=args.table_name)
scanner.scan()
elif args.cityscopy == 'setup':
setup = Setup(CITYSCOPE_PRJ_NAME=args.table_name)
setup.setup()
else:
parser.print_help()
sys.exit(1)
#! start local UDP comms
# # cityscopy.udp_listener()
if __name__ == '__main__':
os.system('clear')
print(
'''
>>>>>> CityScoPY: A Scanner for MIT CityScope >>>>>>>>
|||||||||||
|||||||||||
|||
|||
|||
||| ||||||||||||
||| ||||||||||||
||| |||
||| |||
||| |||
|||||||||||| |||
|||||||||||| |||
Copyright (C) {{ 2018 - 2023 }} {{ Ariel Noyman }}
Ariel Noyman
https://github.com/CityScope/
http://arielnoyman.com
https://github.com/RELNO
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'''
)
main()