Skip to content

Commit 1aacacf

Browse files
authored
Merge pull request #46 from OrkoHunter/updates
Remove sync
2 parents 87f1bf9 + 90aae2f commit 1aacacf

File tree

7 files changed

+53
-54
lines changed

7 files changed

+53
-54
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ docs/_build/
5555

5656
# PyBuilder
5757
target/
58+
59+
.vscode

keep/about.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__name__ = 'keep'
2-
__version__ = '2.4.2'
2+
__version__ = '2.5'

keep/utils.py

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ def check_update(forced=False):
3535
r = requests.get("https://pypi.python.org/pypi/keep/json").json()
3636
version = r['info']['version']
3737
curr_version = about.__version__
38-
if version != curr_version:
38+
if version > curr_version:
3939
click.secho("Keep seems to be outdated. Current version = "
4040
"{}, Latest version = {}".format(curr_version, version) +
4141
"\n\nPlease update with ", bold=True, fg='red')
42-
click.secho("\tpip --no-cache-dir install -U keep==" + str(version), fg='green')
43-
sys.exit(0)
42+
click.secho("\tpip3 --no-cache-dir install -U keep==" + str(version), fg='green')
4443

4544

4645
def first_time_use(ctx):
@@ -52,16 +51,14 @@ def first_time_use(ctx):
5251

5352
os.mkdir(dir_path)
5453

55-
register()
54+
# register()
5655
sys.exit(0)
5756

5857

5958
def list_commands(ctx):
6059
table_data = [['Command', 'Description', 'Alias']]
6160
commands = read_commands()
6261

63-
print(type(commands))
64-
6562
for cmd, fields in commands.items():
6663
table_data.append(['$ ' + cmd, fields['desc'], fields['alias']])
6764

@@ -119,52 +116,52 @@ def pull(ctx, overwrite):
119116
click.echo("Local database successfully updated.")
120117

121118

122-
def register():
123-
124-
if not os.path.exists(dir_path):
125-
click.secho("\n[CRITICAL] {0} does not exits.\nPlease run 'keep init',"
126-
" and try registering again.\n".format(dir_path),
127-
fg="red", err=True)
128-
sys.exit(1)
129-
130-
# User may not choose to register and work locally.
131-
# Registration is required to push the commands to server
132-
if click.confirm('Proceed to register?', abort=True, default=True):
133-
# Verify for existing user
134-
click.echo("Your credentials will be saved in the ~/.keep directory.")
135-
email = click.prompt('Email', confirmation_prompt=True)
136-
json_res = {'email': email}
137-
click.echo('Verifying with existing users...')
138-
r = requests.post('https://keep-cli.herokuapp.com/check-user', json=json_res)
139-
if r.json()['exists']:
140-
click.secho('User already exists !', fg='red')
141-
email = click.prompt('Email', confirmation_prompt=True)
142-
json_res = {'email': email}
143-
r = requests.post('https://keep-cli.herokuapp.com/check-user', json=json_res)
144-
# Generate password for the user
145-
chars = string.ascii_letters + string.digits
146-
password = ''.join(random.choice(chars) for _ in range(255))
147-
credentials_file = os.path.join(dir_path, '.credentials')
148-
credentials = {
149-
'email': email,
150-
'password': password
151-
}
152-
click.secho("Generated password for " + email, fg='cyan')
153-
# Register over the server
154-
click.echo("Registering new user ...")
155-
json_res = {
156-
'email': email,
157-
'password': password
158-
}
159-
r = requests.post('https://keep-cli.herokuapp.com/register', json=json_res)
160-
if r.status_code == 200:
161-
click.secho("User successfully registered !", fg='green')
162-
# Save the credentials into a file
163-
with open(credentials_file, 'w+') as f:
164-
f.write(json.dumps(credentials))
165-
click.secho(password, fg='cyan')
166-
click.secho("Credentials file saved at ~/.keep/.credentials.json", fg='green')
167-
sys.exit(0)
119+
# def register():
120+
121+
# if not os.path.exists(dir_path):
122+
# click.secho("\n[CRITICAL] {0} does not exits.\nPlease run 'keep init',"
123+
# " and try registering again.\n".format(dir_path),
124+
# fg="red", err=True)
125+
# sys.exit(1)
126+
127+
# # User may not choose to register and work locally.
128+
# # Registration is required to push the commands to server
129+
# if click.confirm('Proceed to register?', abort=True, default=True):
130+
# # Verify for existing user
131+
# click.echo("Your credentials will be saved in the ~/.keep directory.")
132+
# email = click.prompt('Email', confirmation_prompt=True)
133+
# json_res = {'email': email}
134+
# click.echo('Verifying with existing users...')
135+
# r = requests.post('https://keep-cli.herokuapp.com/check-user', json=json_res)
136+
# if r.json()['exists']:
137+
# click.secho('User already exists !', fg='red')
138+
# email = click.prompt('Email', confirmation_prompt=True)
139+
# json_res = {'email': email}
140+
# r = requests.post('https://keep-cli.herokuapp.com/check-user', json=json_res)
141+
# # Generate password for the user
142+
# chars = string.ascii_letters + string.digits
143+
# password = ''.join(random.choice(chars) for _ in range(255))
144+
# credentials_file = os.path.join(dir_path, '.credentials')
145+
# credentials = {
146+
# 'email': email,
147+
# 'password': password
148+
# }
149+
# click.secho("Generated password for " + email, fg='cyan')
150+
# # Register over the server
151+
# click.echo("Registering new user ...")
152+
# json_res = {
153+
# 'email': email,
154+
# 'password': password
155+
# }
156+
# r = requests.post('https://keep-cli.herokuapp.com/register', json=json_res)
157+
# if r.status_code == 200:
158+
# click.secho("User successfully registered !", fg='green')
159+
# # Save the credentials into a file
160+
# with open(credentials_file, 'w+') as f:
161+
# f.write(json.dumps(credentials))
162+
# click.secho(password, fg='cyan')
163+
# click.secho("Credentials file saved at ~/.keep/.credentials.json", fg='green')
164+
# sys.exit(0)
168165

169166

170167
def remove_command(cmd):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
description = 'Personal shell command keeper',
2222
long_description = long_description,
2323
author = 'Himanshu Mishra',
24-
author_email = 'himanshumishra@iitkgp.ac.in',
24+
author_email = 'himanshu.mishra.kgp@gmail.com',
2525
url = "https://github.com/orkohunter/keep",
2626
download_url = "https://github.com/orkohunter/keep/archive/master.zip",
2727
include_package_data=True,

0 commit comments

Comments
 (0)