Changeset 2355

Show
Ignore:
Timestamp:
06/30/07 11:23:17 (1 year ago)
Author:
bewst
Message:

TracForgePlugin:

Make subproject dispatching work right everywhere (? -- haven't tried mod_python!)
Correct a unicode encoding oversight.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tracforgeplugin/branches/bewst/0.11-clearsilver/tracforge/admin/dispatch.py

    r2350 r2355  
    6060        environ['SCRIPT_NAME'] = req.href.projects() 
    6161        environ['PATH_INFO'] = path_info 
    62         print 'setting parent dir to', os.path.dirname(self.env.path) 
    6362         
    64 #        environ['TRAC_ENV_PARENT_DIR'] = os.path.dirname(self.env.path) 
    65 #        if 'TRAC_ENV' in environ: 
    66 #            del environ['TRAC_ENV'] 
    67  
    68 # The above incantation didn't work on the development server.  If we have 
    69 # problems serving subprojects on the real server, though, we may need to 
    70 # reinstate it along with the replacement below. 
    71  
    7263        environ['trac.env_parent_dir'] = os.path.dirname(self.env.path) 
    7364        if 'trac.env_path' in environ: 
    74             del environ['trac.env_path'] 
    75          
     65            # WARNING: this is a really FRAGILE HACK!! 
     66            # 
     67            # The code here used to delete the 'trac.env_path' key from environ, 
     68            # but then other code in web/main.py would use setdefault to bring 
     69            # it back to life... with the wrong value.  Code later in that file 
     70            # checks environ['trac.env_path'] as a truth value and treats empty  
     71            # results as absent. 
     72            environ['trac.env_path'] = '' 
     73 
    7674        req._response = dispatch_request(environ, start_response) 
    7775         
  • tracforgeplugin/branches/bewst/0.11-clearsilver/tracforge/admin/model.py

    r2321 r2355  
    280280                cursor = db.cursor() 
    281281                cursor.execute('INSERT INTO tracforge_project_log (project, action, args, return, stdout, stderr) VALUES (%s, %s, %s, %s, %s, %s)', 
    282                                (proj.name, action, args, rv, o_data, e_data)) 
     282                               (proj.name, action, args, unicode(rv), o_data, e_data)) 
    283283                db.commit() 
    284284                db.close()