Updated for linux test
This commit is contained in:
@@ -25,14 +25,12 @@ def sourcedir_filecnt(sourcedir):
|
|||||||
if file.lower().endswith('.h'):
|
if file.lower().endswith('.h'):
|
||||||
cnt += 1
|
cnt += 1
|
||||||
filelist += [folderName+'/'+file]
|
filelist += [folderName+'/'+file]
|
||||||
print(folderName+'/'+file)
|
|
||||||
#print(filelist)
|
|
||||||
return cnt
|
return cnt
|
||||||
|
|
||||||
def process_files(sourcedir, destdir):
|
def process_files(sourcedir, destdir):
|
||||||
global filelist
|
global filelist
|
||||||
outfile = ''
|
|
||||||
for f in filelist:
|
for f in filelist:
|
||||||
|
outfile = ''
|
||||||
inputfile = f
|
inputfile = f
|
||||||
encodings = ['utf-8', 'latin-1', 'windows-1250', 'windows-1252', 'ascii',
|
encodings = ['utf-8', 'latin-1', 'windows-1250', 'windows-1252', 'ascii',
|
||||||
'big5', 'big5hkscs', 'cp037', 'cp273', 'cp424', 'cp437', 'cp500',
|
'big5', 'big5hkscs', 'cp037', 'cp273', 'cp424', 'cp437', 'cp500',
|
||||||
@@ -62,7 +60,6 @@ def process_files(sourcedir, destdir):
|
|||||||
break
|
break
|
||||||
print(os.path.basename(f))
|
print(os.path.basename(f))
|
||||||
for lines in fh:
|
for lines in fh:
|
||||||
print(lines)
|
|
||||||
outfile = outfile+lines
|
outfile = outfile+lines
|
||||||
fh.close()
|
fh.close()
|
||||||
outputfile = os.path.splitext(inputfile)[0]+'.inc'
|
outputfile = os.path.splitext(inputfile)[0]+'.inc'
|
||||||
@@ -80,11 +77,14 @@ def process_files(sourcedir, destdir):
|
|||||||
|
|
||||||
def single_thread():
|
def single_thread():
|
||||||
t1 = time.time()
|
t1 = time.time()
|
||||||
sourcedir_filecnt(sourcedir)
|
cnt = sourcedir_filecnt(sourcedir)
|
||||||
|
print('Files in: '+str(cnt))
|
||||||
process_files(sourcedir, destdir)
|
process_files(sourcedir, destdir)
|
||||||
print('Single thread process time: '+str(time.time()-t1))
|
print('Single thread process time: '+str(time.time()-t1))
|
||||||
|
|
||||||
sourcedir = 'C:/Users/dksojlg/Documents/gtk+-3.22.26'
|
#sourcedir = 'C:/Users/dksojlg/Documents/gtk+-3.22.26'
|
||||||
destdir = 'C:/Users/dksojlg/Documents/include'
|
sourcedir = '/usr/include'
|
||||||
|
#destdir = 'C:/Users/dksojlg/Documents/include'
|
||||||
|
destdir = '/data_2/include'
|
||||||
|
|
||||||
single_thread()
|
single_thread()
|
||||||
Reference in New Issue
Block a user