I am trying to use the Gephi Toolkit in Jython, but have problems with it. Code below:
import sys sys.path.append('gephi-toolkit.jar') from org.openide.util import Lookup import org.gephi.project.api.ProjectController as ProjectController pc = Lookup.getDefault().lookup(ProjectController) workspace = pc.newProject() print "done."
He never reaches the last line. Instead, the following error appears:
Traceback (most recent call last): File "standalone.py", line 9, in <module> workspace = pc.newProject() AttributeError: 'NoneType' object has no attribute 'newProject'
Apparently, βLookup.getDefault (). Lookup (ProjectController)β returns None. Can someone tell me why? I found that the following workaround works (which bypasses Lookup):
... import org.gephi.project.impl.ProjectControllerImpl as ProjectControllerImpl pc = ProjectControllerImpl() workspace = pc.newProject()
I would like to know more about this issue. Thanks.
source share