|
16 | 16 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
17 | 17 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
18 | 18 | # |
19 | | -# $Id: admin.py,v 1.107 2007-09-07 20:18:15 jpend Exp $ |
| 19 | +# $Id: admin.py,v 1.108 2007-09-11 04:12:17 jpend Exp $ |
20 | 20 |
|
21 | 21 | '''Administration commands for maintaining Roundup trackers. |
22 | 22 | ''' |
@@ -287,26 +287,31 @@ def listTemplates(self): |
287 | 287 |
|
288 | 288 | Look in the following places, where the later rules take precedence: |
289 | 289 |
|
290 | | - 1. <prefix>/share/roundup/templates/* |
| 290 | + 1. <roundup.admin.__file__>/../../share/roundup/templates/* |
| 291 | + this is where they will be if we installed an egg via easy_install |
| 292 | + 2. <prefix>/share/roundup/templates/* |
291 | 293 | this should be the standard place to find them when Roundup is |
292 | 294 | installed |
293 | | - 2. <roundup.admin.__file__>/../templates/* |
| 295 | + 3. <roundup.admin.__file__>/../templates/* |
294 | 296 | this will be used if Roundup's run in the distro (aka. source) |
295 | 297 | directory |
296 | | - 3. <current working dir>/* |
| 298 | + 4. <current working dir>/* |
297 | 299 | this is for when someone unpacks a 3rd-party template |
298 | | - 4. <current working dir> |
| 300 | + 5. <current working dir> |
299 | 301 | this is for someone who "cd"s to the 3rd-party template dir |
300 | 302 | ''' |
301 | 303 | # OK, try <prefix>/share/roundup/templates |
| 304 | + # and <egg-directory>/share/roundup/templates |
302 | 305 | # -- this module (roundup.admin) will be installed in something |
303 | 306 | # like: |
304 | | - # /usr/lib/python2.2/site-packages/roundup/admin.py (5 dirs up) |
305 | | - # c:\python22\lib\site-packages\roundup\admin.py (4 dirs up) |
306 | | - # we're interested in where the "lib" directory is - ie. the /usr/ |
307 | | - # part |
| 307 | + # /usr/lib/python2.5/site-packages/roundup/admin.py (5 dirs up) |
| 308 | + # c:\python25\lib\site-packages\roundup\admin.py (4 dirs up) |
| 309 | + # /usr/lib/python2.5/site-packages/roundup-1.3.3-py2.5-egg/roundup/admin.py |
| 310 | + # (2 dirs up) |
| 311 | + # |
| 312 | + # we're interested in where the directory containing "share" is |
308 | 313 | templates = {} |
309 | | - for N in 4, 5: |
| 314 | + for N in 2, 4, 5: |
310 | 315 | path = __file__ |
311 | 316 | # move up N elements in the path |
312 | 317 | for i in range(N): |
|
0 commit comments