mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Easier debugging of syntax highlighters
This commit is contained in:
parent
7e31641234
commit
b381966b79
@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import,
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
from PyQt4.Qt import QTextCharFormat
|
||||
from PyQt4.Qt import QTextCharFormat, QFont
|
||||
|
||||
from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES
|
||||
from calibre.ebooks.oeb.polish.container import guess_type
|
||||
@ -41,3 +41,9 @@ class SyntaxTextCharFormat(QTextCharFormat):
|
||||
QTextCharFormat.__init__(self, *args)
|
||||
self.setProperty(SYNTAX_PROPERTY, True)
|
||||
|
||||
def __repr__(self):
|
||||
return 'SyntaxFormat(id=%s, color=%s, italic=%s, bold=%s)' % (
|
||||
id(self), self.foreground().color().name(), self.fontItalic(), self.fontWeight() >= QFont.DemiBold)
|
||||
__str__ = __repr__
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user