← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol/openlp/trivial into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol/openlp/trivial into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~googol/openlp/trivial/+merge/113827

clean ups

-- 
https://code.launchpad.net/~googol/openlp/trivial/+merge/113827
Your team OpenLP Core is requested to review the proposed merge of lp:~googol/openlp/trivial into lp:openlp.
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2012-06-22 14:14:53 +0000
+++ openlp/core/ui/servicemanager.py	2012-07-07 15:41:20 +0000
@@ -39,7 +39,8 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import OpenLPToolbar, ServiceItem, Receiver, build_icon, \
-    ItemCapabilities, SettingsManager, translate, str_to_bool
+    ItemCapabilities, SettingsManager, translate, str_to_bool, \
+    check_directory_exists
 from openlp.core.lib.theme import ThemeLevel
 from openlp.core.lib.settings import Settings
 from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
@@ -556,8 +557,7 @@
                     audio_from = os.path.join(self.servicePath, audio_from)
                 save_file = os.path.join(self.servicePath, audio_to)
                 save_path = os.path.split(save_file)[0]
-                if not os.path.exists(save_path):
-                    os.makedirs(save_path)
+                check_directory_exists(save_path)
                 if not os.path.exists(save_file):
                     shutil.copy(audio_from, save_file)
                 zip.write(audio_from, audio_to.encode(u'utf-8'))

=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py	2012-07-07 15:41:20 +0000
@@ -227,9 +227,6 @@
         OpenOffice task started earlier. If OpenOffice is not present is is
         started. Once the environment is available the presentation is loaded
         and started.
-
-        ``presentation``
-        The file name of the presentatios to the run.
         """
         log.debug(u'Load Presentation OpenOffice')
         if os.name == u'nt':

=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
--- openlp/plugins/presentations/lib/powerpointcontroller.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/presentations/lib/powerpointcontroller.py	2012-07-07 15:41:20 +0000
@@ -119,10 +119,7 @@
     def load_presentation(self):
         """
         Called when a presentation is added to the SlideController.
-        Opens the PowerPoint file using the process created earlier
-
-        ``presentation``
-            The file name of the presentations to run.
+        Opens the PowerPoint file using the process created earlier.
         """
         log.debug(u'load_presentation')
         if not self.controller.process or not self.controller.process.Visible:

=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py	2012-07-07 15:41:20 +0000
@@ -118,9 +118,6 @@
         Called when a presentation is added to the SlideController.
         It builds the environment, starts communcations with the background
         PptView task started earlier.
-
-        ``presentation``
-        The file name of the presentations to run.
         """
         log.debug(u'LoadPresentation')
         renderer = self.controller.plugin.renderer

=== modified file 'openlp/plugins/presentations/lib/presentationcontroller.py'
--- openlp/plugins/presentations/lib/presentationcontroller.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/presentations/lib/presentationcontroller.py	2012-07-07 15:41:20 +0000
@@ -47,7 +47,7 @@
 
     **Hook Functions**
 
-    ``load_presentation(presentation)``
+    ``load_presentation()``
         Load a presentation file
 
     ``close_presentation()``
@@ -104,11 +104,8 @@
 
     def load_presentation(self):
         """
-        Called when a presentation is added to the SlideController.
-        Loads the presentation and starts it
-
-        ``presentation``
-            The file name of the presentations to the run.
+        Called when a presentation is added to the SlideController. Loads the
+        presentation and starts it.
 
         Returns False if the file could not be opened
         """

=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2012-07-07 15:41:20 +0000
@@ -34,7 +34,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import PluginStatus, Receiver, MediaType, translate, \
-    create_separated_list
+    create_separated_list, check_directory_exists
 from openlp.core.lib.ui import UiStrings, set_case_insensitive_completer, \
     critical_error_message_box, find_and_set_in_combo_box
 from openlp.core.utils import AppLocation
@@ -880,8 +880,7 @@
         save_path = os.path.join(
             AppLocation.get_section_data_path(self.mediaitem.plugin.name),
             'audio', str(self.song.id))
-        if not os.path.exists(save_path):
-            os.makedirs(save_path)
+        check_directory_exists(save_path)
         self.song.media_files = []
         files = []
         for row in xrange(self.audioListWidget.count()):

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2012-06-26 04:40:07 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2012-07-07 15:41:20 +0000
@@ -36,7 +36,8 @@
 from sqlalchemy.sql import or_
 
 from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
-    translate, check_item_selected, PluginStatus, create_separated_list
+    translate, check_item_selected, PluginStatus, create_separated_list, \
+    check_directory_exists
 from openlp.core.lib.ui import UiStrings, create_widget_action
 from openlp.core.lib.settings import Settings
 from openlp.core.utils import AppLocation
@@ -89,8 +90,7 @@
             dest_file = os.path.join(
                 AppLocation.get_section_data_path(self.plugin.name),
                 u'audio', str(song.id), os.path.split(bga)[1])
-            if not os.path.exists(os.path.split(dest_file)[0]):
-                os.makedirs(os.path.split(dest_file)[0])
+            check_directory_exists(os.path.split(dest_file)[0])
             shutil.copyfile(os.path.join(
                 AppLocation.get_section_data_path(
                     u'servicemanager'), bga),

=== modified file 'openlp/plugins/songs/lib/songimport.py'
--- openlp/plugins/songs/lib/songimport.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/songs/lib/songimport.py	2012-07-07 15:41:20 +0000
@@ -33,7 +33,7 @@
 
 from PyQt4 import QtCore
 
-from openlp.core.lib import Receiver, translate
+from openlp.core.lib import Receiver, translate, check_directory_exists
 from openlp.core.ui.wizard import WizardStrings
 from openlp.core.utils import AppLocation
 from openlp.plugins.songs.lib import clean_song, VerseType
@@ -388,8 +388,7 @@
                 AppLocation.get_section_data_path(
                     self.importWizard.plugin.name),
                 'audio', str(song_id))
-        if not os.path.exists(self.save_path):
-            os.makedirs(self.save_path)
+        check_directory_exists(self.save_path)
         if not filename.startswith(self.save_path):
             oldfile, filename = filename, os.path.join(self.save_path,
                 os.path.split(filename)[1])


Follow ups