Change attributes from enumeration to strings. Double underscore class attributes

This commit is contained in:
Samuel Findlay 2012-06-09 05:30:33 +10:00
parent 818e46fba7
commit 6bf5f6d56f
4 changed files with 128 additions and 150 deletions

View File

@ -87,7 +87,7 @@ class SongImportForm(OpenLPWizard):
Song wizard specific initialisation. Song wizard specific initialisation.
""" """
for format in SongFormat.get_format_list(): for format in SongFormat.get_format_list():
if not SongFormat.get(format, SongFormat.Availability): if not SongFormat.get(format, u'availability'):
self.formatWidgets[format][u'disabledWidget'].setVisible(True) self.formatWidgets[format][u'disabledWidget'].setVisible(True)
self.formatWidgets[format][u'importWidget'].setVisible(False) self.formatWidgets[format][u'importWidget'].setVisible(False)
@ -96,7 +96,7 @@ class SongImportForm(OpenLPWizard):
Song wizard specific signals. Song wizard specific signals.
""" """
for format in SongFormat.get_format_list(): for format in SongFormat.get_format_list():
select_mode = SongFormat.get(format, SongFormat.SelectMode) select_mode = SongFormat.get(format, u'selectMode')
if select_mode == SongFormatSelect.MultipleFiles: if select_mode == SongFormatSelect.MultipleFiles:
QtCore.QObject.connect(self.formatWidgets[format][u'addButton'], QtCore.QObject.connect(self.formatWidgets[format][u'addButton'],
QtCore.SIGNAL(u'clicked()'), self.onAddButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onAddButtonClicked)
@ -161,8 +161,7 @@ class SongImportForm(OpenLPWizard):
self.formatLabel.setText(WizardStrings.FormatLabel) self.formatLabel.setText(WizardStrings.FormatLabel)
for format in SongFormat.get_format_list(): for format in SongFormat.get_format_list():
format_name, custom_combo_text, select_mode = SongFormat.get( format_name, custom_combo_text, select_mode = SongFormat.get(
format, SongFormat.Name, SongFormat.ComboBoxText, format, u'name', u'comboBoxText', u'selectMode')
SongFormat.SelectMode)
combo_box_text = custom_combo_text if custom_combo_text \ combo_box_text = custom_combo_text if custom_combo_text \
else format_name else format_name
self.formatComboBox.setItemText(format, combo_box_text) self.formatComboBox.setItemText(format, combo_box_text)
@ -181,7 +180,7 @@ class SongImportForm(OpenLPWizard):
translate('SongsPlugin.ImportWizardForm', f_label)) translate('SongsPlugin.ImportWizardForm', f_label))
for format in self.disablableFormats: for format in self.disablableFormats:
self.formatWidgets[format][u'disabledLabel'].setText( self.formatWidgets[format][u'disabledLabel'].setText(
SongFormat.get(format, SongFormat.DisabledLabelText)) SongFormat.get(format, u'disabledLabelText'))
self.progressPage.setTitle(WizardStrings.Importing) self.progressPage.setTitle(WizardStrings.Importing)
self.progressPage.setSubTitle( self.progressPage.setSubTitle(
translate('SongsPlugin.ImportWizardForm', translate('SongsPlugin.ImportWizardForm',
@ -227,8 +226,7 @@ class SongImportForm(OpenLPWizard):
QtCore.QSettings().setValue(u'songs/last import type', QtCore.QSettings().setValue(u'songs/last import type',
format) format)
select_mode, class_, error_msg = SongFormat.get(format, select_mode, class_, error_msg = SongFormat.get(format,
SongFormat.SelectMode, SongFormat.Class, u'selectMode', u'class', u'invalidSourceMsg')
SongFormat.InvalidSourceMsg)
if select_mode == SongFormatSelect.MultipleFiles: if select_mode == SongFormatSelect.MultipleFiles:
import_source = self.getListOfFiles( import_source = self.getListOfFiles(
self.formatWidgets[format][u'fileListWidget']) self.formatWidgets[format][u'fileListWidget'])
@ -291,8 +289,8 @@ class SongImportForm(OpenLPWizard):
def onBrowseButtonClicked(self): def onBrowseButtonClicked(self):
format = self.currentFormat format = self.currentFormat
select_mode, format_name, filter = SongFormat.get(format, select_mode, format_name, filter = SongFormat.get(format, u'selectMode',
SongFormat.SelectMode, SongFormat.Name, SongFormat.Filter) u'name', u'filter')
filepathEdit = self.formatWidgets[format][u'filepathEdit'] filepathEdit = self.formatWidgets[format][u'filepathEdit']
if select_mode == SongFormatSelect.SingleFile: if select_mode == SongFormatSelect.SingleFile:
self.getFileName(WizardStrings.OpenTypeFile % format_name, self.getFileName(WizardStrings.OpenTypeFile % format_name,
@ -304,8 +302,8 @@ class SongImportForm(OpenLPWizard):
def onAddButtonClicked(self): def onAddButtonClicked(self):
format = self.currentFormat format = self.currentFormat
select_mode, format_name, filter, custom_title = SongFormat.get(format, select_mode, format_name, filter, custom_title = SongFormat.get(format,
SongFormat.SelectMode, SongFormat.Name, SongFormat.Filter, u'selectMode', u'name', u'filter',
SongFormat.GetFilesTitle) u'getFilesTitle')
title = custom_title if custom_title \ title = custom_title if custom_title \
else WizardStrings.OpenTypeFile % format_name else WizardStrings.OpenTypeFile % format_name
if select_mode == SongFormatSelect.MultipleFiles: if select_mode == SongFormatSelect.MultipleFiles:
@ -338,7 +336,7 @@ class SongImportForm(OpenLPWizard):
last_import_type = 0 last_import_type = 0
self.formatComboBox.setCurrentIndex(last_import_type) self.formatComboBox.setCurrentIndex(last_import_type)
for format in SongFormat.get_format_list(): for format in SongFormat.get_format_list():
select_mode = SongFormat.get(format, SongFormat.SelectMode) select_mode = SongFormat.get(format, u'selectMode')
if select_mode == SongFormatSelect.MultipleFiles: if select_mode == SongFormatSelect.MultipleFiles:
self.formatWidgets[format][u'fileListWidget'].clear() self.formatWidgets[format][u'fileListWidget'].clear()
else: else:
@ -363,7 +361,7 @@ class SongImportForm(OpenLPWizard):
the actual importing. the actual importing.
""" """
source_format = self.currentFormat source_format = self.currentFormat
select_mode = SongFormat.get(source_format, SongFormat.SelectMode) select_mode = SongFormat.get(source_format, u'selectMode')
if select_mode == SongFormatSelect.SingleFile: if select_mode == SongFormatSelect.SingleFile:
importer = self.plugin.importSongs(source_format, filename=unicode( importer = self.plugin.importSongs(source_format, filename=unicode(
self.formatWidgets[source_format][u'filepathEdit'].text())) self.formatWidgets[source_format][u'filepathEdit'].text()))
@ -397,8 +395,8 @@ class SongImportForm(OpenLPWizard):
def addFileSelectItem(self): def addFileSelectItem(self):
format = self.currentFormat format = self.currentFormat
prefix, can_disable, select_mode = SongFormat.get(format, prefix, can_disable, select_mode = SongFormat.get(format, u'prefix',
SongFormat.Prefix, SongFormat.CanDisable, SongFormat.SelectMode) u'canDisable', u'selectMode')
page = QtGui.QWidget() page = QtGui.QWidget()
page.setObjectName(prefix + u'Page') page.setObjectName(prefix + u'Page')
if can_disable: if can_disable:
@ -505,8 +503,8 @@ class SongImportSourcePage(QtGui.QWizardPage):
""" """
wizard = self.wizard() wizard = self.wizard()
format = wizard.currentFormat format = wizard.currentFormat
select_mode, format_available = SongFormat.get(format, select_mode, format_available = SongFormat.get(format, u'selectMode',
SongFormat.SelectMode, SongFormat.Availability) u'availability')
if format_available: if format_available:
if select_mode == SongFormatSelect.MultipleFiles: if select_mode == SongFormatSelect.MultipleFiles:
if wizard.formatWidgets[format][u'fileListWidget'].count() > 0: if wizard.formatWidgets[format][u'fileListWidget'].count() > 0:

View File

@ -81,45 +81,40 @@ class SongFormat(object):
Required attributes for each song format: Required attributes for each song format:
``Class`` ``u'class'``
Import class, e.g. ``OpenLyricsImport`` Import class, e.g. ``OpenLyricsImport``
``Name`` ``u'name'``
Name of the format, e.g. ``u'OpenLyrics'`` Name of the format, e.g. ``u'OpenLyrics'``
``Prefix`` ``u'prefix'``
Prefix for Qt objects. Use mixedCase, e.g. ``u'openLyrics'`` Prefix for Qt objects. Use mixedCase, e.g. ``u'openLyrics'``
See ``SongImportForm.addFileSelectItem()`` See ``SongImportForm.addFileSelectItem()``
Optional attributes for each song format: Optional attributes for each song format:
``CanDisable`` ``u'canDisable'``
Whether song format importer is disablable. Whether song format importer is disablable.
``Availability`` ``u'availability'``
Whether song format importer is available. Whether song format importer is available.
``SelectMode`` ``u'selectMode'``
Whether format accepts single file, multiple files, or single folder Whether format accepts single file, multiple files, or single folder
(as per ``SongFormatSelect`` options). (as per ``SongFormatSelect`` options).
``Filter`` ``u'filter'``
File extension filter for ``QFileDialog``. File extension filter for ``QFileDialog``.
Optional/custom text Strings for ``SongImportForm`` widgets: Optional/custom text Strings for ``SongImportForm`` widgets:
``ComboBoxText`` ``u'comboBoxText'``
Combo box selector (default value is the format's ``Name``). Combo box selector (default value is the format's ``u'name'``).
``DisabledLabelText`` ``u'disabledLabelText'``
Required for disablable song formats. Required for disablable song formats.
``GetFilesTitle`` ``u'getFilesTitle'``
Title for ``QFileDialog`` (default includes the format's ``Name``). Title for ``QFileDialog`` (default includes the format's ``u'name'``).
``InvalidSourceMsg`` ``u'invalidSourceMsg'``
Message displayed if ``Class.isValidSource()`` returns ``False``. Message displayed if ``isValidSource()`` returns ``False``.
""" """
# Enumeration of song formats and their attributes # Song formats (ordered alphabetically after Generic)
# * Numerical order of song formats is significant as it determines the # * Numerical order of song formats is significant as it determines the
# order used by formatComboBox. # order used by formatComboBox.
# * Attribute ints are negative so they don't clash with song format ints.
# * Each group of attribute values increments by 10 to facilitate addition
# of more attributes in future.
# Song formats (ordered alphabetically after Generic)
Unknown = -1 Unknown = -1
OpenLyrics = 0 OpenLyrics = 0
OpenLP2 = 1 OpenLP2 = 1
@ -138,158 +133,143 @@ class SongFormat(object):
WordsOfWorship = 14 WordsOfWorship = 14
#CSV = 15 #CSV = 15
# Required attributes
Class = -10
Name = -11
Prefix = -12
# Optional attributes
CanDisable = -20
Availability = -21
SelectMode = -22
Filter = -23
# Optional/custom text values
ComboBoxText = -30
DisabledLabelText = -31
GetFilesTitle = -32
InvalidSourceMsg = -33
# Set optional attribute defaults # Set optional attribute defaults
_defaults = { __defaults__ = {
CanDisable: False, u'canDisable': False,
Availability: True, u'availability': True,
SelectMode: SongFormatSelect.MultipleFiles, u'selectMode': SongFormatSelect.MultipleFiles,
Filter: u'', u'filter': u'',
ComboBoxText: None, u'comboBoxText': None,
DisabledLabelText: u'', u'disabledLabelText': u'',
GetFilesTitle: None, u'getFilesTitle': None,
InvalidSourceMsg: None u'invalidSourceMsg': None
} }
# Set attribute values for each Song Format # Set attribute values for each Song Format
_attributes = { __attributes__ = {
OpenLyrics: { OpenLyrics: {
Class: OpenLyricsImport, u'class': OpenLyricsImport,
Name: u'OpenLyrics', u'name': u'OpenLyrics',
Prefix: u'openLyrics', u'prefix': u'openLyrics',
Filter: u'%s (*.xml)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.xml)' % translate('SongsPlugin.ImportWizardForm',
'OpenLyrics Files'), 'OpenLyrics Files'),
ComboBoxText: translate('SongsPlugin.ImportWizardForm', u'comboBoxText': translate('SongsPlugin.ImportWizardForm',
'OpenLyrics or OpenLP 2.0 Exported Song') 'OpenLyrics or OpenLP 2.0 Exported Song')
}, },
OpenLP2: { OpenLP2: {
Class: OpenLPSongImport, u'class': OpenLPSongImport,
Name: UiStrings().OLPV2, u'name': UiStrings().OLPV2,
Prefix: u'openLP2', u'prefix': u'openLP2',
SelectMode: SongFormatSelect.SingleFile, u'selectMode': SongFormatSelect.SingleFile,
Filter: u'%s (*.sqlite)' % (translate( u'filter': u'%s (*.sqlite)' % (translate(
'SongsPlugin.ImportWizardForm', 'OpenLP 2.0 Databases')) 'SongsPlugin.ImportWizardForm', 'OpenLP 2.0 Databases'))
}, },
OpenLP1: { OpenLP1: {
Name: UiStrings().OLPV1, u'name': UiStrings().OLPV1,
Prefix: u'openLP1', u'prefix': u'openLP1',
CanDisable: True, u'canDisable': True,
SelectMode: SongFormatSelect.SingleFile, u'selectMode': SongFormatSelect.SingleFile,
Filter: u'%s (*.olp)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.olp)' % translate('SongsPlugin.ImportWizardForm',
'openlp.org v1.x Databases'), 'openlp.org v1.x Databases'),
DisabledLabelText: WizardStrings.NoSqlite u'disabledLabelText': WizardStrings.NoSqlite
}, },
Generic: { Generic: {
Name: translate('SongsPlugin.ImportWizardForm', u'name': translate('SongsPlugin.ImportWizardForm',
'Generic Document/Presentation'), 'Generic Document/Presentation'),
Prefix: u'generic', u'prefix': u'generic',
CanDisable: True, u'canDisable': True,
DisabledLabelText: translate('SongsPlugin.ImportWizardForm', u'disabledLabelText': translate('SongsPlugin.ImportWizardForm',
'The generic document/presentation importer has been disabled ' 'The generic document/presentation importer has been disabled '
'because OpenLP cannot access OpenOffice or LibreOffice.'), 'because OpenLP cannot access OpenOffice or LibreOffice.'),
GetFilesTitle: translate('SongsPlugin.ImportWizardForm', u'getFilesTitle': translate('SongsPlugin.ImportWizardForm',
'Select Document/Presentation Files') 'Select Document/Presentation Files')
}, },
CCLI: { CCLI: {
Class: CCLIFileImport, u'class': CCLIFileImport,
Name: u'CCLI/SongSelect', u'name': u'CCLI/SongSelect',
Prefix: u'ccli', u'prefix': u'ccli',
Filter: u'%s (*.usr *.txt)' % translate( u'filter': u'%s (*.usr *.txt)' % translate(
'SongsPlugin.ImportWizardForm', 'CCLI SongSelect Files') 'SongsPlugin.ImportWizardForm', 'CCLI SongSelect Files')
}, },
DreamBeam: { DreamBeam: {
Class: DreamBeamImport, u'class': DreamBeamImport,
Name: u'DreamBeam', u'name': u'DreamBeam',
Prefix: u'dreamBeam', u'prefix': u'dreamBeam',
Filter: u'%s (*.xml)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.xml)' % translate('SongsPlugin.ImportWizardForm',
'DreamBeam Song Files') 'DreamBeam Song Files')
}, },
EasySlides: { EasySlides: {
Class: EasySlidesImport, u'class': EasySlidesImport,
Name: u'EasySlides', u'name': u'EasySlides',
Prefix: u'easySlides', u'prefix': u'easySlides',
SelectMode: SongFormatSelect.SingleFile, u'selectMode': SongFormatSelect.SingleFile,
Filter: u'%s (*.xml)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.xml)' % translate('SongsPlugin.ImportWizardForm',
'EasySlides XML File') 'EasySlides XML File')
}, },
EasyWorship: { EasyWorship: {
Class: EasyWorshipSongImport, u'class': EasyWorshipSongImport,
Name: u'EasyWorship', u'name': u'EasyWorship',
Prefix: u'ew', u'prefix': u'ew',
SelectMode: SongFormatSelect.SingleFile, u'selectMode': SongFormatSelect.SingleFile,
Filter: u'%s (*.db)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.db)' % translate('SongsPlugin.ImportWizardForm',
'EasyWorship Song Database') 'EasyWorship Song Database')
}, },
FoilPresenter: { FoilPresenter: {
Class: FoilPresenterImport, u'class': FoilPresenterImport,
Name: u'Foilpresenter', u'name': u'Foilpresenter',
Prefix: u'foilPresenter', u'prefix': u'foilPresenter',
Filter: u'%s (*.foil)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.foil)' % translate(
'Foilpresenter Song Files') 'SongsPlugin.ImportWizardForm', 'Foilpresenter Song Files')
}, },
OpenSong: { OpenSong: {
Class: OpenSongImport, u'class': OpenSongImport,
Name: WizardStrings.OS, u'name': WizardStrings.OS,
Prefix: u'openSong' u'prefix': u'openSong'
}, },
PowerSong: { PowerSong: {
Class: PowerSongImport, u'class': PowerSongImport,
Name: u'PowerSong 1.0', u'name': u'PowerSong 1.0',
Prefix: u'powerSong', u'prefix': u'powerSong',
SelectMode: SongFormatSelect.SingleFolder, u'selectMode': SongFormatSelect.SingleFolder,
InvalidSourceMsg: translate('SongsPlugin.ImportWizardForm', u'invalidSourceMsg': translate('SongsPlugin.ImportWizardForm',
'You need to specify a valid PowerSong 1.0 database folder.') 'You need to specify a valid PowerSong 1.0 database folder.')
}, },
SongBeamer: { SongBeamer: {
Class: SongBeamerImport, u'class': SongBeamerImport,
Name: u'SongBeamer', u'name': u'SongBeamer',
Prefix: u'songBeamer', u'prefix': u'songBeamer',
Filter: u'%s (*.sng)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.sng)' % translate('SongsPlugin.ImportWizardForm',
'SongBeamer Files') 'SongBeamer Files')
}, },
SongShowPlus: { SongShowPlus: {
Class: SongShowPlusImport, u'class': SongShowPlusImport,
Name: u'SongShow Plus', u'name': u'SongShow Plus',
Prefix: u'songShowPlus', u'prefix': u'songShowPlus',
Filter: u'%s (*.sbsong)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.sbsong)' % translate(
'SongShow Plus Song Files') 'SongsPlugin.ImportWizardForm', 'SongShow Plus Song Files')
}, },
SongsOfFellowship: { SongsOfFellowship: {
Name: u'Songs of Fellowship', u'name': u'Songs of Fellowship',
Prefix: u'songsOfFellowship', u'prefix': u'songsOfFellowship',
CanDisable: True, u'canDisable': True,
Filter: u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', u'filter': u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm',
'Songs Of Fellowship Song Files'), 'Songs Of Fellowship Song Files'),
DisabledLabelText: translate('SongsPlugin.ImportWizardForm', u'disabledLabelText': translate('SongsPlugin.ImportWizardForm',
'The Songs of Fellowship importer has been disabled because ' 'The Songs of Fellowship importer has been disabled because '
'OpenLP cannot access OpenOffice or LibreOffice.') 'OpenLP cannot access OpenOffice or LibreOffice.')
}, },
WordsOfWorship: { WordsOfWorship: {
Class: WowImport, u'class': WowImport,
Name: u'Words of Worship', u'name': u'Words of Worship',
Prefix: u'wordsOfWorship', u'prefix': u'wordsOfWorship',
Filter: u'%s (*.wsg *.wow-song)' % translate( u'filter': u'%s (*.wsg *.wow-song)' % translate(
'SongsPlugin.ImportWizardForm', 'Words Of Worship Song Files') 'SongsPlugin.ImportWizardForm', 'Words Of Worship Song Files')
# }, # },
# CSV: { # CSV: {
# class_: CSVImport, # u'class': CSVImport,
# name: WizardStrings.CSV, # u'name': WizardStrings.CSV,
# prefix: u'csv', # u'prefix': u'csv',
# select_mode: SongFormatSelect.SingleFile # u'selectMode': SongFormatSelect.SingleFile
} }
} }
@ -333,16 +313,16 @@ class SongFormat(object):
:>1: Return tuple of requested attribute values. :>1: Return tuple of requested attribute values.
""" """
if not attributes: if not attributes:
return SongFormat._attributes.get(format) return SongFormat.__attributes__.get(format)
elif len(attributes) == 1: elif len(attributes) == 1:
default = SongFormat._defaults.get(attributes[0]) default = SongFormat.__defaults__.get(attributes[0])
return SongFormat._attributes[format].get(attributes[0], return SongFormat.__attributes__[format].get(attributes[0],
default) default)
else: else:
values = [] values = []
for attr in attributes: for attr in attributes:
default = SongFormat._defaults.get(attr) default = SongFormat.__defaults__.get(attr)
values.append(SongFormat._attributes[format].get(attr, values.append(SongFormat.__attributes__[format].get(attr,
default)) default))
return tuple(values) return tuple(values)
@ -351,16 +331,16 @@ class SongFormat(object):
""" """
Set specified song format attribute to the supplied value. Set specified song format attribute to the supplied value.
""" """
SongFormat._attributes[format][attribute] = value SongFormat.__attributes__[format][attribute] = value
SongFormat.set(SongFormat.OpenLP1, SongFormat.Availability, HAS_OPENLP1) SongFormat.set(SongFormat.OpenLP1, u'availability', HAS_OPENLP1)
if HAS_OPENLP1: if HAS_OPENLP1:
SongFormat.set(SongFormat.OpenLP1, SongFormat.Class, OpenLP1SongImport) SongFormat.set(SongFormat.OpenLP1, u'class', OpenLP1SongImport)
SongFormat.set(SongFormat.SongsOfFellowship, SongFormat.Availability, HAS_SOF) SongFormat.set(SongFormat.SongsOfFellowship, u'availability', HAS_SOF)
if HAS_SOF: if HAS_SOF:
SongFormat.set(SongFormat.SongsOfFellowship, SongFormat.Class, SofImport) SongFormat.set(SongFormat.SongsOfFellowship, u'class', SofImport)
SongFormat.set(SongFormat.Generic, SongFormat.Availability, HAS_OOO) SongFormat.set(SongFormat.Generic, u'availability', HAS_OOO)
if HAS_OOO: if HAS_OOO:
SongFormat.set(SongFormat.Generic, SongFormat.Class, OooImport) SongFormat.set(SongFormat.Generic, u'class', OooImport)
__all__ = [u'SongFormat', u'SongFormatSelect'] __all__ = [u'SongFormat', u'SongFormatSelect']

View File

@ -88,7 +88,7 @@ class PowerSongImport(SongImport):
Receive either a list of files or a folder (unicode) to import. Receive either a list of files or a folder (unicode) to import.
""" """
from importer import SongFormat from importer import SongFormat
PS_string = SongFormat.get(SongFormat.PowerSong, SongFormat.Name) PS_string = SongFormat.get(SongFormat.PowerSong, u'name')
if isinstance(self.importSource, unicode): if isinstance(self.importSource, unicode):
if os.path.isdir(self.importSource): if os.path.isdir(self.importSource):
dir = self.importSource dir = self.importSource

View File

@ -194,7 +194,7 @@ class SongsPlugin(Plugin):
self.manager.save_object(song) self.manager.save_object(song)
def importSongs(self, format, **kwargs): def importSongs(self, format, **kwargs):
class_ = SongFormat.get(format, SongFormat.Class) class_ = SongFormat.get(format, u'class')
importer = class_(self.manager, **kwargs) importer = class_(self.manager, **kwargs)
importer.register(self.mediaItem.importWizard) importer.register(self.mediaItem.importWizard)
return importer return importer