本文整理汇总了Python中pyasm.web.Palette.num_palettes方法的典型用法代码示例。如果您正苦于以下问题:Python Palette.num_palettes方法的具体用法?Python Palette.num_palettes怎么用?Python Palette.num_palettes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.Palette
的用法示例。
在下文中一共展示了Palette.num_palettes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import num_palettes [as 别名]
#.........这里部分代码省略.........
sobject = SearchKey.get_by_search_key(my.search_key)
sobjects = [sobject]
else:
try:
# this will raise an exception if it is not in a table element
sobject = my.get_current_sobject()
if sobject:
sobjects = [sobject]
else:
sobjects = []
except:
sobject = my.sobjects
my.layout = my.get_layout_wdg()
# preprocess using mako
include_mako = my.kwargs.get("include_mako")
if not include_mako:
include_mako = my.view_attrs.get("include_mako")
if xml:
mako_node = xml.get_node("config/%s/mako" % my.view)
if mako_node is not None:
mako_str = xml.get_node_value(mako_node)
html = "<%%\n%s\n%%>\n%s" % (mako_str, html)
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)