File: ncftpls

package info (click to toggle)
duplicity 3.0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,260 kB
  • sloc: python: 25,089; sh: 934; ansic: 392; makefile: 83
file content (20 lines) | stat: -rwxr-xr-x 515 bytes parent folder | download | duplicates (2)
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('/')]))