00001
00002
00003 import sys
00004 import os
00005 PKG = os.path.split(os.getcwd())[1]
00006 print "Creating pydev project for package '%s'"%PKG
00007 import roslib; roslib.load_manifest(PKG)
00008
00009 pathlist = "\n".join(["<path>%s</path>"%path for path in sys.path if os.path.exists(path)])
00010
00011 pydev_project= '''<?xml version="1.0" encoding="UTF-8" standalone="no"?>
00012 <?eclipse-pydev version="1.0"?>
00013
00014 <pydev_project>
00015 <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
00016 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
00017 <pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
00018 %s
00019 </pydev_pathproperty>
00020 </pydev_project>
00021 '''%pathlist
00022
00023 print "Writing .pydevproject, adding %d modules"%len(sys.path)
00024 f = open(".pydevproject","w")
00025 f.write(pydev_project)
00026 f.close()