def fname_presuffix(fname, prefix=u'', suffix=u'', newpath=None, use_ext=True):
 (pth, fname, ext) = split_filename(fname)
 if (not use_ext):
  ext = u''
 if (newpath and isdefined(newpath)):
  pth = os.path.abspath(newpath)
 return os.path.join(pth, (((prefix + fname) + suffix) + ext))

def fname_presuffix ( fname , prefix = u'' , suffix = u'' , newpath = None , use_ext = True ) : ( pth , fname , ext ) = split_filename ( fname ) if ( not use_ext ) : ext = u'' if ( newpath and isdefined ( newpath ) ) : pth = os . path . abspath ( newpath ) return os . path . join ( pth , ( ( ( prefix + fname ) + suffix ) + ext ) )
manipulates path and name of input filename parameters fname : string a filename prefix : string characters to prepend to the filename suffix : string characters to append to the filename newpath : string path to replace the path of the input fname use_ext : boolean if true .