childrenToReturn = getChildrenFromParsedItem(wrappedResourceParent, node.entry, node.pythonFile);
//------------------------------------- treat python files (add the classes/methods,etc)
} else if (wrappedResourceParent instanceof PythonFile) {
// if it's a file, we want to show the classes and methods
PythonFile file = (PythonFile) wrappedResourceParent;
if (PythonPathHelper.isValidSourceFile(file.getActualObject())) {
if (nature != null) {
ICodeCompletionASTManager astManager = nature.getAstManager();
//the nature may still not be completely restored...
if (astManager != null) {
IModulesManager modulesManager = astManager.getModulesManager();
if (modulesManager instanceof IProjectModulesManager) {
IProjectModulesManager projectModulesManager = (IProjectModulesManager) modulesManager;
String moduleName = projectModulesManager.resolveModuleInDirectManager(file
.getActualObject());
if (moduleName != null) {
IModule module = projectModulesManager.getModuleInDirectManager(moduleName, nature,
true);
if (module == null) {
//ok, something strange happened... it shouldn't be null... maybe empty, but not null at this point
//so, if it exists, let's try to create it...
//TODO: This should be moved to somewhere else.
String resourceOSString = PydevPlugin.getIResourceOSString(file.getActualObject());
if (resourceOSString != null) {
File f = new File(resourceOSString);
if (f.exists()) {
projectModulesManager.addModule(new ModulesKey(moduleName, f));
module = projectModulesManager.getModuleInDirectManager(moduleName, nature,