refactoring

This commit is contained in:
Andreas Preikschat 2011-06-25 15:47:46 +02:00
parent 14e2ce6b64
commit 4f955f25d7

View File

@ -31,7 +31,8 @@ import shutil
from PyQt4 import QtCore from PyQt4 import QtCore
from openlp.core.lib import Receiver, create_thumb, resize_image, validate_thumb from openlp.core.lib import Receiver, check_directory_exists, create_thumb, \
resize_image, validate_thumb
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -97,8 +98,7 @@ class PresentationDocument(object):
self.slidenumber = 0 self.slidenumber = 0
self.controller = controller self.controller = controller
self.filepath = name self.filepath = name
if not os.path.isdir(self.get_thumbnail_folder()): check_directory_exists(self.get_thumbnail_folder())
os.mkdir(self.get_thumbnail_folder())
def load_presentation(self): def load_presentation(self):
""" """
@ -385,10 +385,8 @@ class PresentationController(object):
AppLocation.get_section_data_path(self.settings_section), AppLocation.get_section_data_path(self.settings_section),
u'thumbnails') u'thumbnails')
self.thumbnail_prefix = u'slide' self.thumbnail_prefix = u'slide'
if not os.path.isdir(self.thumbnail_folder): check_directory_exists(self.thumbnail_folder)
os.makedirs(self.thumbnail_folder) check_directory_exists(self.temp_folder)
if not os.path.isdir(self.temp_folder):
os.makedirs(self.temp_folder)
def enabled(self): def enabled(self):
""" """