本文整理汇总了Python中draftjs_exporter.dom.DOM.use方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.use方法的具体用法?Python DOM.use怎么用?Python DOM.use使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类draftjs_exporter.dom.DOM
的用法示例。
在下文中一共展示了DOM.use方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def __init__(self, config=None):
if config is None:
config = {}
self.entity_decorators = config.get('entity_decorators', {})
self.composite_decorators = config.get('composite_decorators', [])
self.has_decorators = len(self.composite_decorators) > 0
self.block_map = config.get('block_map', BLOCK_MAP)
self.style_map = config.get('style_map', STYLE_MAP)
DOM.use(config.get('engine', DOM.STRING))
示例2: test_use_string
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def test_use_string(self):
DOM.use(DOM.STRING)
self.assertEqual(DOM.dom, DOMString)
示例3: test_use_invalid
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def test_use_invalid(self):
with self.assertRaises(ImportError):
DOM.use('test')
示例4: test_use_lxml
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def test_use_lxml(self):
DOM.use(DOM.LXML)
self.assertEqual(DOM.dom, DOM_LXML)
示例5: test_use_html5lib
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def test_use_html5lib(self):
DOM.use(DOM.HTML5LIB)
self.assertEqual(DOM.dom, DOM_HTML5LIB)
示例6: tearDown
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def tearDown(self):
DOM.use(DOM.HTML5LIB)
示例7: test_use_custom
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def test_use_custom(self):
DOM.use('tests.test_dom.DOMTestImpl')
self.assertEqual(DOM.dom, DOMTestImpl)
示例8: setUpClass
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def setUpClass(cls):
DOM.use(DOM.LXML)
cls.pr = cProfile.Profile()
cls.pr.enable()
print('\nlxml')
示例9:
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
from __future__ import absolute_import, unicode_literals
from draftjs_exporter.dom import DOM
# Initialise a default engine for the test suites.
DOM.use(DOM.HTML5LIB)
示例10: setUp
# 需要导入模块: from draftjs_exporter.dom import DOM [as 别名]
# 或者: from draftjs_exporter.dom.DOM import use [as 别名]
def setUp(self):
DOM.use(DOM.STRING)
self.style_state = StyleState(style_map)