mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
8135c83537
commit
7fdd6bb3e4
@ -25,7 +25,7 @@ def sanitize_file_name(x):
|
|||||||
for ch in '?&=;#/\\':
|
for ch in '?&=;#/\\':
|
||||||
ans = ans.replace(ch, '_')
|
ans = ans.replace(ch, '_')
|
||||||
q = quote(ch, safe='')
|
q = quote(ch, safe='')
|
||||||
ans = re.sub(f'\{q}', '_', ans, flags=re.I)
|
ans = re.sub(f'\\{q}', '_', ans, flags=re.I)
|
||||||
ans = ans.strip().rstrip('.')
|
ans = ans.strip().rstrip('.')
|
||||||
ans, ext = ans.rpartition('.')[::2]
|
ans, ext = ans.rpartition('.')[::2]
|
||||||
return (ans.strip() + '.' + ext.strip()).rstrip('.')
|
return (ans.strip() + '.' + ext.strip()).rstrip('.')
|
||||||
|
@ -332,8 +332,8 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
|||||||
# Set the height of the table
|
# Set the height of the table
|
||||||
h = tv.rowHeight(0) * min(len(mi), 5)
|
h = tv.rowHeight(0) * min(len(mi), 5)
|
||||||
h += 2 * tv.frameWidth() + tv.horizontalHeader().height()
|
h += 2 * tv.frameWidth() + tv.horizontalHeader().height()
|
||||||
tv.setMinimumHeight(h);
|
tv.setMinimumHeight(h)
|
||||||
tv.setMaximumHeight(h);
|
tv.setMaximumHeight(h)
|
||||||
# Set the size of the title column
|
# Set the size of the title column
|
||||||
if self.table_column_widths:
|
if self.table_column_widths:
|
||||||
tv.setColumnWidth(0, self.table_column_widths[0])
|
tv.setColumnWidth(0, self.table_column_widths[0])
|
||||||
@ -416,10 +416,9 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
|||||||
geom = gprefs.get('template_editor_dialog_geometry', None)
|
geom = gprefs.get('template_editor_dialog_geometry', None)
|
||||||
if geom is not None:
|
if geom is not None:
|
||||||
QApplication.instance().safe_restore_geometry(self, QByteArray(geom))
|
QApplication.instance().safe_restore_geometry(self, QByteArray(geom))
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def font_size_changed(self, toWhat):
|
def font_size_changed(self, toWhat):
|
||||||
gprefs['gpm_template_editor_font_size'] = toWhat
|
gprefs['gpm_template_editor_font_size'] = toWhat
|
||||||
self.highlighter.initializeFormats()
|
self.highlighter.initializeFormats()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user