You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
556 B

6 months ago
#!/usr/bin/python3
import sys
from urllib.parse import urlencode
import urllib.request
6 months ago
API_URL = "http://127.0.0.1:8000/api/rms/cab/sync/db_status"
def main():
args = sys.argv[1:]
params = {}
for index in range(len(args)):
arg = args[index]
if not arg.startswith('--'):
continue
key = arg[2:]
value = args[index+1]
params[key] = value
encoded_params = urlencode(params)
url = API_URL + '?' + encoded_params
urllib.request.urlopen(url)
if __name__ == '__main__':
main()