Changed import re-start message. Removed need for "import string"

This commit is contained in:
Stevan Pettit 2011-08-25 14:40:44 -04:00
parent 215abd2966
commit d927adbe5a

View File

@ -27,7 +27,7 @@
import logging import logging
import os import os
import sys, string import sys
import shutil import shutil
from tempfile import gettempdir from tempfile import gettempdir
from datetime import datetime from datetime import datetime
@ -936,8 +936,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
for sectionKey in importKeys: for sectionKey in importKeys:
# We need to handle the really bad files. # We need to handle the really bad files.
try: try:
section, key = string.split(sectionKey, u'/') section, key = sectionKey.split(u'/')
except: except ValueError:
section = u'unknown' section = u'unknown'
key = u'' key = u''
# Switch General back to lowercase. # Switch General back to lowercase.
@ -976,7 +976,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
translate('OpenLP.MainWindow', 'Import settings'), translate('OpenLP.MainWindow', 'Import settings'),
translate('OpenLP.MainWindow', translate('OpenLP.MainWindow',
'OpenLP will now close. Imported settings will ' 'OpenLP will now close. Imported settings will '
'take place the next time you start OpenLP'), 'be applied the next time you start OpenLP.'),
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok)) QtGui.QMessageBox.Ok))
self.settingsImported = True self.settingsImported = True
@ -1037,7 +1037,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
exportSettings.endGroup() exportSettings.endGroup()
# Write all the sections and keys. # Write all the sections and keys.
for sectionKey in keys: for sectionKey in keys:
section, key = string.split(sectionKey, u'/') section, key = sectionKey.split(u'/')
keyValue = settings.value(sectionKey) keyValue = settings.value(sectionKey)
sectionKey = section + u"/" + key sectionKey = section + u"/" + key
# Change the service section to servicemanager. # Change the service section to servicemanager.