/usr/share/pyshared/epsilon/asplode.py is in python-epsilon 0.7.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | import sys, os
from datetime import date
def status(x):
sys.stderr.write(x+'\n')
sys.stderr.flush()
def splode(linerator, proj, capproj):
current = None
for line in linerator:
line = line.replace('_project_', proj)
line = line.replace('_Project_', capproj)
line = line.replace('_date_', str(date.today()))
ls = line.split("###file:")
if len(ls) > 1:
fname = ls[1].strip()
if current is not None:
current.close()
try:
os.makedirs(os.path.dirname(fname))
except:
pass
current = file(fname, 'wb')
status('Created: ' + fname)
else:
current.write(line)
current.close()
def main(argv):
splode(sys.stdin.readlines(), 'zoop', 'Zoop')
if __name__ == '__main__':
main(sys.argv)
|