Today i was trying to use eclipse 3.3 w/ pydev to develop an app with django, but i really couldn’t make the code-completion (the main reason (along with the debugger) i was using eclipse!).
The main thing problem was that i had to add ALL folders to the pydev project settings. And, i didn’t have time (and patience) to add one folder by one to the config screen, sooo, i created this script to do that for me:
#!/usr/bin/env python
import dircache, os
def listdr(_dir):
try:
dir_list = dircache.listdir(os.path.realpath(_dir))
dir_list = [_dir + "/" + d for d in dir_list]
only_dirs = filter(lambda d: os.path.isdir(d), dir_list)
file = os.path.realpath(_dir)
print “<path>%s</path>” % file
for dir in dir_list:
listdr(dir)
except:
return
if __name__ == “__main__”:
listdr(“/usr/lib/python2.5/site-packages/django/”)
This script will show all folders under /usr/lib/python2.5/site-packages/django/ with that tags <path>, ready to add to the .pydevproject configuration file (that’s under your project file).




