本文整理匯總了Python中outwiker.gui.stcstyle.StcStyle.parse方法的典型用法代碼示例。如果您正苦於以下問題:Python StcStyle.parse方法的具體用法?Python StcStyle.parse怎麽用?Python StcStyle.parse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類outwiker.gui.stcstyle.StcStyle
的用法示例。
在下文中一共展示了StcStyle.parse方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testParse_14
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def testParse_14 (self):
style = StcStyle.parse (u"back:#222222,bold,,,underline")
self.assertEqual (style.bold, True)
self.assertEqual (style.italic, False)
self.assertEqual (style.underline, True)
self.assertEqual (style.fore, u"#000000")
self.assertEqual (style.back, u"#222222")
示例2: testParse_03
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def testParse_03 (self):
style = StcStyle.parse (u"fore:#000000,bold")
self.assertEqual (style.bold, True)
self.assertEqual (style.italic, False)
self.assertEqual (style.underline, False)
self.assertEqual (style.fore, u"#000000")
self.assertEqual (style.back, u"#FFFFFF")
示例3: testParse_12
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def testParse_12 (self):
style = StcStyle.parse (u"fore:#AAAAAA,back:#222222,bold,underline")
self.assertEqual (style.bold, True)
self.assertEqual (style.italic, False)
self.assertEqual (style.underline, True)
self.assertEqual (style.fore, u"#AAAAAA")
self.assertEqual (style.back, u"#222222")
示例4: testParse_05
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def testParse_05 (self):
style = StcStyle.parse (u"FORE:#AAAAAA")
self.assertEqual (style.bold, False)
self.assertEqual (style.italic, False)
self.assertEqual (style.underline, False)
self.assertEqual (style.fore, u"#AAAAAA")
self.assertEqual (style.back, u"#FFFFFF")
示例5: testParse_04
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def testParse_04(self):
style = StcStyle.parse("fore:#AAAAAA")
self.assertEqual(style.bold, False)
self.assertEqual(style.italic, False)
self.assertEqual(style.underline, False)
self.assertEqual(style.fore, "#AAAAAA")
self.assertEqual(style.back, "#FFFFFF")
示例6: testParse_11
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def testParse_11(self):
style = StcStyle.parse(" fore:#AAAAAA , back:#222222 , bold,italic , underline ")
self.assertEqual(style.bold, True)
self.assertEqual(style.italic, True)
self.assertEqual(style.underline, True)
self.assertEqual(style.fore, "#AAAAAA")
self.assertEqual(style.back, "#222222")
示例7: _loadValue
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def _loadValue(self):
"""
Получить значение. В производных классах этот метод переопределяется
"""
style = StcStyle.parse(self.config.get(self.section, self.param))
if style is None:
raise ValueError
return style
示例8: testParse_invalid
# 需要導入模塊: from outwiker.gui.stcstyle import StcStyle [as 別名]
# 或者: from outwiker.gui.stcstyle.StcStyle import parse [as 別名]
def testParse_invalid (self):
self.assertEqual (StcStyle.parse (u"sdgsgd"), None)
self.assertEqual (StcStyle.parse (u"fore:#AAAAAA,back:#222222,boldasdfa"), None)