File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -107,14 +107,14 @@ class Merge(IOBase):
107
107
108
108
def __init__ (self , numinputs = 0 , ** inputs ):
109
109
super (Merge , self ).__init__ (** inputs )
110
- self .numinputs = numinputs
110
+ self ._numinputs = numinputs
111
111
add_traits (self .inputs , ['in%d' % (i + 1 ) for i in range (numinputs )])
112
112
113
113
def _list_outputs (self ):
114
114
outputs = self ._outputs ().get ()
115
115
out = []
116
116
if self .inputs .axis == 'vstack' :
117
- for idx in range (self .numinputs ):
117
+ for idx in range (self ._numinputs ):
118
118
value = getattr (self .inputs , 'in%d' % (idx + 1 ))
119
119
if isdefined (value ):
120
120
if isinstance (value , list ) and not self .inputs .no_flatten :
@@ -124,7 +124,7 @@ def _list_outputs(self):
124
124
else :
125
125
for i in range (len (filename_to_list (self .inputs .in1 ))):
126
126
out .insert (i , [])
127
- for j in range (self .numinputs ):
127
+ for j in range (self ._numinputs ):
128
128
out [i ].append (filename_to_list (getattr (self .inputs , 'in%d' % (j + 1 )))[i ])
129
129
if out :
130
130
outputs ['out' ] = out
Original file line number Diff line number Diff line change @@ -89,15 +89,13 @@ def format_node(node, format='python'):
89
89
klass .__class__ .__name__ )
90
90
comment = '# Node: %s' % node .fullname
91
91
spec = inspect .getargspec (node ._interface .__init__ )
92
- if spec .defaults :
93
- args = spec .args [1 :- len (spec .defaults )]
94
- else :
95
- args = spec .args [1 :]
92
+ args = spec .args [1 :]
96
93
if args :
97
94
filled_args = []
98
95
for arg in args :
99
- filled_args .append ('%s=%s' % (arg , getattr (node ._interface ,
100
- '_%s' % arg )))
96
+ if hasattr (node ._interface , '_%s' % arg ):
97
+ filled_args .append ('%s=%s' % (arg , getattr (node ._interface ,
98
+ '_%s' % arg )))
101
99
args = ', ' .join (filled_args )
102
100
else :
103
101
args = ''
You can’t perform that action at this time.
0 commit comments