diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 41101e8ff..3d49533dd 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -64,8 +64,7 @@ class Ui_PrintServiceDialog(object): 'Options')) self.optionsButton.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon) - self.optionsButton.setIcon(QtGui.QIcon( - build_icon(u':/system/system_configure.png'))) + self.optionsButton.setIcon(build_icon(u':/system/system_configure.png')) self.optionsButton.setCheckable(True) self.toolbar.addWidget(self.optionsButton) self.closeButton = self.toolbar.addAction( @@ -80,24 +79,23 @@ class Ui_PrintServiceDialog(object): translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoomInButton = QtGui.QToolButton(self.toolbar) - self.zoomInButton.setIcon(QtGui.QIcon( - build_icon(u':/general/general_zoom_in.png'))) + self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png')) self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom In')) self.zoomInButton.setObjectName(u'zoomInButton') self.zoomInButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomInButton) self.zoomOutButton = QtGui.QToolButton(self.toolbar) - self.zoomOutButton.setIcon(QtGui.QIcon( - build_icon(u':/general/general_zoom_out.png'))) + self.zoomOutButton.setIcon( + build_icon(u':/general/general_zoom_out.png')) self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Out')) self.zoomOutButton.setObjectName(u'zoomOutButton') self.zoomOutButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomOutButton) self.zoomOriginalButton = QtGui.QToolButton(self.toolbar) - self.zoomOriginalButton.setIcon(QtGui.QIcon( - build_icon(u':/general/general_zoom_original.png'))) + self.zoomOriginalButton.setIcon( + build_icon(u':/general/general_zoom_original.png')) self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Original')) self.zoomOriginalButton.setObjectName(u'zoomOriginalButton') diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 54b48cdf6..4ee2e84e0 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -44,7 +44,7 @@ if sys.platform != u'win32' and sys.platform != u'darwin': XDG_BASE_AVAILABLE = False import openlp -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver, translate, check_directory_exists log = logging.getLogger(__name__) IMAGES_FILTER = None @@ -146,8 +146,7 @@ class AppLocation(object): Return the path OpenLP stores all its data under. """ path = AppLocation.get_directory(AppLocation.DataDir) - if not os.path.exists(path): - os.makedirs(path) + check_directory_exists(path) return path @staticmethod @@ -157,8 +156,7 @@ class AppLocation(object): """ data_path = AppLocation.get_data_path() path = os.path.join(data_path, section) - if not os.path.exists(path): - os.makedirs(path) + check_directory_exists(path) return path def _get_os_dir_path(dir_type):