Ejemplo n.º 1
0
 def add(self, stats, name, level):
     """Add item to the list."""
     self.append((
         FILTERS.get_filter_query(name),
         FILTERS.get_filter_name(name),
         getattr(stats, name),
         level,
         getattr(stats, '{}_words'.format(name)),
     ))
Ejemplo n.º 2
0
 def get_search_query_choices(self):
     """Return all filtering choices for query field."""
     filter_keys = [
         "nottranslated",
         "todo",
         "translated",
         "fuzzy",
         "suggestions",
         "variants",
         "labels",
         "context",
         "nosuggestions",
         "comments",
         "allchecks",
         "approved",
         "unapproved",
     ]
     result = [(key, FILTERS.get_filter_name(key),
                FILTERS.get_filter_query(key)) for key in filter_keys]
     return result
Ejemplo n.º 3
0
def search_name(query):
    """Returns name for a query string."""
    return FILTERS.get_search_name(query)