2019-02-27 16:39:27 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import glob
|
|
|
|
import os
|
|
|
|
|
|
|
|
os.chdir(os.path.dirname(__file__) + '/../')
|
|
|
|
|
2019-03-01 13:12:31 +00:00
|
|
|
for f in glob.glob('metadata/*/*/*.txt') + glob.glob('metadata/*/*/*/*.txt'):
|
2019-02-27 16:39:27 +00:00
|
|
|
if os.path.getsize(f) == 0:
|
|
|
|
os.remove(f)
|
|
|
|
continue
|
|
|
|
|
|
|
|
with open(f) as fp:
|
|
|
|
data = fp.read()
|
|
|
|
with open(f, 'w') as fp:
|
|
|
|
fp.write(data.strip().rstrip())
|
|
|
|
fp.write('\n')
|