本文整理汇总了Python中pyasm.web.Palette.get方法的典型用法代码示例。如果您正苦于以下问题:Python Palette.get方法的具体用法?Python Palette.get怎么用?Python Palette.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.Palette
的用法示例。
在下文中一共展示了Palette.get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_color
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import get [as 别名]
def get_color(my):
color = Xml.get_attribute( my.node, "color" )
from pyasm.web import Palette
theme = Palette.get().get_theme()
if theme == 'dark':
color = Common.modify_color(color, -50)
return color
示例2: get_default_task_xml
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import get [as 别名]
def get_default_task_xml():
global TASK_PIPELINE
from pyasm.web import Palette
palette = Palette.get()
xml = Xml()
xml.read_string(TASK_PIPELINE)
nodes = Xml.get_nodes(xml, "pipeline/process")
for node in nodes:
process = Xml.get_attribute(node, "name")
color = Task.get_default_color(process)
Xml.set_attribute(node, "color", color)
return xml.to_string()
示例3: get_default_color
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import get [as 别名]
def get_default_color(process):
global default_xml
global OTHER_COLORS
#MTM added the if statements linked to statuses
if process.title() == 'Pending':
return "#d7d7d7"
elif process.title() == 'Ready':
return "#b2cee8"
elif process.title() == 'On_Hold':
return "#e8b2b8"
elif process.title() == 'Client Response':
return "#ddd5b8"
elif process.title() == 'Internal Rejection':
return "#ff0000"
elif process.title() == 'External Rejection':
return "#ff0000"
elif process.title() == 'Failed QC':
return "#ff0000"
elif process.title() == 'Rejected':
return "#ff0000"
elif process.title() == 'Fix Needed':
return "#c466a1"
elif process.title() == 'In_Progress':
return "#f5f3a4"
elif process.title() == 'DR In_Progress':
return "#d6e0a4"
elif process.title() == 'BATON In_Progress':
return "#c6e0a4"
elif process.title() == 'Export In_Progress':
return "#796999"
elif process.title() == 'Need Buddy Check':
return "#e3701a"
elif process.title() == 'Buddy Check In_Progress':
return "#1aade3"
elif process.title() == 'Completed':
return "#b7e0a5"
node = default_xml.get_node("pipeline/process[@name='%s']" % process.title())
if node is None:
return OTHER_COLORS.get(process.title())
color = default_xml.get_attribute(node, "color")
if not color:
color = OTHER_COLORS.get(process.title())
from pyasm.web import Palette
theme = Palette.get()
if theme == 'dark':
color = Common.modify_color(color, -50)
return color
示例4: get_default_color
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import get [as 别名]
def get_default_color(process):
global default_xml
global OTHER_COLORS
node = default_xml.get_node("pipeline/process[@name='%s']" % process.title())
if node is None:
return OTHER_COLORS.get(process.title())
color = default_xml.get_attribute(node, "color")
if not color:
color = OTHER_COLORS.get(process.title())
from pyasm.web import Palette
theme = Palette.get()
if theme == 'dark':
color = Common.modify_color(color, -50)
return color
示例5: __init__
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import get [as 别名]
def __init__(self):
self.data = {}
self.data['elements'] = []
palette = Palette.get()
background = palette.color("background")
color = palette.color("background3")
self.data['bg_colour'] = background
self.data['y_axis'] = {
'grid-colour': color,
'grid-visible': True,
'colour': color,
}
self.data['x_axis'] = {
'grid-colour': color,
'grid-visible': False,
'colour': color,
}
示例6: get_display
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import get [as 别名]
def get_display(my):
from pyasm.biz import Project
security = Environment.get_security()
if not security.check_access("builtin", "side_bar_schema", "allow", default="deny"):
return DivWdg()
section_div = LabeledHidableWdg(label="Schema Views")
section_div.set_attr('spt_class_name', Common.get_full_class_name(my) )
palette = Palette.get()
color = palette.color("background3")
project_div = RoundedCornerDivWdg(hex_color_code=color,corner_size="10")
project_div.set_dimensions( width_str='175px', content_height_str='100px' )
project = Project.get()
project_code = project.get_code()
project_type = project.get_type()
div = DivWdg()
section_div.add(project_div)
project_div.add(div)
# get project type schema
schema = Schema.get_by_code(project_code)
if schema:
div.add( my.get_schema_wdg(schema) )
#if not project_type:
# raise SetupException("Project type not found for this [%s]" %project_code)
if project_type:
schema = Schema.get_predefined_schema(project_type)
if schema:
div.add( my.get_schema_wdg(schema) )
schema = Schema.get_predefined_schema('config')
div.add( my.get_schema_wdg(schema) )
schema = Schema.get_admin_schema()
div.add( my.get_schema_wdg(schema) )
return section_div
# create a fake schema
project = Project.get()
db_name = project.get_database()
sql = DbContainer.get(db_name)
tables = sql.get_tables()
tables.sort()
tables_str = "\n".join( ['<search_type name="%s"/>'%x for x in tables] )
# look at all of the search objects for mapped tables
search = Search("sthpw/search_object")
#search.add_where('''"namespace" = 'MMS' or namespace = '{project}' ''')
search.add_filter("namespace", 'MMS')
search.add_filter("namespace", '{project}')
search.add_where("or")
search_types = search.get_sobjects()
#for search_type in search_types:
# print "hhhh: ", search_type
schema_xml = '''
<schema>
%s
</schema>
''' % tables_str
schema = SearchType.create("sthpw/schema")
schema.set_value("code", "table")
schema.set_value("schema", schema_xml)
#div.add( my.get_schema_wdg(schema) )
return section_div
示例7: get_display
# 需要导入模块: from pyasm.web import Palette [as 别名]
# 或者: from pyasm.web.Palette import get [as 别名]
def get_display(my):
web = WebContainer.get_web()
widget = Widget()
html = HtmlElement("html")
is_xhtml = False
if is_xhtml:
web.set_content_type("application/xhtml+xml")
widget.add('''<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
''')
html.add_attr("xmlns", "http://www.w3.org/1999/xhtml")
#html.add_attr("xmlns:svg", "http://www.w3.org/2000/svg")
# add the copyright
widget.add( my.get_copyright_wdg() )
widget.add(html)
# create the header
head = HtmlElement("head")
html.add(head)
head.add('<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>\n')
head.add('<meta http-equiv="X-UA-Compatible" content="IE=edge"/>\n')
# Add the tactic favicon
head.add('<link rel="shortcut icon" href="/context/favicon.ico" type="image/x-icon"/>')
# add the css styling
head.add(my.get_css_wdg())
# add the title in the header
project = Project.get()
project_code = project.get_code()
project_title = project.get_value("title")
if web.is_admin_page():
is_admin = " - Admin"
else:
is_admin = ""
if project_code == 'admin':
head.add("<title>TACTIC Site Admin</title>\n" )
else:
head.add("<title>%s%s</title>\n" % (project_title, is_admin) )
# add the javascript libraries
head.add( JavascriptImportWdg() )
# add the body
body = my.body
html.add( body )
# Add a NOSCRIPT tag block here to provide a warning message on browsers where 'Enable JavaScript'
# is not checked ... TODO: clean up and re-style to make look nicer
body.add( """
<NOSCRIPT>
<div style="border: 2px solid black; background-color: #FFFF99; color: black; width: 600px; height: 70px; padding: 20px;">
<img src="%s" style="border: none;" /> <b>Javascript is not enabled on your browser!</b>
<p>This TACTIC powered, web-based application requires JavaScript to be enabled in order to function. In your browser's options/preferences, please make sure that the 'Enable JavaScript' option is checked on, click OK to accept the settings change, and then refresh this web page.</p>
</div>
</NOSCRIPT>
""" % ( IconWdg.get_icon_path("ERROR") ) )
# add the content
if my.widgets:
content_wdg = my.get_widget('content')
else:
content_wdg = Widget()
my.add(content_wdg)
body.add( content_wdg )
body.add_event('onload', 'spt.onload_startup(this)')
if web.is_admin_page():
from tactic_branding_wdg import TacticCopyrightNoticeWdg
branding = TacticCopyrightNoticeWdg(show_license_info=True)
body.add(branding)
# add the admin bar
security = Environment.get_security()
if not web.is_admin_page() and security.check_access("builtin", "view_site_admin", "allow"):
div = DivWdg()
#.........这里部分代码省略.........