From aa0b49290de0bfa66230ebcc56d91ad5ca2e2680 Mon Sep 17 00:00:00 2001 From: M2j Date: Thu, 20 Oct 2011 22:11:06 +0200 Subject: [PATCH 1/2] add version information for mako, migrate and uno to exceptionform --- openlp/core/ui/exceptionform.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index c5fc678e2..18b36914d 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -39,6 +39,11 @@ try: PHONON_VERSION = Phonon.phononVersion() except ImportError: PHONON_VERSION = u'-' +try: + import migrate + MIGRATE_VERSION = migrate.__version__ +except ImportError: + MIGRATE_VERSION = u'-' try: import chardet CHARDET_VERSION = chardet.__version__ @@ -54,6 +59,24 @@ try: SQLITE_VERSION = sqlite.version except ImportError: SQLITE_VERSION = u'-' +try: + import mako + MAKO_VERSION = mako.__version__ +except ImportError: + MAKO_VERSION = u'-' +try: + import uno + arg = uno.createUnoStruct(u'com.sun.star.beans.PropertyValue') + arg.Name = u'nodepath' + arg.Value = u'/org.openoffice.Setup/Product' + context = uno.getComponentContext() + provider = context.ServiceManager.createInstance( + u'com.sun.star.configuration.ConfigurationProvider') + node = provider.createInstanceWithArguments( + u'com.sun.star.configuration.ConfigurationAccess', (arg,)) + UNO_VERSION = node.getByName(u'ooSetupVersion') +except ImportError: + UNO_VERSION = u'-' from openlp.core.lib import translate, SettingsManager from openlp.core.lib.ui import UiStrings @@ -89,11 +112,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): u'Phonon: %s\n' % PHONON_VERSION + \ u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \ u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \ + u'SQLAlchemy Migrate: %s\n' % MIGRATE_VERSION + \ u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \ u'lxml: %s\n' % etree.__version__ + \ u'Chardet: %s\n' % CHARDET_VERSION + \ u'PyEnchant: %s\n' % ENCHANT_VERSION + \ - u'PySQLite: %s\n' % SQLITE_VERSION + u'PySQLite: %s\n' % SQLITE_VERSION + \ + u'Mako: %s\n' % MAKO_VERSION + \ + u'pyUNO bridge: %s\n' % UNO_VERSION if platform.system() == u'Linux': if os.environ.get(u'KDE_FULL_SESSION') == u'true': system = system + u'Desktop: KDE SC\n' From 5a415311a5abb89a6f3f49e77adb20668f3a89c3 Mon Sep 17 00:00:00 2001 From: M2j Date: Sat, 22 Oct 2011 14:30:21 +0200 Subject: [PATCH 2/2] Correction for Migrate version smaller than 0.7 --- openlp/core/ui/exceptionform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 18b36914d..10fee7f6f 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -41,7 +41,7 @@ except ImportError: PHONON_VERSION = u'-' try: import migrate - MIGRATE_VERSION = migrate.__version__ + MIGRATE_VERSION = getattr(migrate, u'__version__', u'< 0.7') except ImportError: MIGRATE_VERSION = u'-' try: