forked from openlp/openlp
Cleanups
bzr-revno: 1098
This commit is contained in:
commit
e10ecdf3c2
@ -25,7 +25,6 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
try:
|
try:
|
||||||
import enchant
|
import enchant
|
||||||
from enchant import DictNotFoundError
|
from enchant import DictNotFoundError
|
||||||
@ -37,7 +36,7 @@ except ImportError:
|
|||||||
# http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/
|
# http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from openlp.core.lib import html_expands, translate, context_menu_action
|
from openlp.core.lib import html_expands, translate
|
||||||
|
|
||||||
class SpellTextEdit(QtGui.QPlainTextEdit):
|
class SpellTextEdit(QtGui.QPlainTextEdit):
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
|
@ -87,12 +87,12 @@ class ThemeLevel(object):
|
|||||||
Service = 2
|
Service = 2
|
||||||
Song = 3
|
Song = 3
|
||||||
|
|
||||||
boolean_list = [u'italics', u'override', u'outline', u'shadow', \
|
boolean_list = [u'italics', u'override', u'outline', u'shadow',
|
||||||
u'slide_transition']
|
u'slide_transition']
|
||||||
|
|
||||||
integer_list =[u'proportion', u'line_adjustment', u'x', u'height', u'y', \
|
integer_list = [u'proportion', u'line_adjustment', u'x', u'height', u'y',
|
||||||
u'width', u'shadow_size', u'outline_size', u'horizontal_align', \
|
u'width', u'shadow_size', u'outline_size', u'horizontal_align',
|
||||||
u'vertical_align', u'wrap_style' ]
|
u'vertical_align', u'wrap_style']
|
||||||
|
|
||||||
class ThemeXML(object):
|
class ThemeXML(object):
|
||||||
"""
|
"""
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from exceptiondialog import Ui_ExceptionDialog
|
from exceptiondialog import Ui_ExceptionDialog
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from filerenamedialog import Ui_FileRenameDialog
|
from filerenamedialog import Ui_FileRenameDialog
|
||||||
from openlp.core.lib import translate
|
|
||||||
|
|
||||||
class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
|
class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
|
||||||
"""
|
"""
|
||||||
|
@ -34,9 +34,8 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
from openlp.core.ui import AmendThemeForm, FileRenameForm
|
from openlp.core.ui import AmendThemeForm, FileRenameForm
|
||||||
from openlp.core.theme import Theme
|
from openlp.core.theme import Theme
|
||||||
from openlp.core.lib import OpenLPToolbar, context_menu_action, \
|
from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \
|
||||||
ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \
|
build_icon, Receiver, SettingsManager, translate, check_item_selected
|
||||||
context_menu_separator, SettingsManager, translate, check_item_selected
|
|
||||||
from openlp.core.utils import AppLocation, get_filesystem_encoding
|
from openlp.core.utils import AppLocation, get_filesystem_encoding
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -267,7 +266,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
filename = \
|
filename = \
|
||||||
os.path.split(unicode(oldThemeData.background_filename))[1]
|
os.path.split(unicode(oldThemeData.background_filename))[1]
|
||||||
new_theme.add_background_image(filename)
|
new_theme.add_background_image(filename)
|
||||||
save_to = os.path.join(self.path, theme_name, filename)
|
save_to = os.path.join(self.path, newThemeName, filename)
|
||||||
save_from = oldThemeData.background_filename
|
save_from = oldThemeData.background_filename
|
||||||
new_theme.add_font(unicode(oldThemeData.font_main_name),
|
new_theme.add_font(unicode(oldThemeData.font_main_name),
|
||||||
unicode(oldThemeData.font_main_color),
|
unicode(oldThemeData.font_main_color),
|
||||||
|
@ -28,7 +28,6 @@ The :mod:`languagemanager` module provides all the translation settings and
|
|||||||
language file loading for OpenLP.
|
language file loading for OpenLP.
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ from PyQt4 import QtCore, QtGui
|
|||||||
from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \
|
from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \
|
||||||
ItemCapabilities, translate
|
ItemCapabilities, translate
|
||||||
from openlp.plugins.bibles.forms import BibleImportForm
|
from openlp.plugins.bibles.forms import BibleImportForm
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate
|
|
||||||
from editcustomslidedialog import Ui_CustomSlideEditDialog
|
from editcustomslidedialog import Ui_CustomSlideEditDialog
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -28,7 +28,6 @@ The :mod:`ewimport` module provides the functionality for importing
|
|||||||
EasyWorship song databases into the current installation database.
|
EasyWorship song databases into the current installation database.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
@ -192,8 +191,9 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
num_fields)
|
num_fields)
|
||||||
field_names.pop()
|
field_names.pop()
|
||||||
field_descs = []
|
field_descs = []
|
||||||
for i,field_name in enumerate(field_names):
|
for i, field_name in enumerate(field_names):
|
||||||
field_type, field_size = struct.unpack_from('BB', field_info, i * 2)
|
field_type, field_size = struct.unpack_from('BB',
|
||||||
|
field_info, i * 2)
|
||||||
field_descs.append(FieldDescEntry(field_name, field_type,
|
field_descs.append(FieldDescEntry(field_name, field_type,
|
||||||
field_size))
|
field_size))
|
||||||
self.set_record_struct(field_descs)
|
self.set_record_struct(field_descs)
|
||||||
@ -272,7 +272,7 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
return success
|
return success
|
||||||
|
|
||||||
def find_field(self, field_name):
|
def find_field(self, field_name):
|
||||||
return [i for i,x in enumerate(self.field_descs) \
|
return [i for i, x in enumerate(self.field_descs) \
|
||||||
if x.name == field_name][0]
|
if x.name == field_name][0]
|
||||||
|
|
||||||
def set_record_struct(self, field_descs):
|
def set_record_struct(self, field_descs):
|
||||||
@ -331,7 +331,7 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
# Memo or Blob
|
# Memo or Blob
|
||||||
block_start, blob_size = \
|
block_start, blob_size = \
|
||||||
struct.unpack_from('<II', field, len(field)-10)
|
struct.unpack_from('<II', field, len(field)-10)
|
||||||
sub_block = block_start & 0xff;
|
sub_block = block_start & 0xff
|
||||||
block_start &= ~0xff
|
block_start &= ~0xff
|
||||||
self.memo_file.seek(block_start)
|
self.memo_file.seek(block_start)
|
||||||
memo_block_type, = struct.unpack('b', self.memo_file.read(1))
|
memo_block_type, = struct.unpack('b', self.memo_file.read(1))
|
||||||
@ -339,12 +339,12 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
self.memo_file.seek(8, os.SEEK_CUR)
|
self.memo_file.seek(8, os.SEEK_CUR)
|
||||||
elif memo_block_type == 3:
|
elif memo_block_type == 3:
|
||||||
if sub_block > 63:
|
if sub_block > 63:
|
||||||
return u'';
|
return u''
|
||||||
self.memo_file.seek(11 + (5 * sub_block), os.SEEK_CUR)
|
self.memo_file.seek(11 + (5 * sub_block), os.SEEK_CUR)
|
||||||
sub_block_start, = struct.unpack('B', self.memo_file.read(1))
|
sub_block_start, = struct.unpack('B', self.memo_file.read(1))
|
||||||
self.memo_file.seek(block_start + (sub_block_start * 16))
|
self.memo_file.seek(block_start + (sub_block_start * 16))
|
||||||
else:
|
else:
|
||||||
return u'';
|
return u''
|
||||||
return self.memo_file.read(blob_size)
|
return self.memo_file.read(blob_size)
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
@ -29,7 +29,6 @@ The :mod:`songbeamerimport` module provides the functionality for importing
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import chardet
|
import chardet
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user