test_conftypes: Use qenum_key for Font.__repr__
This commit is contained in:
parent
2546c871c8
commit
956f6ef5e6
@ -25,6 +25,7 @@ from collections import namedtuple
|
|||||||
|
|
||||||
import qutebrowser.config.conftypes as conftypes
|
import qutebrowser.config.conftypes as conftypes
|
||||||
from qutebrowser.test.stubs import FakeCmdUtils, FakeCommand
|
from qutebrowser.test.stubs import FakeCmdUtils, FakeCommand
|
||||||
|
from qutebrowser.utils.debug import qenum_key
|
||||||
|
|
||||||
from PyQt5.QtCore import QUrl
|
from PyQt5.QtCore import QUrl
|
||||||
from PyQt5.QtGui import QColor, QFont
|
from PyQt5.QtGui import QColor, QFont
|
||||||
@ -36,9 +37,10 @@ class Font(QFont):
|
|||||||
"""A QFont with a nicer repr()."""
|
"""A QFont with a nicer repr()."""
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return 'Font("{}", {}, {}, {})'.format(
|
return '<Font family={}, pt={}, px={}, weight={}, style={}>'.format(
|
||||||
self.family(), self.pointSize(), self.weight(),
|
self.family(), self.pointSize(), self.pixelSize(),
|
||||||
self.style() & QFont.StyleItalic)
|
qenum_key(QFont, self.weight(), add_base=True, klass=QFont.Weight),
|
||||||
|
self.style())
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def fromdesc(cls, desc):
|
def fromdesc(cls, desc):
|
||||||
|
Loading…
Reference in New Issue
Block a user