openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #06855
[Merge] lp:~j-corwin/openlp/general into lp:openlp
Jonathan Corwin has proposed merging lp:~j-corwin/openlp/general into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #634771 in OpenLP: "OpenLP 1.9.2+bzr1016-0ubuntu1~lucid1 does not start"
https://bugs.launchpad.net/openlp/+bug/634771
Bug #646718 in OpenLP: "Songbook, Number will not loaded, Title will not be saved"
https://bugs.launchpad.net/openlp/+bug/646718
For more details, see:
https://code.launchpad.net/~j-corwin/openlp/general/+merge/52938
Songs of Fellowship and Generic Document imports work once again
--
https://code.launchpad.net/~j-corwin/openlp/general/+merge/52938
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/general into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/oooimport.py'
--- openlp/plugins/songs/lib/oooimport.py 2011-02-24 15:54:21 +0000
+++ openlp/plugins/songs/lib/oooimport.py 2011-03-10 22:31:34 +0000
@@ -96,7 +96,7 @@
"""
if os.name == u'nt':
self.start_ooo_process()
- self.desktop = self.manager.createInstance(
+ self.desktop = self.ooo_manager.createInstance(
u'com.sun.star.frame.Desktop')
else:
context = uno.getComponentContext()
@@ -118,9 +118,9 @@
def start_ooo_process(self):
try:
if os.name == u'nt':
- self.manager = Dispatch(u'com.sun.star.ServiceManager')
- self.manager._FlagAsMethod(u'Bridge_GetStruct')
- self.manager._FlagAsMethod(u'Bridge_GetValueObject')
+ self.ooo_manager = Dispatch(u'com.sun.star.ServiceManager')
+ self.ooo_manager._FlagAsMethod(u'Bridge_GetStruct')
+ self.ooo_manager._FlagAsMethod(u'Bridge_GetValueObject')
else:
cmd = get_uno_command()
process = QtCore.QProcess()
@@ -134,9 +134,11 @@
"""
Open the passed file in OpenOffice.org Impress
"""
+ self.filepath = filepath
if os.name == u'nt':
- url = u'file:///' + filepath.replace(u'\\', u'/')
+ url = filepath.replace(u'\\', u'/')
url = url.replace(u':', u'|').replace(u' ', u'%20')
+ url = u'file:///' + url
else:
url = uno.systemPathToFileUrl(filepath)
properties = []
@@ -190,7 +192,6 @@
if slidetext.strip() == u'':
slidetext = u'\f'
text += slidetext
- song = SongImport(self.manager)
songs = SongImport.process_songs_text(self.manager, text)
for song in songs:
song.finish()
=== modified file 'openlp/plugins/songs/lib/songimport.py'
--- openlp/plugins/songs/lib/songimport.py 2011-03-06 16:28:26 +0000
+++ openlp/plugins/songs/lib/songimport.py 2011-03-10 22:31:34 +0000
@@ -55,13 +55,14 @@
"""
self.manager = manager
QtCore.QObject.__init__(self)
- if kwargs.has_key(u'filename'):
- self.import_source = kwargs[u'filename']
- elif kwargs.has_key(u'filenames'):
- self.import_source = kwargs[u'filenames']
- else:
- raise KeyError(u'Keyword arguments "filename[s]" not supplied.')
- log.debug(self.import_source)
+ if kwargs:
+ if kwargs.has_key(u'filename'):
+ self.import_source = kwargs[u'filename']
+ elif kwargs.has_key(u'filenames'):
+ self.import_source = kwargs[u'filenames']
+ else:
+ raise KeyError(u'Keyword arguments "filename[s]" not supplied.')
+ log.debug(self.import_source)
self.song = None
self.stop_import_flag = False
self.set_defaults()
@@ -146,12 +147,12 @@
def process_verse_text(self, text):
lines = text.split(u'\n')
if text.lower().find(self.copyright_string) >= 0 \
- or text.find(SongStrings.CopyrightSymbol) >= 0:
+ or text.find(unicode(SongStrings.CopyrightSymbol)) >= 0:
copyright_found = False
for line in lines:
if (copyright_found or
line.lower().find(self.copyright_string) >= 0 or
- line.find(SongStrings.CopyrightSymbol) >= 0):
+ line.find(unicode(SongStrings.CopyrightSymbol)) >= 0):
copyright_found = True
self.add_copyright(line)
else:
Follow ups