xiaq avatar xiaq committed 02791a5

use `from MoinMoin.constants.keys import *` in storage/middleware/indexing.py

Comments (0)

Files changed (1)

MoinMoin/storage/middleware/indexing.py

 from MoinMoin import log
 logging = log.getLogger(__name__)
 
-from MoinMoin.constants.keys import (WIKINAME, NAMESPACE, NAME, NAME_EXACT, MTIME, CONTENTTYPE, TAGS, LANGUAGE,
-                                     USERID, ADDRESS, HOSTNAME, SIZE, ACTION, COMMENT, SUMMARY, CONTENT,
-                                     EXTERNALLINKS, ITEMLINKS, ITEMTRANSCLUSIONS, ACL, DISABLED, EMAIL, OPENID,
-                                     ITEMID, REVID, CURRENT, PARENTID, PTIME, LATEST_REVS, ALL_REVS, BACKENDNAME, DATAID)
+from MoinMoin.constants.keys import *
 from MoinMoin.constants.contenttypes import CONTENTTYPE_USER
 from MoinMoin.constants.namespaces import NAMESPACE_DEFAULT
-from MoinMoin.constants import keys
-from MoinMoin.constants.keys import ITEMTYPE
 
 from MoinMoin import user
 from MoinMoin.search.analyzers import item_name_analyzer, MimeTokenizer, AclTokenizer
             return userid_pseudo_field
         qp.add_plugin(PseudoFieldPlugin(dict(
             # username:JoeDoe searches for revisions modified by JoeDoe
-            username=userid_pseudo_field_factory(keys.USERID),
+            username=userid_pseudo_field_factory(USERID),
             # assigned:JoeDoe searches for tickets assigned to JoeDoe
-            assigned=userid_pseudo_field_factory('assigned_to'),  # XXX should be keys.ASSIGNED_TO
+            assigned=userid_pseudo_field_factory('assigned_to'),  # XXX should be ASSIGNED_TO
         )))
         return qp
 
         if wikiname is None:
             wikiname = app.cfg.interwikiname
         state = {'trusted': trusted,
-                 keys.NAME: [name],
-                 keys.ACTION: action,
-                 keys.ADDRESS: remote_addr,
-                 keys.USERID: userid,
-                 keys.WIKINAME: wikiname,
-                 keys.NAMESPACE: None,
-                 keys.ITEMID: self.itemid,  # real itemid or None
+                 NAME: [name],
+                 ACTION: action,
+                 ADDRESS: remote_addr,
+                 USERID: userid,
+                 WIKINAME: wikiname,
+                 NAMESPACE: None,
+                 ITEMID: self.itemid,  # real itemid or None
                  'contenttype_current': contenttype_current,
                  'contenttype_guessed': contenttype_guessed,
                  'acl_parent': acl_parent,
                 }
-        ct = meta.get(keys.CONTENTTYPE)
+        ct = meta.get(CONTENTTYPE)
         if ct == CONTENTTYPE_USER:
             Schema = UserMetaSchema
         else:
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 ProjectModifiedEvent.java.
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.