本文整理汇总了Python中kiwi.ui.objectlist.SummaryLabel类的典型用法代码示例。如果您正苦于以下问题:Python SummaryLabel类的具体用法?Python SummaryLabel怎么用?Python SummaryLabel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SummaryLabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_summary_labels
def _setup_summary_labels(self):
summary_label = SummaryLabel(klist=self.payments_list,
column='paid_value',
label='<b>%s</b>' % api.escape(_(u"Total:")),
value_format='<b>%s</b>')
summary_label.show()
self.payments_vbox.pack_start(summary_label, False, True, 0)
示例2: _setup_summary_labels
def _setup_summary_labels(self):
order_summary_label = SummaryLabel(
klist=self.ordered_items,
column='total',
label='<b>%s</b>' % api.escape(_(u"Total")),
value_format='<b>%s</b>')
order_summary_label.show()
self.ordered_vbox.pack_start(order_summary_label, False)
示例3: _setup_summary_labels
def _setup_summary_labels(self):
summary_label = SummaryLabel(
klist=self.payments_list,
column="paid_value",
label="<b>%s</b>" % api.escape(_(u"Total:")),
value_format="<b>%s</b>",
)
summary_label.show()
self.payments_vbox.pack_start(summary_label, False)
示例4: setup_widgets
def setup_widgets(self):
value_format = '<b>%s</b>'
balance_label = "<b>%s</b>" % api.escape(_("Balance:"))
account_summary_label = SummaryLabel(klist=self.klist,
column='paid_value',
label=balance_label,
value_format=value_format,
data_func=lambda p: p.is_outpayment())
account_summary_label.show()
self.pack_start(account_summary_label, False, True, 0)
示例5: _setup_widgets
def _setup_widgets(self):
self._setup_status()
self.product_list.set_columns(self._get_product_columns())
products = self.store.find(TransferOrderItem, transfer_order=self.model)
self.product_list.add_list(list(products))
value_format = '<b>%s</b>'
total_label = value_format % api.escape(_("Total:"))
products_summary_label = SummaryLabel(klist=self.product_list,
column='total',
label=total_label,
value_format=value_format)
products_summary_label.show()
self.products_vbox.pack_start(products_summary_label, False)
示例6: PurchaseFinishProductListStep
class PurchaseFinishProductListStep(WizardEditorStep):
gladefile = 'PurchaseFinishProductListStep'
model_type = Settable
proxy_widgets = ()
def __init__(self, store, wizard, model):
WizardEditorStep.__init__(self, store, wizard, model)
self._setup_widgets()
def _setup_widgets(self):
self.product_list.set_columns(self._get_columns())
items = PurchaseItemView.find_by_purchase(self.store, self.model.purchase)
self.product_list.add_list(items)
self._setup_summary()
def _setup_summary(self):
self.summary = SummaryLabel(klist=self.product_list,
column='total_received',
value_format='<b>%s</b>')
self.summary.show()
self.vbox1.pack_start(self.summary, expand=False)
def _get_columns(self):
return [Column('description', title=_('Description'),
data_type=str, expand=True, searchable=True),
Column('quantity', title=_('Ordered'), data_type=int,
width=90, format_func=format_quantity, expand=True),
Column('quantity_received', title=_('Received'), data_type=int,
width=110, format_func=format_quantity),
Column('sellable.unit_description', title=_('Unit'),
data_type=str, width=50),
Column('cost', title=_('Cost'), data_type=currency, width=90),
Column('total_received', title=_('Total'), data_type=currency,
width=100)]
#
# WizardStep hooks
#
def next_step(self):
return PurchaseFinishPaymentAdjustStep(self.store, self.wizard,
self.model, self)
def has_previous_step(self):
return False
示例7: _create_summary_label
def _create_summary_label(self, report, column='value', label=None):
# Setting tha data
obj_list = getattr(self, report + '_list')
box = getattr(self, report + '_vbox')
if label is None:
label = _('Total:')
label = '<b>%s</b>' % api.escape(label)
value_format = '<b>%s</b>'
# Creating the label
label = SummaryLabel(klist=obj_list, column=column, label=label,
value_format=value_format)
# Displaying the label
box.pack_start(label, False, False, 0)
label.show()
return label
示例8: _setup_widgets
def _setup_widgets(self):
self.product_list.set_columns(self._get_product_columns())
products = self.store.find(ReceivingOrderItem,
receiving_order_id=self.model.id)
self.product_list.add_list(list(products))
value_format = '<b>%s</b>'
total_label = value_format % api.escape(_("Total:"))
products_summary_label = SummaryLabel(klist=self.product_list,
column='total',
label=total_label,
value_format=value_format)
products_summary_label.show()
self.products_vbox.pack_start(products_summary_label, False)
label = self.print_labels.get_children()[0]
label = label.get_children()[0].get_children()[1]
label.set_label(_(u'Print labels'))
示例9: _setup_widgets
def _setup_widgets(self):
self.product_list.set_columns(self._get_product_columns())
# if the parameter is on we have to build the summary
if api.sysparam.get_bool("CREATE_PAYMENTS_ON_STOCK_DECREASE"):
value_format = "<b>%s</b>"
total_cost_label = value_format % api.escape(_("Total cost:"))
products_cost_summary_label = SummaryLabel(
klist=self.product_list, column="total_cost", label=total_cost_label, value_format=value_format
)
products_cost_summary_label.show()
self.products_vbox.pack_start(products_cost_summary_label, False)
products = self.store.find(StockDecreaseItem, stock_decrease=self.model)
self.product_list.add_list(list(products))
if self.model.group:
self.payment_list.set_columns(self._get_payment_columns())
self.payment_list.add_list(list(self.model.group.payments))
else:
self.notebook.remove_page(2)
示例10: _setup_summary
def _setup_summary(self):
# FIXME: Move this into AdditionListSlave
if not self.summary_label_column:
self.summary = None
return
self.summary = SummaryLabel(klist=self.slave.klist,
column=self.summary_label_column,
label=self.summary_label_text,
value_format='<b>%s</b>')
self.summary.show()
self.slave.list_vbox.pack_start(self.summary, expand=False)
示例11: _setup_widgets
def _setup_widgets(self):
self.purchases_list.set_columns(self._get_purchase_columns())
self.product_list.set_columns(self._get_product_columns())
self.payments_list.set_columns(self._get_payments_columns())
purchases = self.model.get_supplier_purchases()
self.purchases_list.add_list(purchases)
self._build_data(purchases)
self.product_list.add_list(self.products)
self.payments_list.add_list(self.payments)
value_format = '<b>%s</b>'
total_label = "<b>%s</b>" % api.escape(_("Total:"))
purchases_summary_label = SummaryLabel(klist=self.purchases_list,
column='total',
label=total_label,
value_format=value_format)
purchases_summary_label.show()
self.purchases_vbox.pack_start(purchases_summary_label, False, True, 0)
示例12: _setup_widgets
def _setup_widgets(self):
self.product_list.set_columns(self._get_product_columns())
products = self.model.get_items(with_children=False)
# XXX Just a precaution
self.product_list.clear()
for product in products:
self.product_list.append(None, product)
for child in product.children_items:
self.product_list.append(product, child)
value_format = '<b>%s</b>'
total_label = value_format % api.escape(_("Total:"))
products_summary_label = SummaryLabel(klist=self.product_list,
column='total',
label=total_label,
value_format=value_format)
products_summary_label.show()
self.products_vbox.pack_start(products_summary_label, False)
label = self.print_labels.get_children()[0]
label = label.get_children()[0].get_children()[1]
label.set_label(_(u'Print labels'))
示例13: _setup_widgets
def _setup_widgets(self):
component_list = list(self._get_products())
if component_list:
self.component_combo.prefill(component_list)
else:
self.sort_components_check.set_sensitive(False)
self.component_tree.set_columns(self._get_columns())
self._populate_component_tree()
self.component_label = SummaryLabel(
klist=self.component_tree,
column='total_production_cost',
label='<b>%s</b>' % api.escape(_(u'Total:')),
value_format='<b>%s</b>')
self.component_label.show()
self.component_tree_vbox.pack_start(self.component_label, False)
self.info_label.set_bold(True)
self._update_widgets()
if self.visual_mode:
self.component_combo.set_sensitive(False)
self.add_button.set_sensitive(False)
self.sort_components_check.set_sensitive(False)
示例14: set_summary_label
def set_summary_label(self, column, label='Total:', format='%s'):
"""
Adds a summary label to the result set
@param column: the column to sum from
@param label: the label to use, defaults to 'Total:'
@param format: the format, defaults to '%%s', must include '%%s'
"""
if not '%s' in format:
raise ValueError("format must contain %s")
try:
self.results.get_column_by_name(column)
except LookupError:
raise ValueError("%s is not a valid column" % (column,))
if self._summary_label:
self._summary_label.parent.remove(self._summary_label)
self._summary_label = SummaryLabel(klist=self.results,
column=column,
label=label,
value_format=format)
self.pack_end(self._summary_label, False, False)
self.reorder_child(self._summary_label, 1)
self._summary_label.show()
示例15: _setup_summary_labels
def _setup_summary_labels(self):
value_format = "<b>%s</b>"
total_label = "<b>%s</b>" % api.escape(_("Total:"))
total_summary_label = SummaryLabel(klist=self.payments_list,
column='value',
label=total_label,
value_format=value_format)
total_summary_label.show()
self.payments_vbox.pack_start(total_summary_label, False)
total_label = "<b>%s</b>" % api.escape(_("Total paid:"))
total_paid_summary_label = SummaryLabel(klist=self.payments_list,
column='paid_value',
label=total_label,
value_format=value_format)
total_paid_summary_label.show()
self.payments_vbox.pack_start(total_paid_summary_label, False)
total_label = "<b>%s</b>" % api.escape(_("Total:"))
transaction_summary_label = SummaryLabel(
klist=self.stock_transactions_list,
column='total',
label=total_label,
value_format=value_format)
transaction_summary_label.show()
self.stock_transactions_vbox.pack_start(transaction_summary_label, False)
total_label = "<b>%s</b>" % api.escape(_("Total:"))
sale_summary_label = SummaryLabel(klist=self.sales_list,
column='total',
label=total_label,
value_format=value_format)
sale_summary_label.show()
self.sales_vbox.pack_start(sale_summary_label, False)