Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint alerts corrections as part of intervention experiment #81 #82

Merged
merged 9 commits into from
Sep 25, 2024
3 changes: 2 additions & 1 deletion src/lib/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def set_default_config_file(self):

self.config['MAIN'] = {
'version': '2.00',
'keyVersion': '1', # Will be used to support legacy key versions if the algorithm changes
'keyVersion': '1', # Will be used to support legacy key versions
# if the algorithm changes
'salt': self.generate_random_salt(),
'clipboardTTL': '15',
'hideSecretTTL': '5',
Expand Down
2 changes: 0 additions & 2 deletions src/modules/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,3 @@ def get_input_autocomplete(message=''):
return input(message).strip()
except KeyboardInterrupt:
return False
except Exception: # Other Exception
return False
2 changes: 1 addition & 1 deletion src/modules/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def create_directory_if_missing(dir_):
return True

return False
except Exception:
except (OSError, FileExistsError):
import sys

print()
Expand Down
2 changes: 1 addition & 1 deletion src/tools/troubleshoot_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def attempt_dummy_encrypted_db(db_path):
connection.execute(text('CREATE TABLE foo (a int)'))
connection.execute(text('INSERT INTO foo (a) VALUES (123)'))
result_proxy = connection.execute(text('SELECT * FROM foo'))
return True if result_proxy.fetchall() == [(123,)] else False
return bool(result_proxy.fetchall() == [(123,)])


def verify_if_dummy_db_is_encrypted(db_path):
Expand Down
2 changes: 1 addition & 1 deletion src/views/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def main_menu():
Categories menu
"""

while (True):
while True:
# Clear screen
clear_screen()

Expand Down
3 changes: 2 additions & 1 deletion src/views/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def import_from_json(path=None, rows=None):
def import_items(rows):
"""
Import items at the following format:
[{'name': '...', 'url': '...', 'login': '...', 'password': '...', 'notes': '...', 'category': '...'}]
[{'name': '...', 'url': '...', 'login': '...'
, 'password': '...', 'notes': '...', 'category': '...'}]
"""

for row in rows:
Expand Down
2 changes: 0 additions & 2 deletions src/views/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def get_input(message='', secure=False, lowercase=False, check_timer=True, non_l
input_ = input_.lower()
except KeyboardInterrupt:
return False
except Exception: # Other Exception
return False

return input_

Expand Down
3 changes: 2 additions & 1 deletion src/views/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def migrate(vault_path, config_path, new_vault_path=None):
print()
print('The migration is now complete!')
print('Restart the application to use Vault 2.')
print('Your old vault is stored in `%s`. You can discard this file after ensuring that all your data was migrated properly.' % (vault_path))
print('Your old vault is stored in `%s`. You can discard this file after ensuring that all your data was migrated properly.'
% (vault_path))
print('Your new vault is stored in `%s`.' % (new_vault_path))
print()

Expand Down
3 changes: 2 additions & 1 deletion src/views/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def initialize(salt):
print("Your vault has been created and encrypted with your master key.")
print("Your unique salt is: %s " % (salt))
print(
"Write it down. If you lose your config file you will need it to unlock your vault.")
"Write it down."
+ " If you lose your config file you will need it to unlock your vault.")

return True

Expand Down