本文整理汇总了Python中pyasm.web.Palette.pop_palette方法的典型用法代码示例。如果您正苦于以下问题:Python Palette.pop_palette方法的具体用法?Python Palette.pop_palette怎么用?Python Palette.pop_palette使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.Palette
的用法示例。
在下文中一共展示了Palette.pop_palette方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import pop_palette [as 别名]
#.........这里部分代码省略.........
from pyasm.web import Palette
num_palettes = Palette.num_palettes()
#if include_mako in ['true', True]:
if include_mako not in ['false', False]:
html = html.replace("<", "<")
html = html.replace(">", ">")
html = my.process_mako(html)
# preparse out expressions
# use relative expressions - [expr]xxx[/expr]
p = re.compile('\[expr\](.*?)\[\/expr\]')
parser = ExpressionParser()
matches = p.finditer(html)
for m in matches:
full_expr = m.group()
expr = m.groups()[0]
result = parser.eval(expr, sobjects, single=True, state=my.state)
if isinstance(result, basestring):
result = Common.process_unicode_string(result)
else:
result = str(result)
html = html.replace(full_expr, result )
# use absolute expressions - [expr]xxx[/expr]
p = re.compile('\[abs_expr\](.*?)\[\/abs_expr\]')
parser = ExpressionParser()
matches = p.finditer(html)
for m in matches:
full_expr = m.group()
expr = m.groups()[0]
result = parser.eval(expr, single=True)
if isinstance(result, basestring):
result = Common.process_unicode_string(result)
else:
result = str(result)
html = html.replace(full_expr, result )
# need a top widget that can be used to refresh
top = my.top
my.set_as_panel(top)
top.add_class("spt_custom_top")
ignore_events = my.kwargs.get("ignore_events") in ['true', True]
if ignore_events:
top.add_style("pointer-events: none")
# create the content div
content = DivWdg()
content.add_class("spt_custom_content")
content.add_style("position: relative")
if ignore_events:
content.add_style("pointer-events: none")
top.add(content)
my.content = content
is_test = Container.get("CustomLayout::is_test")
if not is_test:
is_test = my.kwargs.get("is_test") in [True, 'true']
if is_test:
Container.put("CustomLayout::is_test", True)
my.handle_is_test(content)
html = my.replace_elements(html)
content.add(html)
if xml:
my.add_behaviors(content, xml)
# remove all the extra palettes created
while True:
extra_palettes = Palette.num_palettes() - num_palettes
if extra_palettes > 0:
Palette.pop_palette()
else:
break
if my.kwargs.get("is_top") in ['true', True]:
return html
elif my.kwargs.get("is_refresh"):
return content
else:
return top