Changeset 632
- Timestamp:
- 07/12/13 13:41:24 (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r623 r632 1 2.X.X 2 * Also made delete_spam virtual env aware 3 Fixed by: Bas van der Vlies 4 1 5 2.7.0 2 6 * use self.env.get_read_db for trac version > 0.11. self.env.get_db_cnx is obsolete. TRAC -
trunk/delete_spam.py.in
r628 r632 42 42 import shutil 43 43 import ConfigParser 44 45 from trac import __version__ as trac_version46 44 47 45 def ReadConfig(file, name): … … 122 120 # 123 121 configfile = '@email2trac_conf@' 122 virtualenv = '@virtualenv@' 123 124 124 125 125 … … 148 148 VERBOSE = True 149 149 150 151 if virtualenv and os.path.exists(virtualenv): 152 activate_this = os.path.join(virtualenv, 'bin/activate_this.py') 153 if os.path.exists(activate_this): 154 execfile(activate_this, dict(__file__=activate_this)) 155 156 157 try: 158 from trac import __version__ as trac_version 159 from trac import config as trac_config 160 from trac.env import Environment 161 from trac.ticket import Ticket 162 from trac import util 163 164 except ImportError, detail: 165 print "Can not find a a valid trac installation, solutions could be:" 166 print "\tset PYTHONPATH" 167 print "\tuse the --virtualenv <dir> option" 168 sys.exit(1) 169 150 170 # Determine major trac version used to be in email2trac.conf 151 171 # Quick hack for 0.12 152 172 # 153 version = '0.%s' %(trac_version.split('.')[1]) 154 if version.startswith('0.12'): 155 version = '0.12' 173 l = trac_version.split('.') 174 version = '.'.join(l[0:2]) 156 175 157 176 if VERBOSE: … … 160 179 ## We only support versions 0.11 and 0.12 161 180 # 162 if not version in ['0.11', '0.12' ]:181 if not version in ['0.11', '0.12', '1.0', '1,1']: 163 182 print 'Trac version %s is not suported' %(version) 164 183 … … 172 191 settings['VERBOSE'] = VERBOSE 173 192 174 from trac.env import Environment175 from trac.ticket import Ticket176 from trac import util177 178 179 180 193 new_delete_spam(settings) 181 194
Note: See TracChangeset
for help on using the changeset viewer.