| 1 |
""" Use this script to remove the pinned versions from the allpinned |
| 2 |
directory created by extrap.py.""" |
| 3 |
|
| 4 |
from __future__ import print_function |
| 5 |
from extrap import fincre |
| 6 |
import os, sys |
| 7 |
|
| 8 |
def run(flist,dirname): |
| 9 |
f=open(flist) |
| 10 |
for fname in f: |
| 11 |
|
| 12 |
newname=fincre(fname.strip()) |
| 13 |
|
| 14 |
try: |
| 15 |
os.unlink(os.path.join(dirname,newname)) |
| 16 |
except (OSError,IOError) as e: |
| 17 |
print("Error removing %s"%newname) |
| 18 |
print("...%s"%str(e)) |
| 19 |
f.close() |
| 20 |
|
| 21 |
if __name__ == '__main__': |
| 22 |
print(' '.join(sys.argv)) |
| 23 |
run(*sys.argv[1:]) |