1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#!/usr/bin/python3
import os
import subprocess
import sys
from duplicity.backend import ParsedUrl
if sys.argv[1] == '-v':
print('blah 3.2.1')
sys.exit(8) # really, the backend expects 8 as the return
for arg in sys.argv:
if arg.startswith('DELE '):
pu = ParsedUrl(sys.argv[-1])
filename = os.path.join(pu.path.lstrip('/'), arg.split()[1])
sys.exit(subprocess.call(['rm', filename]))
pu = ParsedUrl(sys.argv[-1])
sys.exit(subprocess.call(['ls', '-l', pu.path.lstrip('/')]))
|