mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cleanups of plugboard code. Improvements to the gui.
This commit is contained in:
parent
c852a65922
commit
62f1edd848
@ -303,7 +303,6 @@ class Metadata(object):
|
|||||||
return
|
return
|
||||||
for src in attrs:
|
for src in attrs:
|
||||||
try:
|
try:
|
||||||
print src
|
|
||||||
sfm = other.metadata_for_field(src)
|
sfm = other.metadata_for_field(src)
|
||||||
dfm = self.metadata_for_field(attrs[src])
|
dfm = self.metadata_for_field(attrs[src])
|
||||||
if dfm['is_multiple']:
|
if dfm['is_multiple']:
|
||||||
|
@ -34,6 +34,8 @@ from calibre.ebooks.metadata.meta import set_metadata
|
|||||||
from calibre.constants import DEBUG
|
from calibre.constants import DEBUG
|
||||||
from calibre.utils.config import prefs, tweaks
|
from calibre.utils.config import prefs, tweaks
|
||||||
from calibre.utils.magick.draw import thumbnail
|
from calibre.utils.magick.draw import thumbnail
|
||||||
|
from calibre.library.save_to_disk import plugboard_any_device_value, \
|
||||||
|
plugboard_any_format_value
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
class DeviceJob(BaseJob): # {{{
|
class DeviceJob(BaseJob): # {{{
|
||||||
@ -323,22 +325,22 @@ class DeviceManager(Thread): # {{{
|
|||||||
for f, mi in zip(files, metadata):
|
for f, mi in zip(files, metadata):
|
||||||
if isinstance(f, unicode):
|
if isinstance(f, unicode):
|
||||||
ext = f.rpartition('.')[-1].lower()
|
ext = f.rpartition('.')[-1].lower()
|
||||||
dev_name = self.connected_device.name
|
dev_name = self.connected_device.__class__.__name__
|
||||||
cpb = None
|
cpb = None
|
||||||
if ext in plugboards:
|
if ext in plugboards:
|
||||||
cpb = plugboards[ext]
|
cpb = plugboards[ext]
|
||||||
elif ' any' in plugboards:
|
elif plugboard_any_format_value in plugboards:
|
||||||
cpb = plugboards[' any']
|
cpb = plugboards[plugboard_any_format_value]
|
||||||
if cpb is not None:
|
if cpb is not None:
|
||||||
if dev_name in cpb:
|
if dev_name in cpb:
|
||||||
cpb = cpb[dev_name]
|
cpb = cpb[dev_name]
|
||||||
elif ' any' in plugboards[ext]:
|
elif plugboard_any_device_value in plugboards[ext]:
|
||||||
cpb = cpb[' any']
|
cpb = cpb[plugboard_any_device_value]
|
||||||
else:
|
else:
|
||||||
cpb = None
|
cpb = None
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
prints('Using plugboard', cpb)
|
prints('Using plugboard', ext, dev_name, cpb)
|
||||||
if ext:
|
if ext:
|
||||||
try:
|
try:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
@ -8,32 +8,84 @@ __docformat__ = 'restructuredtext en'
|
|||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from calibre.gui2 import error_dialog
|
from calibre.gui2 import error_dialog
|
||||||
from calibre.gui2.preferences import ConfigWidgetBase, test_widget, \
|
from calibre.gui2.preferences import ConfigWidgetBase, test_widget
|
||||||
AbortCommit
|
|
||||||
from calibre.gui2.preferences.plugboard_ui import Ui_Form
|
from calibre.gui2.preferences.plugboard_ui import Ui_Form
|
||||||
from calibre.customize.ui import metadata_writers, device_plugins
|
from calibre.customize.ui import metadata_writers, device_plugins
|
||||||
|
from calibre.library.save_to_disk import plugboard_any_format_value, \
|
||||||
|
plugboard_any_device_value, plugboard_save_to_disk_value
|
||||||
|
|
||||||
class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||||
|
|
||||||
def genesis(self, gui):
|
def genesis(self, gui):
|
||||||
self.gui = gui
|
self.gui = gui
|
||||||
self.db = gui.library_view.model().db
|
self.db = gui.library_view.model().db
|
||||||
self.current_plugboards = self.db.prefs.get('plugboards', {'epub': {' any': {'title':'authors', 'authors':'tags'}}})
|
self.current_plugboards = self.db.prefs.get('plugboards',{})
|
||||||
self.current_device = None
|
self.current_device = None
|
||||||
self.current_format = None
|
self.current_format = None
|
||||||
# self.proxy = ConfigProxy(config())
|
|
||||||
#
|
def initialize(self):
|
||||||
# r = self.register
|
def field_cmp(x, y):
|
||||||
#
|
if x.startswith('#'):
|
||||||
# for x in ('asciiize', 'update_metadata', 'save_cover', 'write_opf',
|
if y.startswith('#'):
|
||||||
# 'replace_whitespace', 'to_lowercase', 'formats', 'timefmt'):
|
return cmp(x.lower(), y.lower())
|
||||||
# r(x, self.proxy)
|
else:
|
||||||
#
|
return 1
|
||||||
# self.save_template.changed_signal.connect(self.changed_signal.emit)
|
elif y.startswith('#'):
|
||||||
|
return -1
|
||||||
|
else:
|
||||||
|
return cmp(x.lower(), y.lower())
|
||||||
|
|
||||||
|
ConfigWidgetBase.initialize(self)
|
||||||
|
|
||||||
|
self.devices = ['']
|
||||||
|
for device in device_plugins():
|
||||||
|
n = device.__class__.__name__
|
||||||
|
if n.startswith('FOLDER_DEVICE'):
|
||||||
|
n = 'FOLDER_DEVICE'
|
||||||
|
self.devices.append(n)
|
||||||
|
self.devices.sort(cmp=lambda x, y: cmp(x.lower(), y.lower()))
|
||||||
|
self.devices.insert(1, plugboard_save_to_disk_value)
|
||||||
|
self.devices.insert(2, plugboard_any_device_value)
|
||||||
|
self.new_device.addItems(self.devices)
|
||||||
|
|
||||||
|
self.formats = ['']
|
||||||
|
for w in metadata_writers():
|
||||||
|
for f in w.file_types:
|
||||||
|
self.formats.append(f)
|
||||||
|
self.formats.sort()
|
||||||
|
self.formats.insert(1, plugboard_any_format_value)
|
||||||
|
self.new_format.addItems(self.formats)
|
||||||
|
|
||||||
|
self.fields = ['']
|
||||||
|
for f in self.db.all_field_keys():
|
||||||
|
if self.db.field_metadata[f].get('rec_index', None) is not None and\
|
||||||
|
self.db.field_metadata[f]['datatype'] is not None and \
|
||||||
|
self.db.field_metadata[f]['search_terms']:
|
||||||
|
self.fields.append(f)
|
||||||
|
self.fields.sort(cmp=field_cmp)
|
||||||
|
|
||||||
|
self.source_widgets = []
|
||||||
|
self.dest_widgets = []
|
||||||
|
for i in range(0, 10):
|
||||||
|
w = QtGui.QComboBox(self)
|
||||||
|
self.source_widgets.append(w)
|
||||||
|
self.fields_layout.addWidget(w, 5+i, 0, 1, 1)
|
||||||
|
w = QtGui.QComboBox(self)
|
||||||
|
self.dest_widgets.append(w)
|
||||||
|
self.fields_layout.addWidget(w, 5+i, 1, 1, 1)
|
||||||
|
|
||||||
|
self.edit_device.currentIndexChanged[str].connect(self.edit_device_changed)
|
||||||
|
self.edit_format.currentIndexChanged[str].connect(self.edit_format_changed)
|
||||||
|
self.new_device.currentIndexChanged[str].connect(self.new_device_changed)
|
||||||
|
self.new_format.currentIndexChanged[str].connect(self.new_format_changed)
|
||||||
|
self.ok_button.clicked.connect(self.ok_clicked)
|
||||||
|
self.del_button.clicked.connect(self.del_clicked)
|
||||||
|
|
||||||
|
self.refill_all_boxes()
|
||||||
|
|
||||||
def clear_fields(self, edit_boxes=False, new_boxes=False):
|
def clear_fields(self, edit_boxes=False, new_boxes=False):
|
||||||
self.ok_button.setEnabled(False)
|
self.ok_button.setEnabled(False)
|
||||||
|
self.del_button.setEnabled(False)
|
||||||
for w in self.source_widgets:
|
for w in self.source_widgets:
|
||||||
w.clear()
|
w.clear()
|
||||||
for w in self.dest_widgets:
|
for w in self.dest_widgets:
|
||||||
@ -47,6 +99,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
|
|
||||||
def set_fields(self):
|
def set_fields(self):
|
||||||
self.ok_button.setEnabled(True)
|
self.ok_button.setEnabled(True)
|
||||||
|
self.del_button.setEnabled(True)
|
||||||
for w in self.source_widgets:
|
for w in self.source_widgets:
|
||||||
w.addItems(self.fields)
|
w.addItems(self.fields)
|
||||||
for w in self.dest_widgets:
|
for w in self.dest_widgets:
|
||||||
@ -76,6 +129,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
for i,src in enumerate(dpb):
|
for i,src in enumerate(dpb):
|
||||||
self.set_field(i, src, dpb[src])
|
self.set_field(i, src, dpb[src])
|
||||||
self.ok_button.setEnabled(True)
|
self.ok_button.setEnabled(True)
|
||||||
|
self.del_button.setEnabled(True)
|
||||||
|
|
||||||
def edit_format_changed(self, txt):
|
def edit_format_changed(self, txt):
|
||||||
if txt == '':
|
if txt == '':
|
||||||
@ -104,26 +158,42 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
self.clear_fields(edit_boxes=True)
|
self.clear_fields(edit_boxes=True)
|
||||||
self.current_device = unicode(txt)
|
self.current_device = unicode(txt)
|
||||||
error = False
|
error = False
|
||||||
if self.current_format == ' any':
|
if self.current_format == plugboard_any_format_value:
|
||||||
|
# user specified any format.
|
||||||
for f in self.current_plugboards:
|
for f in self.current_plugboards:
|
||||||
if self.current_device == ' any' and len(self.current_plugboards[f]):
|
devs = set(self.current_plugboards[f])
|
||||||
|
print 'check', self.current_format, devs
|
||||||
|
if self.current_device != plugboard_save_to_disk_value and \
|
||||||
|
plugboard_any_device_value in devs:
|
||||||
|
# specific format/any device in list. conflict.
|
||||||
|
# note: any device does not match save_to_disk
|
||||||
error = True
|
error = True
|
||||||
break
|
break
|
||||||
if self.current_device in self.current_plugboards[f]:
|
if self.current_device in devs:
|
||||||
|
# specific format/current device in list. conflict
|
||||||
error = True
|
error = True
|
||||||
break
|
break
|
||||||
if ' any' in self.current_plugboards[f]:
|
if self.current_device == plugboard_any_device_value:
|
||||||
|
# any device and a specific device already there. conflict
|
||||||
error = True
|
error = True
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
fpb = self.current_plugboards.get(self.current_format, None)
|
# user specified specific format.
|
||||||
if fpb is not None:
|
for f in self.current_plugboards:
|
||||||
if ' any' in fpb:
|
devs = set(self.current_plugboards[f])
|
||||||
|
if f == plugboard_any_format_value and \
|
||||||
|
self.current_device in devs:
|
||||||
|
# any format/same device in list. conflict.
|
||||||
error = True
|
error = True
|
||||||
else:
|
break
|
||||||
dpb = fpb.get(self.current_device, None)
|
if f == self.current_format and self.current_device in devs:
|
||||||
if dpb is not None:
|
# current format/current device in list. conflict
|
||||||
error = True
|
error = True
|
||||||
|
break
|
||||||
|
if f == self.current_format and plugboard_any_device_value in devs:
|
||||||
|
# current format/any device in list. conflict
|
||||||
|
error = True
|
||||||
|
break
|
||||||
|
|
||||||
if error:
|
if error:
|
||||||
error_dialog(self, '',
|
error_dialog(self, '',
|
||||||
@ -165,6 +235,16 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
self.changed_signal.emit()
|
self.changed_signal.emit()
|
||||||
self.refill_all_boxes()
|
self.refill_all_boxes()
|
||||||
|
|
||||||
|
def del_clicked(self):
|
||||||
|
if self.current_format in self.current_plugboards:
|
||||||
|
fpb = self.current_plugboards[self.current_format]
|
||||||
|
if self.current_device in fpb:
|
||||||
|
del fpb[self.current_device]
|
||||||
|
if len(fpb) == 0:
|
||||||
|
del self.current_plugboards[self.current_format]
|
||||||
|
self.changed_signal.emit()
|
||||||
|
self.refill_all_boxes()
|
||||||
|
|
||||||
def refill_all_boxes(self):
|
def refill_all_boxes(self):
|
||||||
self.current_device = None
|
self.current_device = None
|
||||||
self.current_format = None
|
self.current_format = None
|
||||||
@ -176,59 +256,21 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
self.edit_format.setCurrentIndex(0)
|
self.edit_format.setCurrentIndex(0)
|
||||||
self.edit_device.clear()
|
self.edit_device.clear()
|
||||||
self.ok_button.setEnabled(False)
|
self.ok_button.setEnabled(False)
|
||||||
|
self.del_button.setEnabled(False)
|
||||||
def initialize(self):
|
txt = ''
|
||||||
def field_cmp(x, y):
|
for f in self.formats:
|
||||||
if x.startswith('#'):
|
if f not in self.current_plugboards:
|
||||||
if y.startswith('#'):
|
continue
|
||||||
return cmp(x.lower(), y.lower())
|
for d in self.devices:
|
||||||
else:
|
if d not in self.current_plugboards[f]:
|
||||||
return 1
|
continue
|
||||||
elif y.startswith('#'):
|
ops = []
|
||||||
return -1
|
for op in self.fields:
|
||||||
else:
|
if op not in self.current_plugboards[f][d]:
|
||||||
return cmp(x.lower(), y.lower())
|
continue
|
||||||
|
ops.append(op + '->' + self.current_plugboards[f][d][op])
|
||||||
ConfigWidgetBase.initialize(self)
|
txt += '%s:%s [%s]\n'%(f, d, ', '.join(ops))
|
||||||
|
self.existing_plugboards.setPlainText(txt)
|
||||||
self.devices = ['', ' any', 'save to disk']
|
|
||||||
for device in device_plugins():
|
|
||||||
self.devices.append(device.name)
|
|
||||||
self.devices.sort(cmp=lambda x, y: cmp(x.lower(), y.lower()))
|
|
||||||
self.new_device.addItems(self.devices)
|
|
||||||
|
|
||||||
self.formats = ['', ' any']
|
|
||||||
for w in metadata_writers():
|
|
||||||
for f in w.file_types:
|
|
||||||
self.formats.append(f)
|
|
||||||
self.formats.sort()
|
|
||||||
self.new_format.addItems(self.formats)
|
|
||||||
|
|
||||||
self.fields = ['']
|
|
||||||
for f in self.db.all_field_keys():
|
|
||||||
if self.db.field_metadata[f].get('rec_index', None) is not None and\
|
|
||||||
self.db.field_metadata[f]['datatype'] is not None and \
|
|
||||||
self.db.field_metadata[f]['search_terms']:
|
|
||||||
self.fields.append(f)
|
|
||||||
self.fields.sort(cmp=field_cmp)
|
|
||||||
|
|
||||||
self.source_widgets = []
|
|
||||||
self.dest_widgets = []
|
|
||||||
for i in range(0, 10):
|
|
||||||
w = QtGui.QComboBox(self)
|
|
||||||
self.source_widgets.append(w)
|
|
||||||
self.fields_layout.addWidget(w, 5+i, 0, 1, 1)
|
|
||||||
w = QtGui.QComboBox(self)
|
|
||||||
self.dest_widgets.append(w)
|
|
||||||
self.fields_layout.addWidget(w, 5+i, 1, 1, 1)
|
|
||||||
|
|
||||||
self.edit_device.currentIndexChanged[str].connect(self.edit_device_changed)
|
|
||||||
self.edit_format.currentIndexChanged[str].connect(self.edit_format_changed)
|
|
||||||
self.new_device.currentIndexChanged[str].connect(self.new_device_changed)
|
|
||||||
self.new_format.currentIndexChanged[str].connect(self.new_format_changed)
|
|
||||||
self.ok_button.clicked.connect(self.ok_clicked)
|
|
||||||
|
|
||||||
self.refill_all_boxes()
|
|
||||||
|
|
||||||
def restore_defaults(self):
|
def restore_defaults(self):
|
||||||
ConfigWidgetBase.restore_defaults(self)
|
ConfigWidgetBase.restore_defaults(self)
|
||||||
|
@ -26,32 +26,6 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>Add new plugboard</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Edit existing plugboard</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QComboBox" name="new_format"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QComboBox" name="new_device"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QComboBox" name="edit_format"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QComboBox" name="edit_device"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -72,7 +46,50 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add new plugboard</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="new_format"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QComboBox" name="new_device"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit existing plugboard</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QComboBox" name="edit_format"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QComboBox" name="edit_device"/>
|
||||||
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_41">
|
||||||
|
<property name="text">
|
||||||
|
<string>Existing plugboards</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" colspan="2">
|
||||||
|
<widget class="QPlainTextEdit" name="existing_plugboards">
|
||||||
|
<property name="lineWrapMode">
|
||||||
|
<enum>QPlainTextEdit::NoWrap</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -122,10 +139,17 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="19" column="0" colspan="2">
|
<item row="19" column="0">
|
||||||
<widget class="QPushButton" name="ok_button">
|
<widget class="QPushButton" name="ok_button">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Done</string>
|
<string>Save</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="19" column="1">
|
||||||
|
<widget class="QPushButton" name="del_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>Delete</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -17,7 +17,12 @@ from calibre.ebooks.metadata.meta import set_metadata
|
|||||||
from calibre.constants import preferred_encoding, filesystem_encoding
|
from calibre.constants import preferred_encoding, filesystem_encoding
|
||||||
from calibre.ebooks.metadata import fmt_sidx
|
from calibre.ebooks.metadata import fmt_sidx
|
||||||
from calibre.ebooks.metadata import title_sort
|
from calibre.ebooks.metadata import title_sort
|
||||||
from calibre import strftime
|
from calibre import strftime, prints
|
||||||
|
|
||||||
|
plugboard_any_device_value = 'any device'
|
||||||
|
plugboard_any_format_value = 'any format'
|
||||||
|
plugboard_save_to_disk_value = 'save_to_disk'
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_TEMPLATE = '{author_sort}/{title}/{title} - {authors}'
|
DEFAULT_TEMPLATE = '{author_sort}/{title}/{title} - {authors}'
|
||||||
DEFAULT_SEND_TEMPLATE = '{author_sort}/{title} - {authors}'
|
DEFAULT_SEND_TEMPLATE = '{author_sort}/{title} - {authors}'
|
||||||
@ -232,21 +237,21 @@ def save_book_to_disk(id, db, root, opts, length):
|
|||||||
|
|
||||||
written = False
|
written = False
|
||||||
for fmt in formats:
|
for fmt in formats:
|
||||||
dev_name = 'save to disk'
|
global plugboard_save_to_disk_value, plugboard_any_format_value
|
||||||
|
dev_name = plugboard_save_to_disk_value
|
||||||
plugboards = db.prefs.get('plugboards', {})
|
plugboards = db.prefs.get('plugboards', {})
|
||||||
cpb = None
|
cpb = None
|
||||||
if fmt in plugboards:
|
if fmt in plugboards:
|
||||||
cpb = plugboards[fmt]
|
cpb = plugboards[fmt]
|
||||||
elif ' any' in plugboards:
|
elif plugboard_any_format_value in plugboards:
|
||||||
cpb = plugboards[' any']
|
cpb = plugboards[plugboard_any_format_value]
|
||||||
|
# must find a save_to_disk entry for this format
|
||||||
if cpb is not None:
|
if cpb is not None:
|
||||||
if dev_name in cpb:
|
if dev_name in cpb:
|
||||||
cpb = cpb[dev_name]
|
cpb = cpb[dev_name]
|
||||||
elif ' any' in plugboards[fmt]:
|
|
||||||
cpb = cpb[' any']
|
|
||||||
else:
|
else:
|
||||||
cpb = None
|
cpb = None
|
||||||
|
prints('Using plugboard:', fmt, cpb)
|
||||||
data = db.format(id, fmt, index_is_id=True)
|
data = db.format(id, fmt, index_is_id=True)
|
||||||
if data is None:
|
if data is None:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user