]>
Commit | Line | Data |
---|---|---|
81e9387d MM |
1 | # vi: encoding=utf-8 ts=8 sts=4 sw=4 et |
2 | ||
d9b3388c | 3 | import os, sys, config |
6ebc8df7 | 4 | |
81e9387d MM |
5 | def fileexists(path): |
6 | if path[0]=='/': | |
7 | fullpath=path | |
8 | else: | |
9 | fullpath=config.ftp_dir+path | |
10 | ||
6ebc8df7 | 11 | try: |
81e9387d | 12 | os.stat(fullpath) |
6ebc8df7 MM |
13 | except OSError, (errno, errmsg): |
14 | return False | |
15 | else: | |
16 | return True | |
17 | ||
18 | def checkdir(dir): | |
81e9387d MM |
19 | if not fileexists(sys.argv[1]): |
20 | print config.value['ftp_dir']+'/'+sys.argv[1] + " does not exist" | |
21 | sys.exit(1) | |
6ebc8df7 | 22 | |
81e9387d MM |
23 | pldftpadmdir=os.environ['HOME']+'/pld-ftp-admin/' |
24 | noarchcachedir=pldftpadmdir+'var/noarch-cache/' | |
151d31cc MM |
25 | tmpdir=pldftpadmdir+'var/tmp' |
26 |