Commits

cmlenz  committed 05e5e2f

Ported [758] to stable.

  • Participants
  • Parent commits 45513bd
  • Branches 0.7-stable

Comments (0)

Files changed (3)

File scripts/tracd

 import trac.core
 import trac.util
 from trac.Href import Href
-from trac import auth, Wiki, siteconfig
+from trac import auth, siteconfig
 from trac.Environment import Environment
 
 
             if not self.remote_user:
                 return
 
-        db = self.env.get_db_cnx()
-        Wiki.populate_page_dict(db, self.env)
-
         # Parse arguments
         args = trac.core.parse_args(self.command, self.path_info,
                                     self.query_string,
                                     self.rfile, None, self.headers)
 
-        trac.core.dispatch_request(self.path_info, args, self, self.env, db)
+        trac.core.dispatch_request(self.path_info, args, self, self.env)
 
         self.log.debug('Total request time: %f s', time.time() - start)
 

File trac/ModPythonHandler.py

 
 import os
 import re, threading
-import auth, core, Environment, Href, Wiki
+import auth, core, Environment, Href
 from util import TracError, href_join
 from mod_python import apache, util
 
 
     env.href = Href.Href(mpr.cgi_location)
     env.abs_href = Href.Href(mpr.base_url)
-    # Let the wiki module build a dictionary of all page names
-    database = env.get_db_cnx()
-    Wiki.populate_page_dict(database, env)
+
     return env
 
 env_cache = {}

File trac/core.py

         self.write('\r\n')
 
 def dispatch_request(path_info, args, req, env, database=None):
+    import Wiki
+
     if not database:
         database = env.get_db_cnx()
 
+    # Let the wiki module build a dictionary of all page names
+    database = env.get_db_cnx()
+    Wiki.populate_page_dict(database, env)
+
     authenticator = auth.Authenticator(database, req)
     if path_info == '/logout':
         authenticator.logout()
 	env.log.error(tb.getvalue())
 
 def real_cgi_start():
-    import Wiki
 
     env = open_environment()
-    database = env.get_db_cnx()
-    
-    # Let the wiki module build a dictionary of all page names
-    Wiki.populate_page_dict(database, env)
     
     req = CGIRequest()
     req.init_request()
     args = parse_args(req.command,
                       path_info, os.getenv('QUERY_STRING'),
                       sys.stdin, os.environ)
-    dispatch_request(path_info, args, req, env, database)
+    dispatch_request(path_info, args, req, env)
 
 def cgi_start():
     try: