summaryrefslogtreecommitdiffstats
path: root/reduce.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-15 12:51:57 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-15 12:51:57 +0800
commit51b0ec4e9ca960cc3e018207c50a4b2eaf692f9f (patch)
treeb1647840548d925809c1fd96e93dd0db632c7776 /reduce.py
parent16908be066b8a06549197420c88e8d141acd728f (diff)
downloadtrainer-51b0ec4e9ca960cc3e018207c50a4b2eaf692f9f.zip
trainer-51b0ec4e9ca960cc3e018207c50a4b2eaf692f9f.tar.gz
trainer-51b0ec4e9ca960cc3e018207c50a4b2eaf692f9f.tar.xz
fixes pep8 warnings
Diffstat (limited to 'reduce.py')
-rwxr-xr-xreduce.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/reduce.py b/reduce.py
index d2da148..01f8c8e 100755
--- a/reduce.py
+++ b/reduce.py
@@ -8,15 +8,18 @@ from myconfig import MyConfig
config = MyConfig()
+
def read_file(infile):
with open(infile, 'r') as f:
data = ''.join(f.readlines())
f.close()
return data
+
def handleError(error):
sys.exit(error)
+
def mergeSubIndex(output, path):
for root, dirs, files in os.walk(path, topdown=True, onerror=handleError):
for onefile in files:
@@ -26,11 +29,11 @@ def mergeSubIndex(output, path):
output.writelines([data])
else:
print('Unexpected file:' + filepath)
-
+
def iterateSubDirectory(oldroot, newroot, level):
#Merge the index in oldroot
- if level <= 0 :
+ if level <= 0:
newindex = newroot + config.getIndexPostfix()
os.makedirs(os.path.dirname(newindex), exist_ok=True)
newindexfile = open(newindex, 'a')