r2144 + conflict

This commit is contained in:
Andreas Preikschat 2013-01-15 22:26:45 +01:00
commit ca60c230ba
5 changed files with 26 additions and 15 deletions

View File

@ -1 +1 @@
2.0 2.1.0-bzr2141

View File

@ -124,7 +124,8 @@ class Settings(QtCore.QSettings):
u'general/auto unblank': False, u'general/auto unblank': False,
u'general/display on monitor': True, u'general/display on monitor': True,
u'general/audio start paused': True, u'general/audio start paused': True,
u'general/last version test': datetime.datetime.now().date(), # This defaults to yesterday in order to force the update check to run when you've never run it before.
u'general/last version test': datetime.datetime.now().date() - timedelta(days=1),
u'general/blank warning': False, u'general/blank warning': False,
u'players/background color': u'#000000', u'players/background color': u'#000000',
u'servicemanager/service theme': u'', u'servicemanager/service theme': u'',

View File

@ -29,12 +29,13 @@
""" """
The :mod:`openlp.core.utils` module provides the utility libraries for OpenLP. The :mod:`openlp.core.utils` module provides the utility libraries for OpenLP.
""" """
from datetime import datetime from datetime import datetime, timedelta
from distutils.version import LooseVersion from distutils.version import LooseVersion
import logging import logging
import locale import locale
import os import os
import re import re
from reportlab.graphics.charts.utils import seconds2str
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
import sys import sys
import urllib2 import urllib2
@ -277,6 +278,12 @@ def check_latest_version(current_version):
``current_version`` ``current_version``
The current version of OpenLP. The current version of OpenLP.
**Rules around versions and version files:**
* If a version number has a build (i.e. -bzr1234), then it is a nightly.
* If a version number's minor version is an odd number, it is a development release.
* If a version number's minor version is an even number, it is a stable release.
""" """
version_string = current_version[u'full'] version_string = current_version[u'full']
# set to prod in the distribution config file. # set to prod in the distribution config file.
@ -288,9 +295,13 @@ def check_latest_version(current_version):
settings.endGroup() settings.endGroup()
if last_test != this_test: if last_test != this_test:
if current_version[u'build']: if current_version[u'build']:
req = urllib2.Request(u'http://www.openlp.org/files/dev_version.txt') req = urllib2.Request(u'http://www.openlp.org/files/nightly_version.txt')
else: else:
req = urllib2.Request(u'http://www.openlp.org/files/version.txt') version_parts = current_version[u'version'].split(u'.')
if int(version_parts[1]) % 2 != 0:
req = urllib2.Request(u'http://www.openlp.org/files/dev_version.txt')
else:
req = urllib2.Request(u'http://www.openlp.org/files/version.txt')
req.add_header(u'User-Agent', u'OpenLP/%s' % current_version[u'full']) req.add_header(u'User-Agent', u'OpenLP/%s' % current_version[u'full'])
remote_version = None remote_version = None
try: try:

View File

@ -38,6 +38,7 @@ modules, simply run this script::
""" """
import os import os
import sys import sys
from distutils.version import LooseVersion
is_win = sys.platform.startswith('win') is_win = sys.platform.startswith('win')
@ -89,15 +90,13 @@ OPTIONAL_MODULES = [
w = sys.stdout.write w = sys.stdout.write
def check_vers(version, required, text): def check_vers(version, required, text):
if type(version) is str: if type(version) is not str:
version = version.split('.') version = '.'.join(map(str, version))
version = map(int, version) if type(required) is not str:
if type(required) is str: required = '.'.join(map(str, required))
required = required.split('.') w(' %s >= %s ... ' % (text, required))
required = map(int, required) if LooseVersion(version) >= LooseVersion(required):
w(' %s >= %s ... ' % (text, '.'.join(map(str, required)))) w(version + os.linesep)
if version >= required:
w('.'.join(map(str, version)) + os.linesep)
return True return True
else: else:
w('FAIL' + os.linesep) w('FAIL' + os.linesep)

View File

@ -3,7 +3,7 @@ Package to test the openlp.core.lib package.
""" """
from unittest import TestCase from unittest import TestCase
from mock import MagicMock, patch, call from mock import MagicMock, patch
from openlp.core.lib import str_to_bool, translate, check_directory_exists, get_text_file_string from openlp.core.lib import str_to_bool, translate, check_directory_exists, get_text_file_string