forked from openlp/openlp
clean ups
This commit is contained in:
parent
6f353ab01d
commit
3c69631b59
@ -39,7 +39,8 @@ log = logging.getLogger(__name__)
|
||||
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 @@ class ServiceManager(QtGui.QWidget):
|
||||
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'))
|
||||
|
@ -227,9 +227,6 @@ class ImpressDocument(PresentationDocument):
|
||||
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':
|
||||
|
@ -119,10 +119,7 @@ class PowerpointDocument(PresentationDocument):
|
||||
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:
|
||||
|
@ -118,9 +118,6 @@ class PptviewDocument(PresentationDocument):
|
||||
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
|
||||
|
@ -47,7 +47,7 @@ class PresentationDocument(object):
|
||||
|
||||
**Hook Functions**
|
||||
|
||||
``load_presentation(presentation)``
|
||||
``load_presentation()``
|
||||
Load a presentation file
|
||||
|
||||
``close_presentation()``
|
||||
@ -104,11 +104,8 @@ class PresentationDocument(object):
|
||||
|
||||
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
|
||||
"""
|
||||
|
@ -34,7 +34,7 @@ import shutil
|
||||
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 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
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()):
|
||||
|
@ -36,7 +36,8 @@ from PyQt4 import QtCore, QtGui
|
||||
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 @@ class SongMediaItem(MediaManagerItem):
|
||||
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),
|
||||
|
@ -33,7 +33,7 @@ import os
|
||||
|
||||
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 @@ class SongImport(QtCore.QObject):
|
||||
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])
|
||||
|
Loading…
Reference in New Issue
Block a user