openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #32787
[Merge] lp:~thelinuxguy/openlp/remove-version-check into lp:openlp
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/remove-version-check into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #1751626 in OpenLP: "-d flag is used in a very confusing way"
https://bugs.launchpad.net/openlp/+bug/1751626
For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/remove-version-check/+merge/342063
Remove the -d flag from cli arguments and don't show bzr revision in about page
--
Your team OpenLP Core is requested to review the proposed merge of lp:~thelinuxguy/openlp/remove-version-check into lp:openlp.
=== modified file '.bzrignore'
--- .bzrignore 2017-12-29 10:40:07 +0000
+++ .bzrignore 2018-03-25 15:06:59 +0000
@@ -46,3 +46,4 @@
htmlcov
openlp-test-projectordb.sqlite
.cache
+.pytest_cache
=== modified file 'openlp/core/app.py'
--- openlp/core/app.py 2018-02-03 12:03:37 +0000
+++ openlp/core/app.py 2018-03-25 15:06:59 +0000
@@ -303,8 +303,6 @@
parser.add_argument('-p', '--portable', dest='portable', action='store_true',
help='Specify if this should be run as a portable app, '
'off a USB flash drive (not implemented).')
- parser.add_argument('-d', '--dev-version', dest='dev_version', action='store_true',
- help='Ignore the version file and pull the version directly from Bazaar')
parser.add_argument('-w', '--no-web-server', dest='no_web_server', action='store_true',
help='Turn off the Web and Socket Server ')
parser.add_argument('rargs', nargs='?', default=[])
=== modified file 'openlp/core/version.py'
--- openlp/core/version.py 2018-01-04 06:10:20 +0000
+++ openlp/core/version.py 2018-03-25 15:06:59 +0000
@@ -136,42 +136,7 @@
global APPLICATION_VERSION
if APPLICATION_VERSION:
return APPLICATION_VERSION
- if '--dev-version' in sys.argv or '-d' in sys.argv:
- # NOTE: The following code is a duplicate of the code in setup.py. Any fix applied here should also be applied
- # there.
-
- # Get the revision of this tree.
- bzr = Popen(('bzr', 'revno'), stdout=PIPE)
- tree_revision, error = bzr.communicate()
- tree_revision = tree_revision.decode()
- code = bzr.wait()
- if code != 0:
- raise Exception('Error running bzr log')
-
- # Get all tags.
- bzr = Popen(('bzr', 'tags'), stdout=PIPE)
- output, error = bzr.communicate()
- code = bzr.wait()
- if code != 0:
- raise Exception('Error running bzr tags')
- tags = list(map(bytes.decode, output.splitlines()))
- if not tags:
- tag_version = '0.0.0'
- tag_revision = '0'
- else:
- # Remove any tag that has "?" as revision number. A "?" as revision number indicates, that this tag is from
- # another series.
- tags = [tag for tag in tags if tag.split()[-1].strip() != '?']
- # Get the last tag and split it in a revision and tag name.
- tag_version, tag_revision = tags[-1].split()
- # If they are equal, then this tree is tarball with the source for the release. We do not want the revision
- # number in the full version.
- if tree_revision == tag_revision:
- full_version = tag_version.strip()
- else:
- full_version = '{tag}-bzr{tree}'.format(tag=tag_version.strip(), tree=tree_revision.strip())
else:
- # We're not running the development version, let's use the file.
file_path = AppLocation.get_directory(AppLocation.VersionDir) / '.version'
try:
full_version = file_path.read_text().rstrip()
=== modified file 'tests/functional/openlp_core/test_app.py'
--- tests/functional/openlp_core/test_app.py 2018-01-07 05:24:55 +0000
+++ tests/functional/openlp_core/test_app.py 2018-03-25 15:06:59 +0000
@@ -41,7 +41,6 @@
args = parse_options()
# THEN: the following fields will have been extracted.
- assert args.dev_version is False, 'The dev_version flag should be False'
assert args.loglevel == 'warning', 'The log level should be set to warning'
assert args.no_error_form is False, 'The no_error_form should be set to False'
assert args.portable is False, 'The portable flag should be set to false'
@@ -59,7 +58,6 @@
args = parse_options()
# THEN: the following fields will have been extracted.
- assert args.dev_version is False, 'The dev_version flag should be False'
assert args.loglevel == ' debug', 'The log level should be set to debug'
assert args.no_error_form is False, 'The no_error_form should be set to False'
assert args.portable is False, 'The portable flag should be set to false'
@@ -77,7 +75,6 @@
args = parse_options()
# THEN: the following fields will have been extracted.
- assert args.dev_version is False, 'The dev_version flag should be False'
assert args.loglevel == 'warning', 'The log level should be set to warning'
assert args.no_error_form is False, 'The no_error_form should be set to False'
assert args.portable is True, 'The portable flag should be set to true'
@@ -89,16 +86,15 @@
Test the parse options process works with two options
"""
# GIVEN: a a set of system arguments.
- sys.argv[1:] = ['-l debug', '-d']
+ sys.argv[1:] = ['-l debug', '-p']
# WHEN: We we parse them to expand to options
args = parse_options()
# THEN: the following fields will have been extracted.
- assert args.dev_version is True, 'The dev_version flag should be True'
assert args.loglevel == ' debug', 'The log level should be set to debug'
assert args.no_error_form is False, 'The no_error_form should be set to False'
- assert args.portable is False, 'The portable flag should be set to false'
+ assert args.portable is True, 'The portable flag should be set to false'
assert args.rargs == [], 'The service file should be blank'
@@ -113,7 +109,6 @@
args = parse_options()
# THEN: the following fields will have been extracted.
- assert args.dev_version is False, 'The dev_version flag should be False'
assert args.loglevel == 'warning', 'The log level should be set to warning'
assert args.no_error_form is False, 'The no_error_form should be set to False'
assert args.portable is False, 'The portable flag should be set to false'
@@ -131,7 +126,6 @@
args = parse_options()
# THEN: the following fields will have been extracted.
- assert args.dev_version is False, 'The dev_version flag should be False'
assert args.loglevel == ' debug', 'The log level should be set to debug'
assert args.no_error_form is False, 'The no_error_form should be set to False'
assert args.portable is False, 'The portable flag should be set to false'
Follow ups