Skip to content

Commit

Permalink
Create Ports to avoid portspec lookup on outdated vtk modules
Browse files Browse the repository at this point in the history
  • Loading branch information
rexissimus committed Jul 21, 2015
1 parent 9237082 commit 1bda0dc
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions vistrails/packages/vtk/init.py
Expand Up @@ -43,7 +43,7 @@

from distutils.version import LooseVersion
from vistrails.core.configuration import ConfigField
from vistrails.core.modules.basic_modules import PathObject, \
from vistrails.core.modules.basic_modules import Path, PathObject, \
identifier as basic_pkg
from vistrails.core.modules.config import ModuleSettings
from vistrails.core.modules.vistrails_module import ModuleError
Expand All @@ -54,6 +54,7 @@
from vistrails.core.upgradeworkflow import UpgradeWorkflowHandler,\
UpgradeModuleRemap, UpgradePackageRemap
from vistrails.core.vistrail.connection import Connection
from vistrails.core.vistrail.port import Port
from .pythonclass import BaseClassModule, gen_class_module

from .tf_widget import _modules as tf_modules
Expand Down Expand Up @@ -427,11 +428,26 @@ def remap(old_conn, new_module):
old_conn.source,
path_module,
'name')
# Avoid descriptor lookup by explicitly creating Ports
input_port_id = controller.id_scope.getNewId(Port.vtType)
input_port = Port(id=input_port_id,
name='value',
type='source',
signature=(Path,),
moduleId=path_module.id,
moduleName=path_module.name)
output_port_id = controller.id_scope.getNewId(Port.vtType)
output_port = Port(id=output_port_id,
name=name,
type='destination',
signature=(Path,),
moduleId=new_module.id,
moduleName=new_module.name)
conn2 = create_new_connection(controller,
path_module,
'value',
input_port,
new_module,
name)
output_port)
return [('add', path_module),
('add', conn1),
('add', conn2)]
Expand Down

0 comments on commit 1bda0dc

Please sign in to comment.