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


Python search_query_parser.SearchQueryParser类代码示例

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


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

示例1: __init__

 def __init__(self, FIELD_MAP, field_metadata, db_prefs=None):
     self.FIELD_MAP = FIELD_MAP
     self.db_prefs = db_prefs
     self.composites = {}
     self.udc = get_udc()
     for key in field_metadata:
         if field_metadata[key]['datatype'] == 'composite':
             self.composites[field_metadata[key]['rec_index']] = key
     self.series_col = field_metadata['series']['rec_index']
     self.series_sort_col = field_metadata['series_sort']['rec_index']
     self._data = []
     self._map = self._map_filtered = []
     self.first_sort = True
     self.search_restriction = self.base_restriction = ''
     self.base_restriction_name = self.search_restriction_name = ''
     self.search_restriction_book_count = 0
     self.marked_ids_dict = {}
     self.field_metadata = field_metadata
     self.all_search_locations = field_metadata.get_search_terms()
     SearchQueryParser.__init__(self, self.all_search_locations, optimize=True)
     self.build_date_relop_dict()
     self.build_numeric_relop_dict()
     # Do this here so the var get updated when a library changes
     global pref_use_primary_find_in_search
     pref_use_primary_find_in_search = prefs['use_primary_find_in_search']
开发者ID:bjhemens,项目名称:calibre,代码行数:25,代码来源:caches.py

示例2: __init__

 def __init__(
     self,
     dbcache,
     all_book_ids,
     gst,
     date_search,
     num_search,
     bool_search,
     keypair_search,
     limit_search_columns,
     limit_search_columns_to,
     locations,
     virtual_fields,
     lookup_saved_search,
     parse_cache,
 ):
     self.dbcache, self.all_book_ids = dbcache, all_book_ids
     self.all_search_locations = frozenset(locations)
     self.grouped_search_terms = gst
     self.date_search, self.num_search = date_search, num_search
     self.bool_search, self.keypair_search = bool_search, keypair_search
     self.limit_search_columns, self.limit_search_columns_to = (limit_search_columns, limit_search_columns_to)
     self.virtual_fields = virtual_fields or {}
     if "marked" not in self.virtual_fields:
         self.virtual_fields["marked"] = self
     SearchQueryParser.__init__(
         self, locations, optimize=True, lookup_saved_search=lookup_saved_search, parse_cache=parse_cache
     )
开发者ID:Frankenwolfe,项目名称:calibre,代码行数:28,代码来源:search.py

示例3: __init__

 def __init__(self, show_only_user_plugins=False):
     QAbstractItemModel.__init__(self)
     SearchQueryParser.__init__(self, ['all'])
     self.show_only_user_plugins = show_only_user_plugins
     self.icon = QIcon(I('plugins.png'))
     p = QIcon(self.icon).pixmap(64, 64, QIcon.Disabled, QIcon.On)
     self.disabled_icon = QIcon(p)
     self._p = p
     self.populate()
开发者ID:bwhitenb5e,项目名称:calibre,代码行数:9,代码来源:plugins.py

示例4: __init__

 def __init__(self, *args):
     QAbstractItemModel.__init__(self, *args)
     SearchQueryParser.__init__(self, locations=["all"])
     self.default_icon = QIcon(I("news.png"))
     self.custom_icon = QIcon(I("user_profile.png"))
     self.builtin_recipe_collection = get_builtin_recipe_collection()
     self.scheduler_config = SchedulerConfig()
     try:
         with zipfile.ZipFile(P("builtin_recipes.zip", allow_user_override=False), "r") as zf:
             self.favicons = dict([(x.filename, x) for x in zf.infolist() if x.filename.endswith(".png")])
     except:
         self.favicons = {}
     self.do_refresh()
开发者ID:JapaChin,项目名称:calibre,代码行数:13,代码来源:model.py

示例5: __init__

    def __init__(self):
        QAbstractTableModel.__init__(self)
        SearchQueryParser.__init__(self, ["all"])

        self.wait_icon = QVariant(QIcon(I("jobs.png")))
        self.running_icon = QVariant(QIcon(I("exec.png")))
        self.error_icon = QVariant(QIcon(I("dialog_error.png")))
        self.done_icon = QVariant(QIcon(I("ok.png")))

        self.jobs = []
        self.add_job = Dispatcher(self._add_job)
        self.server = Server(limit=int(config["worker_limit"] / 2.0), enforce_cpu_limit=config["enforce_cpu_limit"])
        self.threaded_server = ThreadedJobServer()
        self.changed_queue = Queue()

        self.timer = QTimer(self)
        self.timer.timeout.connect(self.update, type=Qt.QueuedConnection)
        self.timer.start(1000)
开发者ID:Eksmo,项目名称:calibre,代码行数:18,代码来源:jobs.py

示例6: __init__

    def __init__(self, keyboard, parent=None):
        QAbstractItemModel.__init__(self, parent)
        SearchQueryParser.__init__(self, ["all"])

        self.keyboard = keyboard
        groups = sorted(keyboard.groups, key=sort_key)
        shortcut_map = {k: v.copy() for k, v in self.keyboard.shortcuts.iteritems()}
        for un, s in shortcut_map.iteritems():
            s["keys"] = tuple(self.keyboard.keys_map.get(un, ()))
            s["unique_name"] = un
            s["group"] = [g for g, names in self.keyboard.groups.iteritems() if un in names][0]

        group_map = {
            group: sorted(names, key=lambda x: sort_key(shortcut_map[x]["name"]))
            for group, names in self.keyboard.groups.iteritems()
        }

        self.data = [Node(group_map, shortcut_map, group) for group in groups]
开发者ID:hashken,项目名称:calibre,代码行数:18,代码来源:keyboard.py

示例7: parse

 def parse(self, *args, **kwargs):
     self.virtual_field_used = False
     return SearchQueryParser.parse(self, *args, **kwargs)
开发者ID:Pipeliner,项目名称:calibre,代码行数:3,代码来源:search.py

示例8: __init__

 def __init__(self, all_plugins=[]):
     SearchQueryParser.__init__(self, locations=self.USABLE_LOCATIONS)
     self.srs = set(all_plugins)
开发者ID:Eksmo,项目名称:calibre,代码行数:3,代码来源:models.py

示例9: __init__

 def __init__(self):
     SearchQueryParser.__init__(self, locations=self.USABLE_LOCATIONS)
     self.srs = set([])
开发者ID:Eksmo,项目名称:calibre,代码行数:3,代码来源:models.py

示例10: __init__

    def __init__(self, parent=None):
        QAbstractListModel.__init__(self, parent)
        SearchQueryParser.__init__(self, ['all'])
        raw_defaults, raw_custom = read_raw_tweaks()

        self.parse_tweaks(raw_defaults, raw_custom)
开发者ID:rakyi,项目名称:calibre,代码行数:6,代码来源:tweaks.py

示例11: __init__

 def __init__(self):
     SearchQueryParser.__init__(self, locations=self.USABLE_LOCATIONS)
     self.srs = set([])
     # remove joiner words surrounded by space or at string boundaries
     self.joiner_pat = re.compile(r'(^|\s)(and|not|or|a|the|is|of)(\s|$)', re.IGNORECASE)
     self.punctuation_table = {ord(x):' ' for x in string.punctuation}
开发者ID:AEliu,项目名称:calibre,代码行数:6,代码来源:models.py

示例12: __init__

 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     SearchQueryParser.__init__(self, ['all'])
     self.parse_tweaks()
开发者ID:JimmXinu,项目名称:calibre,代码行数:4,代码来源:tweaks.py


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