summaryrefslogtreecommitdiffstats
path: root/reduce.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-15 11:16:32 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-15 11:16:32 +0800
commit16908be066b8a06549197420c88e8d141acd728f (patch)
treefab32cef8c2d3caaf3c22a09dc39ea563f2afc64 /reduce.py
parentcfb98a4a366374a15b706cb9ed40c7026551334c (diff)
downloadtrainer-16908be066b8a06549197420c88e8d141acd728f.zip
trainer-16908be066b8a06549197420c88e8d141acd728f.tar.gz
trainer-16908be066b8a06549197420c88e8d141acd728f.tar.xz
fixes reduce.py
Diffstat (limited to 'reduce.py')
-rwxr-xr-xreduce.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/reduce.py b/reduce.py
index 96ed368..d2da148 100755
--- a/reduce.py
+++ b/reduce.py
@@ -23,7 +23,7 @@ def mergeSubIndex(output, path):
filepath = os.path.join(root, onefile)
if onefile.endswith(config.getIndexPostfix()):
data = read_file(filepath)
- output.writelines([data, os.linesep])
+ output.writelines([data])
else:
print('Unexpected file:' + filepath)
@@ -36,10 +36,12 @@ def iterateSubDirectory(oldroot, newroot, level):
newindexfile = open(newindex, 'a')
mergeSubIndex(newindexfile, oldroot)
newindexfile.close()
+ return
#Recursive into the sub directories
for onedir in os.listdir(oldroot):
olddir = os.path.join(oldroot, onedir)
newdir = os.path.join(newroot, onedir)
+
if not os.path.isdir(olddir):
sys.exit('Un-expected file:' + olddir)
else: