本文整理汇总了Python中lucterios.framework.xfercomponents.XferCompLabelForm.set_color方法的典型用法代码示例。如果您正苦于以下问题:Python XferCompLabelForm.set_color方法的具体用法?Python XferCompLabelForm.set_color怎么用?Python XferCompLabelForm.set_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucterios.framework.xfercomponents.XferCompLabelForm
的用法示例。
在下文中一共展示了XferCompLabelForm.set_color方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: summary_dummy
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_color [as 别名]
def summary_dummy(xfer):
if not hasattr(xfer, 'add_component'):
return True
else:
row = xfer.get_max_row() + 1
lab = XferCompLabelForm('dummytitle')
lab.set_value_as_infocenter("Dummy")
lab.set_location(0, row, 4)
xfer.add_component(lab)
lbl = XferCompLabelForm('dummy_time')
lbl.set_color('blue')
lbl.set_location(0, row + 1, 4)
lbl.set_centered()
lbl.set_value(datetime.now().ctime())
xfer.add_component(lbl)
btn = XferCompButton('btnscheduler')
btn.set_action(xfer.request, AddSchedulerTask.get_action('Task', ''))
btn.set_location(0, row + 2, 4)
xfer.add_component(btn)
lbl = XferCompLabelForm('dummy-value')
lbl.set_location(0, row + 3, 4)
lbl.set_value(Params.getvalue('dummy-value'))
xfer.add_component(lbl)
return True
示例2: show_third
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_color [as 别名]
def show_third(self, xfer, right=""):
xfer.params["supporting"] = self.item.id
third = xfer.get_components("third")
third.colspan -= 2
if WrapAction.is_permission(xfer.request, right):
btn = XferCompButton("change_third")
btn.set_location(third.col + third.colspan, third.row)
btn.set_action(
xfer.request,
ActionsManage.get_action_url("payoff.Supporting", "Third", xfer),
modal=FORMTYPE_MODAL,
close=CLOSE_NO,
params={"code_mask": self.item.get_third_mask()},
)
xfer.add_component(btn)
if self.item.third is not None:
btn = XferCompButton("show_third")
btn.set_is_mini(True)
btn.set_location(third.col + third.colspan + 1, third.row)
btn.set_action(
xfer.request,
ActionsManage.get_action_url("accounting.Third", "Show", xfer),
modal=FORMTYPE_MODAL,
close=CLOSE_NO,
params={"third": self.item.third.id},
)
xfer.add_component(btn)
lbl = XferCompLabelForm("info")
lbl.set_color("red")
lbl.set_location(1, xfer.get_max_row() + 1, 4)
lbl.set_value(self.item.get_info_state())
xfer.add_component(lbl)
示例3: summary_dummy
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_color [as 别名]
def summary_dummy(xfer):
row = xfer.get_max_row() + 1
lab = XferCompLabelForm('dummytitle')
lab.set_value_as_infocenter("Dummy")
lab.set_location(0, row, 4)
xfer.add_component(lab)
lbl = XferCompLabelForm('dummy_time')
lbl.set_color('blue')
lbl.set_location(0, row + 1, 4)
lbl.set_centered()
lbl.set_value(datetime.now().ctime())
xfer.add_component(lbl)
return True
示例4: summary_condo
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_color [as 别名]
def summary_condo(xfer):
is_right = WrapAction.is_permission(xfer.request, 'condominium.change_set')
owners = get_owners(xfer.request)
if is_right or (len(owners) == 1):
row = xfer.get_max_row() + 1
lab = XferCompLabelForm('condotitle')
lab.set_value_as_infocenter(_('Condominium'))
lab.set_location(0, row, 4)
xfer.add_component(lab)
if len(owners) == 1:
lab = XferCompLabelForm('condoowner')
lab.set_value(_('You are a owner'))
lab.set_location(0, row + 1, 2)
xfer.add_component(lab)
grid = XferCompGrid("part")
grid.set_model(owners[0].partition_set.filter(set__is_active=True), ["set", "value", (_("ratio"), 'ratio')])
grid.set_location(0, row + 2, 4)
grid.set_size(200, 500)
xfer.add_component(grid)
if is_right:
row = xfer.get_max_row() + 1
nb_set = len(Set.objects.filter(is_active=True))
nb_owner = len(Owner.objects.all())
lab = XferCompLabelForm('condoinfo')
lab.set_value_as_header(_("There are %(set)d classes of loads for %(owner)d owners") % {'set': nb_set, 'owner': nb_owner})
lab.set_location(0, row + 1, 4)
xfer.add_component(lab)
if Params.getvalue("condominium-old-accounting"):
lab = XferCompLabelForm('condoconvinfo')
lab.set_value_as_header(_("Your condominium account is not in respect of French law{[newline]}An conversion is necessary."))
lab.set_color('red')
lab.set_location(0, row + 2, 4)
xfer.add_component(lab)
btn = XferCompButton('condoconv')
btn.set_location(0, row + 3, 4)
btn.set_action(xfer.request, CondominiumConvert.get_action(_('Convertion ...'), ""), close=CLOSE_NO)
xfer.add_component(btn)
if is_right or (len(owners) == 1):
row = xfer.get_max_row() + 1
lab = XferCompLabelForm('condosep')
lab.set_value_as_infocenter("{[hr/]}")
lab.set_location(0, row, 4)
xfer.add_component(lab)
return True
else:
return False
示例5: create_dlg
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_color [as 别名]
def create_dlg(self, username, legalentity):
dlg = self.create_custom(self.model)
img = XferCompImage('img')
img.set_value(self.icon_path())
img.set_location(0, 0, 1, 6)
dlg.add_component(img)
dlg.fill_from_model(1, 0, False, ['genre', 'lastname', 'firstname', 'email'])
dlg.get_components('email').mask = '^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-_])+\.)+([a-zA-Z0-9]{2,4})+$'
row = dlg.get_max_row() + 1
edt = XferCompEdit("username")
edt.set_location(1, row)
edt.set_needed(True)
edt.set_value(username)
edt.description = _('username')
dlg.add_component(edt)
if Params.getvalue("contacts-createaccount") == 2:
row = dlg.get_max_row() + 1
edt = XferCompEdit("legalentity")
edt.set_location(1, row)
edt.set_needed(True)
edt.set_value(legalentity)
edt.description = _("your structure name")
dlg.add_component(edt)
row = dlg.get_max_row() + 1
edt = XferCompCaptcha("captcha")
edt.set_location(1, row)
edt.description = _("captcha")
dlg.add_component(edt)
lbl = XferCompLabelForm("error_lbl")
lbl.set_location(1, row + 1, 2)
lbl.set_color('red')
lbl.set_value(self.getparam('error', ''))
dlg.add_component(lbl)
dlg.add_action(self.get_action(_('Ok'), 'images/ok.png'), params={"SAVE": "YES"})
dlg.add_action(WrapAction(_('Cancel'), 'images/cancel.png'))
示例6: fillresponse
# 需要导入模块: from lucterios.framework.xfercomponents import XferCompLabelForm [as 别名]
# 或者: from lucterios.framework.xfercomponents.XferCompLabelForm import set_color [as 别名]
def fillresponse(self, season):
if season is None:
working_season = Season.current_season()
else:
working_season = Season.objects.get(id=season)
img = XferCompImage('img')
img.set_value(self.icon_path())
img.set_location(0, 0)
self.add_component(img)
lab = XferCompLabelForm('lbl_season')
lab.set_value_as_name(_('season'))
lab.set_location(1, 0)
self.add_component(lab)
sel = XferCompSelect('season')
sel.set_needed(True)
sel.set_select_query(Season.objects.all())
sel.set_value(working_season.id)
sel.set_location(2, 0)
sel.set_action(self.request, self.get_action('', ''), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
self.add_component(sel)
stat_result = working_season.get_statistic()
if len(stat_result) == 0:
lab = XferCompLabelForm('lbl_season')
lab.set_color('red')
lab.set_value_as_infocenter(_('no subscription!'))
lab.set_location(1, 1, 2)
self.add_component(lab)
else:
tab_iden = 0
for stat_title, stat_city, stat_type in stat_result:
tab_iden += 1
if (len(stat_city) > 0) and (len(stat_type) > 0):
self.new_tab(stat_title)
lab = XferCompLabelForm("lbltown_%d" % tab_iden)
lab.set_underlined()
lab.set_value(_("Result by city"))
lab.set_location(0, 1)
self.add_component(lab)
grid = XferCompGrid("town_%d" % tab_iden)
grid.add_header("city", _("city"))
grid.add_header("MajW", _("women major"))
grid.add_header("MajM", _("men major"))
grid.add_header("MinW", _("women minor"))
grid.add_header("MinM", _("men minor"))
grid.add_header("ratio", _("total (%)"))
cmp = 0
for stat_val in stat_city:
for stat_key in stat_val.keys():
grid.set_value(cmp, stat_key, stat_val[stat_key])
cmp += 1
grid.set_location(0, 2)
self.add_component(grid)
lab = XferCompLabelForm("lbltype_%d" % tab_iden)
lab.set_underlined()
lab.set_value(_("Result by type"))
lab.set_location(0, 3)
self.add_component(lab)
grid = XferCompGrid("type_%d" % tab_iden)
grid.add_header("type", _("type"))
grid.add_header("MajW", _("women major"))
grid.add_header("MajM", _("men major"))
grid.add_header("MinW", _("women minor"))
grid.add_header("MinM", _("men minor"))
grid.add_header("ratio", _("total (%)"))
cmp = 0
for stat_val in stat_type:
for stat_key in stat_val.keys():
if (stat_key == 'type') and not isinstance(stat_val['type'], six.text_type):
grid.set_value(cmp, stat_key, six.text_type(
SubscriptionType.objects.get(id=stat_val['type'])))
else:
grid.set_value(
cmp, stat_key, stat_val[stat_key])
cmp += 1
grid.set_location(0, 4)
self.add_component(grid)
self.add_action(AdherentStatisticPrint.get_action(TITLE_PRINT, "images/print.png"),
close=CLOSE_NO, params={'classname': self.__class__.__name__})
self.add_action(WrapAction(TITLE_CLOSE, 'images/close.png'))