Thomas Waldmann avatar Thomas Waldmann committed dab5196

import terms module from new location

Comments (0)

Files changed (8)


                 elif xp_include_pages:
                     # We have a regex of pages to include
-                    from import NameFn
+                    from import NameFn
                     inc_match = re.compile(xp_include_pages)
                     root_item = Item(name=u'')
                     pagelist = [ for item in root_item.list_items(NameFn(inc_match))]


     def get_index(self):
         """ create an index of sub items of this item """
         import re
-        from import NameRE
+        from import NameRE
             prefix = + u'/'
     def get_templates(self, mimetype=None):
         """ create a list of templates (for some specific mimetype) """
-        from import AND, LastRevisionMetaDataMatch
+        from import AND, LastRevisionMetaDataMatch
         term = LastRevisionMetaDataMatch(TAGS, ['template']) # XXX there might be other tags
         if mimetype:
             term = AND(term, LastRevisionMetaDataMatch(MIMETYPE, mimetype))


 from flask import current_app as app
 from flaskext.script import Command, Option
-from import term
+from import NameRE
 class Reduce_Revisions(Command):
     def run(self, pattern):
         storage = app.unprotected_storage
-        query = term.NameRE(re.compile(pattern))
+        query = NameRE(re.compile(pattern))
         # If no pattern is given, the default regex will match every item.
         for item in storage.search_items(query):
             current_revno = item.next_revno - 1


 from flaskext.script import Command, Option
 from MoinMoin.script import fatal
-from import term
+from import NameRE
 from import NoSuchRevisionError
 class Set_Meta(Command):
             fatal("You need to either specify a proper key/value pair or "
                   "only a key you want to delete (with -r set).")
-        query = term.NameRE(re.compile(pattern))
+        query = NameRE(re.compile(pattern))
         for item in storage.search_items(query):
                 last_rev = item.get_revision(-1)


 from import Item, NewRevision
 from import memory
 from import NoSuchItemError, ItemAlreadyExistsError, NoSuchRevisionError, RevisionAlreadyExistsError
-from import term
+from import terms
 item_names = (u"quite_normal",
         query_string = u"song"
-        query = term.Name(query_string, True)
+        query = terms.Name(query_string, True)
         for num, item in enumerate(self.backend.search_items(query)):
             assert != -1
         assert num == 2
             assert len(found) == expected
         # must be /part/ of the name
-        yield _test_search, term.Name(u'AbCdEf', False), 3
-        yield _test_search, term.Name(u'AbCdEf', True), 0
-        yield _test_search, term.Name(u'abcdef', True), 3
-        yield _test_search, term.NameRE(re.compile(u'abcde.*')), 4
-        yield _test_search, term.NameFn(lambda n: n == u'abcdef'), 1
+        yield _test_search, terms.Name(u'AbCdEf', False), 3
+        yield _test_search, terms.Name(u'AbCdEf', True), 0
+        yield _test_search, terms.Name(u'abcdef', True), 3
+        yield _test_search, terms.NameRE(re.compile(u'abcde.*')), 4
+        yield _test_search, terms.NameFn(lambda n: n == u'abcdef'), 1
     def test_iteritems_1(self):
         for num in range(10, 20):


 import re
-from import term
+from import terms as term
 from import MemoryBackend
         for item, expected in [('c', False), ('Lorem', True), ('lorem', True), ('LOREM', True), ('NR', False)]:
             yield self._evaluate, t, item, expected
-coverage_modules = ['']
+coverage_modules = ['']


 class TermMatch(XMLSelectiveGenerator):
     def __init__(self, out, term):
-        self.term = term  # see
+        self.term = term  # see
         XMLSelectiveGenerator.__init__(self, out)
     def shall_serialize(self, item=None, rev=None,
 def get_by_filter(key, value):
     """ Searches for an user with a given filter """
-    from import term
-    filter = term.ItemMetaDataMatch(key, value)
-    items = get_user_backend().search_items(filter)
+    from import ItemMetaDataMatch
+    items = get_user_backend().search_items(ItemMetaDataMatch(key, value))
     users = [User( for item in items]
     return users
     :rtype: string
     :returns: the corresponding user ID or None
-    from import term
+    from import ItemMetaDataMatch
         backend = get_user_backend()
-        for user in backend.search_items(term.ItemMetaDataMatch('name', searchName)):
+        for user in backend.search_items(ItemMetaDataMatch('name', searchName)):
         return None
     except IndexError:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.