-d flag is used in a very confusing way
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenLP |
Fix Committed
|
Low
|
Tim Bentley |
Bug Description
in the startup code the parameters accepted include --dev-version (-d).
What's irritating is that it's not actually used there. The values are also not actually passed along somewhere else.
However the about dialog still correctly displays the bzr revision if started with -d.
So a little searching showed the following. The argument is defined in openlp.
Since the dev_version is not stored somewhere or passed to some place, get_version actually checks sys.argv searching for "-d" or "--dev-version"
This is not very nice to people reading the code. It very much looks like the argument definition is not actually used.
My request:
* either completely remove the functionality
* or properly use the parsed value, so it's clear it actually does something.
also having the bzr check code in openlp.
Further rants:
in setup.py the code is not actually exactly the same, there are modifications and there is a comment that it is a duplicate of the no longer existing openlp.
This illustrates that comments are bad for the reason that they are often not updated when the code changes. This can lead to comments confusing more than helping.
In short:
Remove the flag, remove the code from get_version and only have it in setup.py
The flag is only useful for people running from bzr so devs, which should know what they are running and even if they don't they should know how to get that information without reverting to the about tab.
Related branches
- Tomas Groth: Approve
-
Diff: 633 lines (+405/-77)8 files modifiedopenlp/.version (+1/-1)
openlp/core/app.py (+21/-25)
openlp/core/common/i18n.py (+1/-1)
openlp/core/server.py (+109/-0)
openlp/core/version.py (+6/-42)
tests/functional/openlp_core/api/http/test_init.py (+151/-0)
tests/functional/openlp_core/test_app.py (+2/-8)
tests/functional/openlp_core/test_server.py (+114/-0)
Changed in openlp: | |
assignee: | nobody → Tim Bentley (trb143) |
status: | Won't Fix → In Progress |
importance: | Undecided → Low |
Changed in openlp: | |
milestone: | none → 2.9.1 |
status: | In Progress → Fix Committed |
This works fine and does provide so real functionality.
without the -d file shows the version from the .version file which is controlled from bzr code and matches the main code version.
with the -d uses the version from bzr and changes the version information using bzr tags.
This is useful for when testing automated upgrades.
Unless you are a dev or running code versions you will not know about this so it is not an issue.