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

Replace print with logging in application.py #1612

Merged
merged 11 commits into from
Mar 8, 2023
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ repos:
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-print]

# configuration for the pre-commit.ci bot
# only relevant when actually using the bot
Expand Down
3 changes: 2 additions & 1 deletion requirements.d/dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
pre-commit
black==22.*
coverage
flake8
flake8-print
isort
macholib
pre-commit
pyinstaller
pylint
pytest
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ extend-ignore = E203,E121,E123,E126,E226,E24,E704,W503,W504
exclude =
build,dist,.git,.idea,.cache,.tox,.eggs,
./src/vorta/__init__.py,.direnv
per-file-ignores =
./package/*: T20

[tox:tox]
envlist = py36,py37,py38,flake8
Expand Down
2 changes: 1 addition & 1 deletion src/vorta/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def exception_handler(type, value, tb):
want_background = getattr(args, 'daemonize', False)

if want_version:
print(f"Vorta {__version__}")
print(f"Vorta {__version__}") # noqa: T20
sys.exit()

if want_background:
Expand Down
4 changes: 2 additions & 2 deletions src/vorta/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ def __init__(self, args_raw, single_app=False):
if self.isRunning():
if single_app:
self.sendMessage("open main window")
print('An instance of Vorta is already running. Opening main window.')
logger.info('An instance of Vorta is already running. Opening main window.')
sys.exit()
elif args.profile:
self.sendMessage(f"create {args.profile}")
print('Creating backup using existing Vorta instance.')
logger.info('Creating backup using existing Vorta instance.')
sys.exit()
elif args.profile:
sys.exit('Vorta must already be running for --create to work')
Expand Down