@@ -1412,7 +1412,11 @@ class PikInputSpec(CommandLineInputSpec):
1412
1412
desc = 'output file' ,
1413
1413
argstr = '%s' ,
1414
1414
genfile = True ,
1415
- position = - 1 )
1415
+ position = - 1 ,
1416
+ name_source = ['input_file' ],
1417
+ hash_files = False ,
1418
+ name_template = '%s.png' ,
1419
+ keep_extension = False )
1416
1420
1417
1421
clobber = traits .Bool (
1418
1422
desc = 'Overwrite existing file.' ,
@@ -1568,37 +1572,6 @@ def _format_arg(self, name, spec, value):
1568
1572
'Unknown value for "title" argument: ' + str (value ))
1569
1573
return super (Pik , self )._format_arg (name , spec , value )
1570
1574
1571
- def _gen_outfilename (self ):
1572
- return self ._gen_filename ('output_file' )
1573
-
1574
- def _gen_filename (self , name ):
1575
- if name == 'output_file' :
1576
- output_file = self .inputs .output_file
1577
-
1578
- if isdefined (output_file ):
1579
- # FIXME make a warning instead?
1580
- assert not isdefined (self .inputs .png )
1581
- # FIXME make a warning instead?
1582
- assert not isdefined (self .inputs .jpg )
1583
- return os .path .abspath (output_file )
1584
- else :
1585
- b = aggregate_filename ([self .inputs .input_file ], 'pik_output' )
1586
- if isdefined (self .inputs .png ) and self .inputs .png :
1587
- return b + '.png'
1588
- elif isdefined (self .inputs .jpg ) and self .inputs .jpg :
1589
- return b + '.jpg'
1590
- else :
1591
- # By default we'll write a png file.
1592
- return b + '.png'
1593
- else :
1594
- raise NotImplemented
1595
-
1596
- def _list_outputs (self ):
1597
- outputs = self .output_spec ().get ()
1598
- outputs ['output_file' ] = os .path .abspath (
1599
- self ._gen_filename ('output_file' ))
1600
- return outputs
1601
-
1602
1575
1603
1576
class BlurInputSpec (CommandLineInputSpec ):
1604
1577
""" FIXME not implemented
0 commit comments