当前位置: 首页>>代码示例>>Python>>正文


Python SearchSlave.get_last_results方法代码示例

本文整理汇总了Python中stoqlib.gui.search.searchslave.SearchSlave.get_last_results方法的典型用法代码示例。如果您正苦于以下问题:Python SearchSlave.get_last_results方法的具体用法?Python SearchSlave.get_last_results怎么用?Python SearchSlave.get_last_results使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stoqlib.gui.search.searchslave.SearchSlave的用法示例。


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

示例1: ShellApp

# 需要导入模块: from stoqlib.gui.search.searchslave import SearchSlave [as 别名]
# 或者: from stoqlib.gui.search.searchslave.SearchSlave import get_last_results [as 别名]

#.........这里部分代码省略.........
        """
        return True

    def set_open_inventory(self):
        """ Subclasses should overide this if they call
        :obj:`.check_open_inventory`.

        This method will be called it there is an open inventory, so the
        application can disable some funcionalities
        """
        raise NotImplementedError

    def new_activate(self):
        """Called when the New toolbar item is activated"""
        raise NotImplementedError

    def search_activate(self):
        """Called when the Search toolbar item is activated"""
        raise NotImplementedError

    def print_activate(self):
        """Called when the Print toolbar item is activated"""
        if self.search_spec is None:
            raise NotImplementedError

        if self.results.get_selection_mode() == gtk.SELECTION_MULTIPLE:
            results = self.results.get_selected_rows()
        else:
            result = self.results.get_selected()
            results = [result] if result else None

        # There are no itens selected. We should print the entire list
        if not results:
            results = list(self.search.get_last_results())
        self.print_report(self.report_table, self.results, results)

    def export_spreadsheet_activate(self):
        """Called when the Export menu item is activated"""
        if self.search_spec is None:
            raise NotImplementedError

        model = self.results.get_model()
        if isinstance(model, LazyObjectModel):
            model.load_items_from_results(0, model._count)

        sse = SpreadSheetExporter()
        sse.export(object_list=self.results,
                   name=self.app_name,
                   filename_prefix=self.app_name)

    def create_filters(self):
        """Implement this to provide filters for the search container"""

    def search_completed(self, results, states):
        """Implement this if you want to know when a search has
        been completed.

        :param results: the search results
        :param states: search states used to construct the search query search
        """

    #
    # Public API
    #

    def add_ui_actions(self, ui_string, actions, name='Actions',
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:70,代码来源:shellapp.py


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