• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python api.escape函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中stoqlib.api.api.escape函数的典型用法代码示例。如果您正苦于以下问题:Python escape函数的具体用法?Python escape怎么用?Python escape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了escape函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _setup_widgets

    def _setup_widgets(self):
        self.sales_list.set_columns(self._get_sale_columns())
        self.returned_sales_list.set_columns(self._get_returned_sale_columns())
        self.product_list.set_columns(self._get_product_columns())
        self.services_list.set_columns(self._get_services_columns())
        self.work_order_list.set_columns(self._get_work_order_columns())
        self.payments_list.set_columns(self._get_payments_columns())
        self.calls_list.set_columns(self._get_calls_columns())
        self.account_list.set_columns(self._get_account_columns())
        self.sales_list.add_list(self.model.get_client_sales())
        self.returned_sales_list.add_list(self.model.get_client_returned_sales())
        self.product_list.add_list(self.model.get_client_products())
        self.services_list.add_list(self.model.get_client_services())
        self.work_order_list.add_list(self.model.get_client_work_orders())
        self.payments_list.add_list(self.model.get_client_payments())
        self.calls_list.add_list(self.model.person.calls)
        self.account_list.add_list(self.model.get_credit_transactions())
        value_format = '<b>%s</b>'
        total_label = "<b>%s</b>" % api.escape(_("Total:"))
        saldo_label = "<b>%s</b>" % api.escape(_("Balance:"))

        sales_summary_label = SummaryLabel(klist=self.sales_list,
                                           column='total',
                                           label=total_label,
                                           value_format=value_format)
        account_summary_label = SummaryLabel(klist=self.account_list,
                                             column='paid_value',
                                             label=saldo_label,
                                             value_format=value_format,
                                             data_func=lambda p: p.is_outpayment())

        sales_summary_label.show()
        account_summary_label.show()
        self.sales_vbox.pack_start(sales_summary_label, False)
        self.account_vbox.pack_start(account_summary_label, False)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:35,代码来源:clientdetails.py


示例2: _setup_widgets

    def _setup_widgets(self):
        self.sales_list.set_columns(self._get_sale_columns())
        self.product_list.set_columns(self._get_product_columns())
        self.services_list.set_columns(self._get_services_columns())
        self.payments_list.set_columns(self._get_payments_columns())
        self.calls_list.set_columns(self._get_calls_columns())
        self.account_list.set_columns(self._get_account_columns())

        self.sales_list.add_list(self.model.get_client_sales())
        self.product_list.add_list(self.model.get_client_products())
        self.services_list.add_list(self.model.get_client_services())
        self.payments_list.add_list(self.model.get_client_payments())
        self.calls_list.add_list(self.model.person.calls)
        self.account_list.add_list(self.model.get_credit_transactions())

        value_format = '<b>%s</b>'
        total_label = "<b>%s</b>" % api.escape(_("Total:"))
        saldo_label = "<b>%s</b>" % api.escape(_("Saldo:"))

        sales_summary_label = SummaryLabel(klist=self.sales_list,
                                           column='total',
                                           label=total_label,
                                           value_format=value_format)
        account_summary_label = SummaryLabel(klist=self.account_list,
                                             column='value',
                                             label=saldo_label,
                                             value_format=value_format)

        sales_summary_label.show()
        account_summary_label.show()
        self.sales_vbox.pack_start(sales_summary_label, False)
        self.account_vbox.pack_start(account_summary_label, False)
开发者ID:marianaanselmo,项目名称:stoq,代码行数:32,代码来源:clientdetails.py


示例3: _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)
开发者ID:Guillon88,项目名称:stoq,代码行数:34,代码来源:costcenterdialog.py


示例4: describe_item

    def describe_item(self, client_view):
        details = []
        birth_date = (client_view.birth_date and
                      client_view.birth_date.strftime('%x'))
        for label, value in [
                (_("Phone"), client_view.phone_number),
                (_("Mobile"), client_view.mobile_number),
                (self._person_l10n.label, client_view.cpf),
                (self._company_l10n.label, client_view.cnpj),
                (_("RG"), client_view.rg_number),
                (_("Birth date"), birth_date),
                (_("Category"), client_view.client_category),
                (_("Address"), format_address(client_view))]:
            if not value:
                continue
            details.append('%s: %s' % (label, api.escape(value)))

        name = "<big>%s</big>" % (api.escape(client_view.name), )
        if details:
            short = name + '\n<span size="small">%s</span>' % (
                api.escape(', '.join(details[:1])))
            complete = name + '\n<span size="small">%s</span>' % (
                api.escape('\n'.join(details)))
        else:
            short = name
            complete = name

        return short, complete
开发者ID:leandrodax,项目名称:stoq,代码行数:28,代码来源:queryentry.py


示例5: setup_proxies

 def setup_proxies(self):
     receiving_date = self.model.get_receival_date_str()
     branch_name = self.model.get_branch_name()
     text = _('Received in <b>%s</b> for branch <b>%s</b>')
     header_text = text % (api.escape(receiving_date),
                           api.escape(branch_name))
     self.header_label.set_markup(header_text)
     self.add_proxy(self.model, ['notes'])
开发者ID:romaia,项目名称:stoq,代码行数:8,代码来源:receivingdialog.py


示例6: __init__

    def __init__(self, cert_name, retry=False):
        super(CertificatePasswordDialog, self).__init__(None)

        text = _("Enter the password for <b>%s</b>:") % (api.escape(cert_name), )
        if retry:
            error_text = '<b><span color="red">%s</span></b>' % (
                api.escape(_("Wrong password provided...")), )
            text = "%s\n%s" % (error_text, text)
        self.info_lbl.set_markup(text)
开发者ID:hackedbellini,项目名称:stoq,代码行数:9,代码来源:certificatedialog.py


示例7: refresh

    def refresh(self):
        if stoq.trial_mode:
            self.status = ResourceStatus.STATUS_NA
            self.reason = (_('Online features are not available in trial mode'))
            self.reason_long = _('Online features require a subscription of Stoq.link')
            return

        if not api.sysparam.get_bool('ONLINE_SERVICES'):
            self.status = ResourceStatus.STATUS_NA
            self.reason = (_("Online services (Stoq.link integration, backup, "
                             "etc) not enabled..."))
            self.reason_long = _('Enable the parameter "Online Services" '
                                 'on the "Admin" app to solve this issue')
            return

        if self._check_running():
            self.status = self.STATUS_OK
            self.reason = _("Online services data hub is running fine.")
            self.reason_long = None
        else:
            self.status = ResourceStatus.STATUS_ERROR
            self.reason = _("Online services data hub not found...")
            package = '<a href="apt://stoq-server">stoq-server</a>'
            self.reason_long = safe_str(
                api.escape(_("Install and configure the %s package "
                             "to solve this issue")) % (package, ))
开发者ID:stoq,项目名称:stoq,代码行数:26,代码来源:status.py


示例8: search_completed

    def search_completed(self, results):
        # We are only interested in the workorders whose status are in one of our
        # columns
        results = results.find(WorkOrder.status.is_in(self.status_columns))
        for work_order_view in results.order_by(WorkOrder.open_date):
            work_order = work_order_view.work_order
            status_name = WorkOrder.statuses.get(work_order.status)
            # Skip cancel/delivered etc
            if status_name is None:
                continue

            # Since this column isnt one of the |work_order| status
            if work_order.client_informed_date:
                status_name = _('Client informed')

            column = self.get_column_by_title(status_name)
            if column is None:
                continue

            if work_order_view.sellable:
                description = '%s - %s' % (
                    work_order_view.sellable,
                    work_order_view.description)
            else:
                description = work_order_view.description

            # FIXME: Figure out a better way of rendering
            work_order_view.markup = '<b>%s</b>\n%s\n%s' % (
                description,
                str(api.escape(work_order_view.client_name)),
                work_order_view.open_date.strftime('%x'))

            column.append_item(work_order_view)
开发者ID:hackedbellini,项目名称:stoq,代码行数:33,代码来源:services.py


示例9: _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)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:renegotiationdetails.py


示例10: create_ui

    def create_ui(self):
        if api.sysparam.get_bool('SMART_LIST_LOADING'):
            self.search.enable_lazy_search()

        self.window.add_new_items([
            self.NewOrder,
            self.NewQuote,
            self.NewProduct,
            self.NewConsignment])
        self.window.add_search_items([
            self.Products,
            self.Suppliers,
            self.SearchQuotes,
            self.Services])
        self.search.set_summary_label(column='total',
                                      label=('<b>%s</b>' %
                                             api.escape(_('Orders total:'))),
                                      format='<b>%s</b>',
                                      parent=self.get_statusbar_message_area())
        self.results.set_selection_mode(gtk.SELECTION_MULTIPLE)
        self.Confirm.set_sensitive(False)

        self._inventory_widgets = [self.NewConsignment,
                                   self.CloseInConsignment]
        self.register_sensitive_group(self._inventory_widgets,
                                      lambda: not self.has_open_inventory())
开发者ID:amaurihamasu,项目名称:stoq,代码行数:26,代码来源:purchase.py


示例11: create_ui

    def create_ui(self):
        if api.sysparam.get_bool('SMART_LIST_LOADING'):
            self.search.enable_lazy_search()

        self.window.add_print_items2([
            (_("Print quote..."), 'work_order.PrintQuote'),
            (_("Print receipt..."), 'work_order.PrintReceipt'),
        ])
        self.window.add_export_items()
        self.window.add_extra_items2([
            (_("Send orders..."), 'work_order.SendOrders'),
            (_("Receive orders..."), 'work_order.ReceiveOrders'),
        ])
        self.window.add_extra_items([self.ViewKanban, self.ViewList])
        self.window.add_new_items2([
            (_("Work order..."), 'work_order.NewOrder'),
        ])

        self.window.add_search_items([
            self.Products,
            self.Services,
            self.Categories,
            self.Clients,
        ])

        self.search.set_summary_label(
            column='total',
            label=('<b>%s</b>' %
                   api.escape(_('Total:'))),
            format='<b>%s</b>',
            parent=self.get_statusbar_message_area())

        self.results.set_cell_data_func(self._on_results__cell_data_func)
开发者ID:hackedbellini,项目名称:stoq,代码行数:33,代码来源:services.py


示例12: _update_title

 def _update_title(self):
     # Workaround to get the current calendar date
     view = self.get_view()
     view.execute_script("document.title = $('.fc-header-title').text()")
     title = view.get_property('title')
     self.app.date_label.set_markup(
         '<big><b>%s</b></big>' % api.escape(title))
开发者ID:Guillon88,项目名称:stoq,代码行数:7,代码来源:calendar.py


示例13: _till_status_changed

    def _till_status_changed(self, closed, blocked):
        def large(s):
            return '<span weight="bold" size="xx-large">%s</span>' % (
                api.escape(s), )

        if closed:
            text = large(_("Till closed"))
            if not blocked:
                text += '\n\n<span size="large"><a href="open-till">%s</a></span>' % (
                    api.escape(_('Open till')))
        elif blocked:
            text = large(_("Till blocked"))
        else:
            text = large(_("Till open"))
        self.till_status_label.set_use_markup(True)
        self.till_status_label.set_justify(gtk.JUSTIFY_CENTER)
        self.till_status_label.set_markup(text)

        self.set_sensitive([self.TillOpen], closed)
        self.set_sensitive([self.TillVerify], not closed and not blocked)
        self.set_sensitive([
            self.TillClose, self.NewTrade, self.LoanClose, self.WorkOrderClose
        ], not closed or blocked)

        self._set_sale_sensitive(not closed and not blocked)
开发者ID:pkaislan,项目名称:stoq,代码行数:25,代码来源:pos.py


示例14: _update_account_type

    def _update_account_type(self, account_type):
        if not self.account_type.get_sensitive():
            return
        if account_type != Account.TYPE_BANK:
            self._remove_bank_widgets()
            self._remove_bank_option_widgets()
            self.code.set_sensitive(True)
            return

        self.code.set_sensitive(False)
        self.bank_type = ProxyComboBox()
        self._add_widget(api.escape(_("Bank:")), self.bank_type)
        self.bank_type.connect('content-changed',
                               self._on_bank_type__content_changed)
        self.bank_type.show()

        banks = [(_('Generic'), None)]
        banks.extend([(b.description,
                       b.bank_number) for b in get_all_banks()])
        self.bank_type.prefill(banks)

        if self.model.bank:
            try:
                self.bank_type.select(self.model.bank.bank_number)
            except KeyError:
                self.bank_type.select(None)

        self._update_bank_type()
开发者ID:romaia,项目名称:stoq,代码行数:28,代码来源:accounteditor.py


示例15: describe_item

    def describe_item(self, view):
        details = []
        for label, value in [(_("Name"), view.name), (_("CRM"), view.crm_number)]:
            if not value:
                continue
            details.append('%s: %s' % (label, api.escape(value)))
        name = "<big>%s</big>" % (api.escape(view.name), )
        if details:
            short = name + '\n<span size="small">%s</span>' % (
                api.escape(', '.join(details[:1])))
            complete = name + '\n<span size="small">%s</span>' % (
                api.escape('\n'.join(details)))
        else:
            short = name
            complete = name

        return short, complete
开发者ID:hackedbellini,项目名称:stoq,代码行数:17,代码来源:opticalslave.py


示例16: _check_demo_mode

    def _check_demo_mode(self):
        if not api.sysparam.get_bool('DEMO_MODE'):
            return

        if api.user_settings.get('hide-demo-warning'):
            return

        button_label = _('Use my own data')
        title = _('You are using Stoq with example data.')
        desc = (_("Some features are limited due to fiscal reasons. "
                  "Click on '%s' to remove the limitations.")
                % button_label)
        msg = '<b>%s</b>\n%s' % (api.escape(title), api.escape(desc))

        button = Gtk.Button(button_label)
        button.connect('clicked', self._on_enable_production__clicked)
        self.add_info_bar(Gtk.MessageType.WARNING, msg, action_widget=button)
开发者ID:hackedbellini,项目名称:stoq,代码行数:17,代码来源:shellwindow.py


示例17: _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)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:8,代码来源:purchasedetails.py


示例18: setup_widgets

 def setup_widgets(self):
     difference_label = gtk.Label()
     difference_label.set_markup(
         "<small><b>%s</b></small>"
         % api.escape(_(u"The DIFFERENCE column is equal to "
                        "IN STOCK minus MINIMUM columns")))
     difference_label.show()
     self.search.search.pack_end(difference_label, False, False, 6)
开发者ID:romaia,项目名称:stoq,代码行数:8,代码来源:productsearch.py


示例19: _setup_widgets

    def _setup_widgets(self):
        self.branch_label.set_markup(
            _(u"Fixing stock cost for products in <b>%s</b>") %
            api.escape(self._branch.person.name))

        items = ProductWithStockView.find_by_branch(self.store, self._branch)
        self._storables = [_TemporaryItem(s) for s in items]
        self.slave.listcontainer.add_items(self._storables)
开发者ID:romaia,项目名称:stoq,代码行数:8,代码来源:stockcostdialog.py


示例20: _setup_widgets

    def _setup_widgets(self):
        self.receiving_list.set_columns(self._get_receiving_columns())
        self.sales_list.set_columns(self._get_sale_columns())
        self.transfer_list.set_columns(self._get_transfer_columns())
        self.loan_list.set_columns(self._get_loan_columns())
        self.decrease_list.set_columns(self._get_decrease_columns())

        items = self.store.find(ReceivingItemView, sellable_id=self.model.id)

        self.receiving_list.add_list(list(items))

        items = self.store.find(SaleItemsView, sellable_id=self.model.id)
        self.sales_list.add_list(list(items))

        items = self.store.find(TransferOrderItem, sellable_id=self.model.id)
        self.transfer_list.add_list(list(items))

        items = self.store.find(LoanItemView, sellable_id=self.model.id)
        self.loan_list.add_list(list(items))

        items = self.store.find(StockDecreaseItemsView, sellable=self.model.id)
        self.decrease_list.add_list(list(items))

        value_format = '<b>%s</b>'
        total_label = "<b>%s</b>" % api.escape(_("Total:"))
        receiving_summary_label = SummaryLabel(klist=self.receiving_list,
                                               column='quantity',
                                               label=total_label,
                                               value_format=value_format)
        receiving_summary_label.show()
        self.receiving_vbox.pack_start(receiving_summary_label, False)

        sales_summary_label = SummaryLabel(klist=self.sales_list,
                                           column='quantity',
                                           label=total_label,
                                           value_format=value_format)
        sales_summary_label.show()
        self.sales_vbox.pack_start(sales_summary_label, False)

        transfer_summary_label = SummaryLabel(klist=self.transfer_list,
                                              column='quantity',
                                              label=total_label,
                                              value_format=value_format)
        transfer_summary_label.show()
        self.transfer_vbox.pack_start(transfer_summary_label, False)

        loan_summary_label = SummaryLabel(klist=self.loan_list,
                                          column='quantity',
                                          label=total_label,
                                          value_format=value_format)
        self.loan_vbox.pack_start(loan_summary_label, False)

        decrease_summary_label = SummaryLabel(klist=self.decrease_list,
                                              column='quantity',
                                              label=total_label,
                                              value_format=value_format)
        decrease_summary_label.show()
        self.decrease_vbox.pack_start(decrease_summary_label, False)
开发者ID:romaia,项目名称:stoq,代码行数:58,代码来源:productstockdetails.py



注:本文中的stoqlib.api.api.escape函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.for_combo函数代码示例发布时间:2022-05-27
下一篇:
Python serialbase.SerialBase类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap