@@ -1570,7 +1570,7 @@ class SSHDataGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec):
1570
1570
desc = 'If set SSH commands will be logged to the given file' )
1571
1571
1572
1572
1573
- class SSHDataGrabber (IOBase ):
1573
+ class SSHDataGrabber (Datagrabber ):
1574
1574
""" Datagrabber module that downloads the file list and optionally
1575
1575
the files from a SSH server. The SSH operation must not need
1576
1576
user and password so an SSH agent must be active in where this
@@ -1647,46 +1647,13 @@ def __init__(self, infields=None, outfields=None, **kwargs):
1647
1647
if not outfields :
1648
1648
outfields = ['outfiles' ]
1649
1649
super (SSHDataGrabber , self ).__init__ (** kwargs )
1650
- undefined_traits = {}
1651
- # used for mandatory inputs check
1652
- self ._infields = infields
1653
- self ._outfields = outfields
1654
- if infields :
1655
- for key in infields :
1656
- self .inputs .add_trait (key , traits .Any )
1657
- undefined_traits [key ] = Undefined
1658
- # add ability to insert field specific templates
1659
- self .inputs .add_trait ('field_template' ,
1660
- traits .Dict (traits .Enum (outfields ),
1661
- desc = "arguments that fit into template" ))
1662
- undefined_traits ['field_template' ] = Undefined
1663
- if not isdefined (self .inputs .template_args ):
1664
- self .inputs .template_args = {}
1665
- for key in outfields :
1666
- if not key in self .inputs .template_args :
1667
- if infields :
1668
- self .inputs .template_args [key ] = [infields ]
1669
- else :
1670
- self .inputs .template_args [key ] = []
1671
-
1672
- self .inputs .trait_set (trait_change_notify = False , ** undefined_traits )
1673
-
1674
1650
if (
1675
1651
self .inputs .template_expression == 'regexp' and
1676
1652
self .inputs .template [- 1 ] != '$'
1677
1653
):
1678
1654
self .inputs .template += '$'
1679
1655
1680
1656
1681
-
1682
- def _add_output_traits (self , base ):
1683
- """
1684
-
1685
- Using traits.Any instead out OutputMultiPath till add_trait bug
1686
- is fixed.
1687
- """
1688
- return add_traits (base , self .inputs .template_args .keys ())
1689
-
1690
1657
def _list_outputs (self ):
1691
1658
if len (self .inputs .ssh_log_to_file ) > 0 :
1692
1659
paramiko .util .log_to_file (self .inputs .ssh_log_to_file )
@@ -1708,8 +1675,6 @@ def _list_outputs(self):
1708
1675
isdefined (self .inputs .field_template ) and \
1709
1676
key in self .inputs .field_template :
1710
1677
template = self .inputs .field_template [key ]
1711
- #template = os.path.join(
1712
- # os.path.abspath(self.inputs.base_directory), template)
1713
1678
if not args :
1714
1679
client = self ._get_ssh_client ()
1715
1680
sftp = client .open_sftp ()
0 commit comments