@@ -81,39 +81,39 @@ def log(ctx, message):
8181 ctx .log (message )
8282
8383
84- def push (ctx ):
85- credentials_file = os .path .join (dir_path , '.credentials' )
86- credentials = json .loads (open (credentials_file , 'r' ).read ())
87- json_path = os .path .join (dir_path , 'commands.json' )
88- credentials ['commands' ] = open (json_path ).read ()
89- url = api_url + '/push'
90- if click .confirm ("This will overwrite the saved "
91- "commands on the server. Proceed?" , default = True ):
92- r = requests .post (url , json = credentials )
93- if r .status_code == 200 :
94- click .echo ("Server successfully updated." )
95-
96-
97- def pull (ctx , overwrite ):
98- credentials_file = os .path .join (dir_path , '.credentials' )
99- credentials = json .loads (open (credentials_file , 'r' ).read ())
100- json_path = os .path .join (dir_path , 'commands.json' )
101- url = api_url + '/pull'
102-
103- r = requests .post (url , json = credentials )
104- if r .status_code == 200 :
105- commands = json .loads (r .json ()['commands' ])
106-
107- if not overwrite :
108- my_commands = read_commands ()
109- commands .update (my_commands )
110-
111- if not overwrite or (
112- overwrite and click .confirm (
113- "This will overwrite the locally saved commands. Proceed?" , default = True )):
114- with open (json_path , 'w' ) as f :
115- f .write (json .dumps (commands ))
116- click .echo ("Local database successfully updated." )
84+ # def push(ctx):
85+ # credentials_file = os.path.join(dir_path, '.credentials')
86+ # credentials = json.loads(open(credentials_file, 'r').read())
87+ # json_path = os.path.join(dir_path, 'commands.json')
88+ # credentials['commands'] = open(json_path).read()
89+ # url = api_url + '/push'
90+ # if click.confirm("This will overwrite the saved "
91+ # "commands on the server. Proceed?", default=True):
92+ # r = requests.post(url, json=credentials)
93+ # if r.status_code == 200:
94+ # click.echo("Server successfully updated.")
95+
96+
97+ # def pull(ctx, overwrite):
98+ # credentials_file = os.path.join(dir_path, '.credentials')
99+ # credentials = json.loads(open(credentials_file, 'r').read())
100+ # json_path = os.path.join(dir_path, 'commands.json')
101+ # url = api_url + '/pull'
102+
103+ # r = requests.post(url, json=credentials)
104+ # if r.status_code == 200:
105+ # commands = json.loads(r.json()['commands'])
106+
107+ # if not overwrite:
108+ # my_commands = read_commands()
109+ # commands.update(my_commands)
110+
111+ # if not overwrite or (
112+ # overwrite and click.confirm(
113+ # "This will overwrite the locally saved commands. Proceed?", default=True)):
114+ # with open(json_path, 'w') as f:
115+ # f.write(json.dumps(commands))
116+ # click.echo("Local database successfully updated.")
117117
118118
119119# def register():
0 commit comments