mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 16:33:36 +02:00
pep8
This commit is contained in:
parent
c765da312c
commit
5e022932ba
3 changed files with 9 additions and 9 deletions
|
|
@ -11,7 +11,7 @@
|
|||
QRegExp, QApplication, QTextCharFormat, QColor, QCursor,
|
||||
QIcon, QSize, QPalette, QLineEdit, QByteArray, QFontInfo,
|
||||
QFontDatabase, QVBoxLayout, QTableWidget, QTableWidgetItem,
|
||||
QFontComboBox, QComboBox)
|
||||
QComboBox)
|
||||
|
||||
from calibre import sanitize_file_name
|
||||
from calibre.constants import config_dir
|
||||
|
|
@ -699,7 +699,7 @@ def __init__(self, parent, mi, op_label, op_value, locals_, line_number):
|
|||
except:
|
||||
t.setColumnWidth(0, t.fontMetrics().averageCharWidth() * 20)
|
||||
t.horizontalHeader().sectionResized.connect(self.table_column_resized)
|
||||
t.horizontalHeader().setStretchLastSection(True);
|
||||
t.horizontalHeader().setStretchLastSection(True)
|
||||
|
||||
bb = QDialogButtonBox()
|
||||
b = bb.addButton(_('&Continue'), QDialogButtonBox.ButtonRole.AcceptRole)
|
||||
|
|
|
|||
|
|
@ -7,13 +7,15 @@
|
|||
License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
'''
|
||||
|
||||
from qt.core import (Qt, QWidget, QSize, QPlainTextEdit, QPainter,
|
||||
QRect, QFont, QPalette, QTextEdit, QTextFormat)
|
||||
from qt.core import (
|
||||
QFont, QPainter, QPalette, QPlainTextEdit, QRect, Qt, QTextEdit, QTextFormat
|
||||
)
|
||||
|
||||
from calibre.gui2.tweak_book.editor.themes import (get_theme, theme_color)
|
||||
from calibre.gui2.tweak_book.editor.text import LineNumbers
|
||||
from calibre.gui2.tweak_book.editor.themes import get_theme, theme_color
|
||||
from polyglot.builtins import unicode_type
|
||||
|
||||
|
||||
class LineNumberArea(LineNumbers):
|
||||
|
||||
def mouseDoubleClickEvent(self, event):
|
||||
|
|
@ -26,7 +28,6 @@ class CodeEditor(QPlainTextEdit):
|
|||
def __init__(self, parent):
|
||||
QPlainTextEdit.__init__(self, parent)
|
||||
|
||||
|
||||
# Use the default theme from the book editor
|
||||
theme = get_theme(None)
|
||||
self.line_number_palette = pal = QPalette()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
import re, string, traceback, numbers
|
||||
from math import modf
|
||||
from functools import partial
|
||||
|
||||
from calibre import prints
|
||||
from calibre.constants import DEBUG
|
||||
|
|
@ -1122,8 +1121,8 @@ def _explode_format_string(self, fmt):
|
|||
(r'\w+', lambda x,t: (_Parser.LEX_ID, t)), # noqa
|
||||
(r'".*?((?<!\\)")', lambda x,t: (_Parser.LEX_CONST, t[1:-1])), # noqa
|
||||
(r'\'.*?((?<!\\)\')', lambda x,t: (_Parser.LEX_CONST, t[1:-1])), # noqa
|
||||
(r'\n#.*?(?:(?=\n)|$)', lambda x,t: _Parser.LEX_NEWLINE),
|
||||
(r'\s', lambda x,t: _Parser.LEX_NEWLINE if t == '\n' else None),
|
||||
(r'\n#.*?(?:(?=\n)|$)', lambda x,t: _Parser.LEX_NEWLINE), # noqa
|
||||
(r'\s', lambda x,t: _Parser.LEX_NEWLINE if t == '\n' else None), # noqa
|
||||
], flags=re.DOTALL)
|
||||
|
||||
def _eval_program(self, val, prog, column_name, global_vars, break_reporter):
|
||||
|
|
|
|||
Loading…
Reference in a new issue