本文整理汇总了Python中pyasm.web.HtmlElement.br方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.br方法的具体用法?Python HtmlElement.br怎么用?Python HtmlElement.br使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.br方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw_widgets
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def draw_widgets(my, widget, delete_widget, item_span):
'''actually drawing the widgets'''
widget.add(item_span)
widget.add(HtmlElement.br(2))
widget.add(SpanWdg(my.select, css='med'))
widget.add(delete_widget)
widget.add(HtmlElement.br(2))
示例2: _get_sobject_history_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def _get_sobject_history_wdg(my):
''' this method is called thru ajax '''
args = WebContainer.get_web().get_form_args()
# get the args in the URL
search_type = args['search_type']
search_id = args['search_id']
#sobject = Search.get_by_id(search_type, search_id)
div = Widget()
search = Search("sthpw/sobject_log")
search.add_filter("search_type", search_type)
search.add_filter("search_id", search_id)
sobjects = search.get_sobjects()
search = Search("sthpw/transaction_log")
search.add_filters("id", [x.get_value("transaction_log_id") for x in sobjects] )
sobjects = search.get_sobjects()
table = TableWdg("sthpw/transaction_log", "table", css='table')
table.set_show_property(False)
table.set_sobjects(sobjects)
div.add(table)
div.add(HtmlElement.br(2))
return div
div.add(assigned_shot_wdg)
div.add(HtmlElement.br(2))
return div
示例3: get_license_info_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_license_info_wdg(self):
div = DivWdg()
license = Environment.get_security().get_license()
if self.first_error:
return div
#if not license.is_licensed():
# return div
msg = DivWdg()
div.add(msg)
msg.add("The following describes the details of the installed license:<br/><br/>")
info_wdg = DivWdg()
div.add(info_wdg)
info_wdg.add_style("margin: 10px 30px")
info_wdg.add_style("font-size: 12px")
version = license.get_data("tactic_version")
if version:
info_wdg.add("TACTIC Version: ")
if version == "ALL":
version = "ALL (Open Source)"
info_wdg.add(version)
info_wdg.add(HtmlElement.br(2))
company = license.get_data("company")
info_wdg.add("Licensed To: ")
if company.find("Southpaw EPL") != -1:
company = SpanWdg("<a name='license'>Eclipse Public License v1.0</a> ")
icon = IconWdg("EPL v1.0", IconWdg.ZOOM)
company.add(icon)
company.add_class("hand")
company.add_behavior( {
'type': 'click_up',
'cbjs_action': '''
spt.help.load_alias("license")
'''
} )
info_wdg.add(company)
info_wdg.add(HtmlElement.br(2))
info_wdg.add("Max Users: ")
info_wdg.add(license.get_data("max_users") )
info_wdg.add(HtmlElement.br(2))
info_wdg.add("Current Users: ")
info_wdg.add(license.get_current_users() )
info_wdg.add(HtmlElement.br(2))
info_wdg.add("Expiry Date: ")
expiry_date = license.get_data("expiry_date")
if not expiry_date:
expiry_date = "Permanent"
info_wdg.add(expiry_date)
info_wdg.add(HtmlElement.br(2))
return div
示例4: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_display(my):
web = WebContainer.get_web()
if not my.view:
view = web.get_form_value("filter|view")
# create popup
create_popup = PopupWdg("create_action")
create_popup.set_auto_hide(False)
create_popup.add("Enter name of view: ")
create_popup.add(TextWdg("create_view_name"))
# create_popup.add( HtmlElement.br(2) )
# create_popup.add( "Copy from template: " )
# template_select = SelectWdg("copy_from_template")
# template_select.add_empty_option("-- None --")
# template_select.set_option("values", "list|summary|task")
# create_popup.add( template_select )
create_popup.add(HtmlElement.br(2, clear="all"))
from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg
create_icon = ProdIconButtonWdg("Create")
ajax = AjaxCmd()
ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
ajax.add_element_name("create_view_name")
ajax.add_element_name("auto_create_edit")
ajax.set_option("search_type", my.search_type)
ajax.set_option("project", Project.get_project_code())
if my.view:
ajax.set_option("template_view", my.view)
create_icon.add_event(
"onclick",
"%s;%s"
% (ajax.get_on_script(), "toggle_display('create_action');setTimeout('document.form.submit()',1000)"),
)
cancel_icon = ProdIconButtonWdg("Cancel")
cancel_icon.add_event("onclick", "toggle_display('create_action')")
span = SpanWdg()
span.add(create_icon)
span.add(cancel_icon)
create_popup.add(span)
create_popup.add(HtmlElement.br())
# add the create button
create = IconButtonWdg("Create View", IconWdg.SAVE, True)
create.add_event("onclick", "%s" % create_popup.get_on_script())
# lay it all out
widget = Widget()
widget.add(create_popup)
# Browser does not have create
# widget.add(create)
return widget
示例5: get_error_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_error_wdg(my):
div = DivWdg()
error_div = DivWdg()
error_div.add("Error %s" % my.status)
div.add(error_div)
error_div.add_style("font-size: 18px")
error_div.add_style("font-weight: bold")
error_div.add_style("padding: 10px")
error_div.add_style("width: auto")
error_div.add_gradient("background", "background")
error_div.add_border()
error_div.add_style("margin-left: 5px")
error_div.add_style("margin-right: 5px")
error_div.add_style("margin-top: -10px")
div.add("<br/>")
span = DivWdg()
#span.add_color("color", "color")
span.add_style("color", "#FFF")
if my.status == 404:
span.add(HtmlElement.b("You have tried to access a url that is not recognized."))
else:
span.add(HtmlElement.b(my.message))
span.add(HtmlElement.br(2))
web = WebContainer.get_web()
root = web.get_site_root()
if my.message.startswith('No project ['):
label = 'You may need to correct the default_project setting in the TACTIC config.'
else:
label = "Go to the Main page for a list of valid projects"
span.add(label)
div.add(span)
div.add(HtmlElement.br())
from tactic.ui.widget import ActionButtonWdg
button_div = DivWdg()
button_div.add_style("width: 90px")
button_div.add_style("margin: 0px auto")
div.add(button_div)
button = ActionButtonWdg(title="Go to Main", tip='Click to go to main page')
button_div.add(button)
button.add_behavior( {
'type': 'click_up',
'cbjs_action': '''
document.location = '/';
'''
} )
button.add_event("onmouseup", "document.location='/'")
return div
示例6: get_create_view_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_create_view_wdg(my, search_type):
# create popup
create_popup = PopupWdg("create_action")
create_popup.set_auto_hide(False)
create_popup.add("Enter name of view: ")
create_popup.add(TextWdg("create_view_name"))
# create_popup.add( HtmlElement.br(2) )
# create_popup.add( "Copy from template: " )
# template_select = SelectWdg("copy_from_template")
# template_select.add_empty_option("-- None --")
# template_select.set_option("values", "list|summary|task")
# create_popup.add( template_select )
create_popup.add(HtmlElement.br(2))
create_popup.add(CheckboxWdg("auto_create_edit", label="Auto Create Edit View"))
create_popup.add(HtmlElement.br(2, clear="all"))
from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg
create_icon = ProdIconButtonWdg("Create")
ajax = AjaxCmd()
ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
ajax.add_element_name("create_view_name")
ajax.add_element_name("auto_create_edit")
ajax.set_option("search_type", search_type)
ajax.set_option("project", Project.get_project_code())
div = ajax.generate_div()
div.set_post_ajax_script("document.form.submit()")
create_icon.add_event("onclick", "%s;%s" % (ajax.get_on_script(), "toggle_display('create_action')"))
cancel_icon = ProdIconButtonWdg("Cancel")
cancel_icon.add_event("onclick", "toggle_display('create_action')")
span = SpanWdg()
span.add(create_icon)
span.add(cancel_icon)
create_popup.add(span)
create_popup.add(HtmlElement.br())
# add the create button
create = IconButtonWdg("Create View", IconWdg.SAVE, True)
create.add_event("onclick", "%s" % create_popup.get_on_script())
# lay it all out
widget = Widget()
widget.add(create_popup)
widget.add(create)
widget.add(div)
return widget
示例7: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_display(my):
search_type = my.search_type
related_search_type = my.related_search_type_wdg.get_value()
if related_search_type:
search_type = related_search_type
hier_sel = my.get_hier_sel(search_type)
selected_related_search_type = hier_sel.get_value()
process_wdg = my.get_process_wdg(search_type)
context_wdg = my.get_context_wdg(search_type)
widget = my.main_div
if my.is_from_ajax(True):
widget = Widget()
else:
my.set_ajax_top(widget)
hidden = HiddenWdg("search_type" ,search_type)
widget.add(hidden)
hier_sel.add_event('onchange', my.get_refresh_script(show_progress=False))
widget.add(hier_sel)
#Tooltip doesn't work too well
#hint = HintWdg('Related search type you can optionally select to drive the process')
widget.add(HtmlElement.br(2))
widget.add(process_wdg)
widget.add(context_wdg)
return widget
示例8: get_advanced_definition_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_advanced_definition_wdg(self):
# add the advanced entry
advanced = DivWdg()
advanced.add_style("margin-top: 10px")
advanced.add_style("padding: 10px")
advanced.add_border()
title = DivWdg()
title.add_style("color: black")
title.add("Advanced - XML Column Definition")
title.add_style("margin-top: -23")
advanced.add(title)
advanced.add("<br/>")
input = TextAreaWdg("config_xml")
input.set_id("config_xml")
input.set_option("rows", "10")
input.set_option("cols", "70")
input.set_value(self.config_string)
advanced.add(input)
advanced.add(HtmlElement.br(2))
button_div = DivWdg()
button_div.add_style("text-align: center")
button = ActionButtonWdg(title="Save Definition")
#button = ProdIconButtonWdg("Save Definition")
button.add_event("onclick", "spt.custom_project.save_definition_cbk()")
button_div.add(button)
button_div.add_style("margin-left: 130px")
advanced.add(button_div)
return advanced
示例9: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_display(my):
box = DivWdg(css="login")
box.add_style("margin-top: auto")
box.add_style("margin-bottom: auto")
box.add_style("text-align: center")
script = HtmlElement.script(
"""function login(e) {
if (!e) var e = window.event;
if (e.keyCode == 13) {
submit_icon_button('Submit');
}}
"""
)
div = DivWdg()
div.add_style("margin: 0px 0px")
div.add_class("centered")
div.add(HtmlElement.br(6))
sthpw = SpanWdg("SOUTHPAW TECHNOLOGY INC", css="login_sthpw")
sthpw.add_style("color: #333")
div.add(sthpw)
div.add(HtmlElement.br(2))
div.add(my.get_error_wdg())
box.add(div)
widget = Widget()
# widget.add( HtmlElement.br(3) )
table = Table()
table.add_style("width: 100%")
table.add_style("height: 85%")
table.add_row()
td = table.add_cell()
td.add_style("vertical-align: middle")
td.add_style("text-align: center")
td.add_style("background: transparent")
td.add(box)
widget.add(table)
return widget
示例10: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_display(my):
# just refresh the whole thing
widget = DivWdg()
outer_widget = DivWdg(css='spt_view_panel')
search_div = DivWdg()
search_bvr = {
'type': 'click_up',
'cbjs_action': 'spt.dg_table.search_cbk(evt, bvr)',
'override_class_name': 'tactic.ui.cgapp.AppShotPanelWdg',
'override_target': 'bvr.src_el.getParent(".spt_app_shot_panel")',
'extra_args': {'instance_search_type': my.instance_search_type,
'asset_search_type': my.asset_search_type}
#'panel_id': 'main_body_search'
}
# WARNING: this is made just for main search box and won't be compatible with the simple search wdg
search_wdg = SearchWdg(search_type=my.search_type, custom_search_view='search_shot_loader', parent_key='', filter=''\
, display='block', custom_filter_view='', state=None, run_search_bvr=search_bvr)
#from tactic.ui.app.simple_search_wdg import SimpleSearchWdg
#search_wdg = SimpleSearchWdg(search_type=my.search_type, search_view=my.simple_search_view, state=None, run_search_bvr=search_bvr)
search_div.add( HtmlElement.spacer_div(1,10) )
search_div.add(search_wdg)
# if there is result, it could only be one shot
search = search_wdg.get_search()
shots = search.get_sobjects()
# avoid getting a shot when no shot is selected
if not my.shot_code and len(shots) == 1:
my.shot_code = shots[0].get_code()
outer_widget.add(search_div)
my.set_as_panel(outer_widget, class_name='spt_panel spt_view_panel spt_app_shot_panel')
#show_shot_panel = False
#if show_shot_panel:
panel = ViewPanelWdg( search_type=my.search_type, \
inline_search=True, show_search='false', show_refresh='false', view=my.view, \
run_search_bvr=search_bvr, simple_search_view=my.simple_search_view)
panel.set_sobjects(shots)
widget.add(panel)
show_instances_in_shot = ProdSetting.get_value_by_key("show_instances_in_shot_panel")
if show_instances_in_shot != "false":
widget.add(HtmlElement.h3("Asset Instances in Shot [%s]" %my.shot_code))
widget.add(HtmlElement.br(2))
asset_inst_panel = AppAssetInstancePanelWdg(search_type=my.search_type, instance_search_type=my.instance_search_type, asset_search_type=my.asset_search_type, shot_code=my.shot_code, show_search='false')
widget.add(asset_inst_panel)
outer_widget.add(widget)
return outer_widget
示例11: _handle_refs
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def _handle_refs(self, snapshot, widget, upstream, recursive=True):
xml = snapshot.get_xml_value("snapshot")
# go through the references
if upstream:
nodes = xml.get_nodes("snapshot/ref")
if nodes:
widget.add(HtmlElement.b('Upstream ref.'))
block = DivWdg()
block.add_style("margin-left: 30px")
block.add_style("margin-top: 10px")
for node in nodes:
self._handle_ref_node(node, block, upstream, recursive)
block.add(HtmlElement.br())
widget.add(block)
# go through the input references
nodes = xml.get_nodes("snapshot/input_ref")
if nodes:
widget.add(HtmlElement.br())
widget.add(HtmlElement.b("Input ref."))
block = DivWdg()
block.add_style("margin-left: 30px")
block.add_style("margin-top: 10px")
for node in nodes:
self._handle_ref_node(node, block, upstream, recursive)
widget.add(block)
else:
# go through the forward references
nodes = xml.get_nodes("snapshot/fref")
if nodes:
widget.add(HtmlElement.b("Downstream ref."))
block = DivWdg()
block.add_style("margin-left: 30px")
block.add_style("margin-top: 10px")
for node in nodes:
self._handle_ref_node(node, block, upstream, recursive)
widget.add(block)
示例12: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def init(my):
assert my.task
super(TaskExtraInfoWdg, my).init()
# create the visible element
icon = IconWdg('Time Card', icon=IconWdg.TIME)
my.add(icon)
my.add(HtmlElement.b(my.task.get_process()))
my.time_card = TimecardWdg()
my.time_card.set_task(my.task)
from pyasm.security import Login
# create the content
content = DivWdg()
content.add_style('width','46em')
# customize the extra info widget
my.set_class('timecard_main')
my.set_content(content)
my.set_mouseout_flag(False)
my.login = Login.get_by_login(my.task.get_assigned())
title = FloatDivWdg()
login_name = 'unassigned'
my.is_other = False
if my.login:
login_name = my.login.get_full_name()
if my.login.get_login() == Environment.get_login().get_login():
icon = IconWdg(icon=IconWdg.REFRESH)
icon.add_class('hand')
icon.add_event('onclick', my.time_card.get_refresh_script())
title.add(icon)
else:
my.is_other = True
title.add("Time card - %s" % login_name)
content.add(title)
content.add(CloseWdg(my.get_off_script()))
content.add(HtmlElement.br(2))
content.add(my.time_card, 'time')
if not my.login:
div = DivWdg(HtmlElement.b('Time card cannot be entered for unassigned task.'))
content.set_widget(div, 'time')
my.height = 60
elif my.is_other:
div = DivWdg(HtmlElement.b('Time card cannot be entered for other users [%s].'\
%login_name))
content.set_widget(div, 'time')
my.height = 60
示例13: get_new_tab_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_new_tab_wdg(self):
widget = Widget()
span = SpanWdg()
swap = SwapDisplayWdg.get_triangle_wdg()
title = SpanWdg("Tab Creation")
span.add(swap)
span.add(title)
span.add_style("float: left")
widget.add(span)
widget.add(HtmlElement.br() )
# add the tab selector
div = DivWdg()
SwapDisplayWdg.create_swap_title( title, swap, div)
tab_text = TextWdg("tab")
tab_text.set_persistence()
span = SpanWdg(css="med")
span.add("Tab: ")
span.add(tab_text)
div.add(span)
# parent
index_text = TextWdg("parent_tab")
index_text.set_persistence()
span = SpanWdg(css="med")
span.add("Parent Tab: ")
span.add(index_text)
span.add(HintWdg("Enter the name of the tab that this will fall under. Leave empty to put on the main tab") )
div.add(span)
# index
index_text = TextWdg("index")
index_text.set_attr("size", "4")
index_text.set_persistence()
span = SpanWdg(css="med")
span.add("Index: ")
span.add(index_text)
span.add(HintWdg("Enter the numeric location for this tab to be placed") )
div.add(span)
WebContainer.register_cmd("CreateTabCmd")
button = IconSubmitWdg("Create Tab", IconWdg.CREATE, True)
div.add(button)
widget.add(div)
return widget
示例14: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def get_display(my):
sobject = my.get_current_sobject()
instances = SObjectInstance.get_by_sobject(sobject, "prod/asset")
widget = Widget()
for instance in instances:
thumb = ThumbPublishWdg()
thumb.set_icon_size(60)
thumb.set_sobject(instance)
widget.add( "<b>%s</b>" % instance.get_value("asset_code") )
widget.add(thumb)
widget.add(HtmlElement.br(clear="all"))
return widget
示例15: _get_planned_wdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import br [as 别名]
def _get_planned_wdg(my):
''' this method is called thru ajax '''
args = WebContainer.get_web().get_form_args()
# get the args in the URL
search_type = args['search_type']
search_id = args['search_id']
sobject = Search.get_by_id(search_type, search_id)
assets_int_shot_wdg = AssetsInShotWdg()
assets_int_shot_wdg.set_sobject(sobject)
div = Widget()
div.add(assets_int_shot_wdg)
div.add(HtmlElement.br(2))
return div