]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - modules/common.py
- all scripts use ftpiod for locking and logging
[projects/pld-ftp-admin.git] / modules / common.py
CommitLineData
81e9387d
MM
1# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
2
d9b3388c 3import os, sys, config
6ebc8df7 4
81e9387d
MM
5def fileexists(path):
6 if path[0]=='/':
7 fullpath=path
8 else:
9 fullpath=config.ftp_dir+path
e3aced8e 10 return os.path.exists(fullpath)
6ebc8df7
MM
11
12def checkdir(dir):
81e9387d
MM
13 if not fileexists(sys.argv[1]):
14 print config.value['ftp_dir']+'/'+sys.argv[1] + " does not exist"
15 sys.exit(1)
6ebc8df7 16
6992b18d 17if 'HOME' in os.environ:
88d4cb67 18 ftpadmdir=os.environ['HOME']+'/pld-ftp-admin/'
6992b18d 19else:
88d4cb67
MM
20 ftpadmdir='../'
21noarchcachedir=ftpadmdir+'var/noarch-cache/'
22tmpdir=ftpadmdir+'var/tmp/'
151d31cc 23
This page took 0.06265 seconds and 4 git commands to generate.