Changeset 50791b3 for python/aubio/bench
- Timestamp:
- Dec 16, 2005, 8:34:03 AM (19 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 0029638
- Parents:
- 336cf77
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/bench/node.py
r336cf77 r50791b3 42 42 return runcommand(cmd) 43 43 44 def act_on_data (action,datapath,respath ,suffix='.txt',filter='f',sub='\.wav$',**keywords):44 def act_on_data (action,datapath,respath=None,suffix='.txt',filter='f',sub='\.wav$',**keywords): 45 45 """ execute action(datafile,resfile) on all files in datapath """ 46 46 dirlist = list_files(datapath,filter=filter) 47 47 if dirlist == ['']: dirlist = [] 48 respath_in_datapath = re.split(datapath, respath,maxsplit=1)[1:]49 if(respath_in_datapath and suffix == ''): 50 print 'error: respath in datapath and no suffix used'51 #sys.exit(1)48 if respath: 49 respath_in_datapath = re.split(datapath, respath,maxsplit=1)[1:] 50 if(respath_in_datapath and suffix == ''): 51 print 'error: respath in datapath and no suffix used' 52 52 for i in dirlist: 53 53 j = re.split(datapath, i,maxsplit=1)[1] 54 54 j = re.sub(sub,'',j) 55 55 #j = "%s%s%s"%(respath,j,suffix) 56 j = "%s%s"%(respath,j) 57 if sub != '': 58 j = re.sub(sub,suffix,j) 59 else: 60 j = "%s%s" % (j,suffix) 56 if respath: 57 j = "%s%s"%(respath,j) 58 if sub != '': 59 j = re.sub(sub,suffix,j) 60 else: 61 j = "%s%s" % (j,suffix) 61 62 action(i,j,**keywords) 62 63 … … 73 74 class bench: 74 75 75 def __init__(self,datadir,resdir ,checkres=False,checkanno=False):76 def __init__(self,datadir,resdir=None,checkres=False,checkanno=False): 76 77 self.datadir = datadir 77 78 self.resdir = resdir 79 self.results = [] 78 80 print "Checking data directory", self.datadir 79 81 self.checkdata()
Note: See TracChangeset
for help on using the changeset viewer.