Skip to content

Commit 6a60bc1

Browse files
committed
fix: do not ask for username when '--version' is specified
1 parent b0e70f3 commit 6a60bc1

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.github/workflows/checks.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ jobs:
5252
- name: Lint with flake8
5353
run: |
5454
flake8 --exclude _version.py .
55+
- name: Test with pytest
56+
run: |
57+
coverage run --source=dctag -m pytest tests
58+
- name: Upload coverage to Codecov
59+
uses: codecov/codecov-action@v4
60+
# FIXME Limit runtime until
61+
# https://github.com/codecov/codecov-action/issues/1316 is resolved
62+
timeout-minutes: 1
63+
continue-on-error: true
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
0.8.0
2+
- fix: do not ask for username when '--version' is specified
23
- ref: change organization domain to dc-cosmos.org
34
- tests: make sure GUI teardown takes place
45
- setup: publish code on GitHub

dctag/gui/main.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
class DCTag(QtWidgets.QMainWindow):
28-
def __init__(self, check_update=True):
28+
def __init__(self):
2929
super(DCTag, self).__init__()
3030

3131
# Settings are stored in the .ini file format. Even though
@@ -39,6 +39,13 @@ def __init__(self, check_update=True):
3939
QtCore.QCoreApplication.setApplicationName("dctag")
4040
QtCore.QSettings.setDefaultFormat(QtCore.QSettings.IniFormat)
4141

42+
# if "--version" was specified, print the version and exit
43+
if "--version" in sys.argv:
44+
print(version)
45+
QtWidgets.QApplication.processEvents(
46+
QtCore.QEventLoop.AllEvents, 300)
47+
sys.exit(0)
48+
4249
#: DCOR-Aid settings
4350
self.settings = QtCore.QSettings()
4451
username = self.settings.value("user/name", None)
@@ -88,12 +95,6 @@ def __init__(self, check_update=True):
8895
#: holds the current DCTagSession instance
8996
self.session = None
9097

91-
# if "--version" was specified, print the version and exit
92-
if "--version" in sys.argv:
93-
print(version)
94-
QtWidgets.QApplication.processEvents(
95-
QtCore.QEventLoop.AllEvents, 300)
96-
sys.exit(0)
9798
self.show()
9899
self.raise_()
99100
self.activateWindow()

0 commit comments

Comments
 (0)