]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - modules/common.py
- extend ftpiod to be able to get locks info over the protocol
[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 5def fileexists(path):
8911f226
ER
6 if path[0] == '/':
7 fullpath = path
81e9387d 8 else:
8911f226 9 fullpath = config.ftp_dir + path
e3aced8e 10 return os.path.exists(fullpath)
6ebc8df7
MM
11
12def checkdir(dir):
637d76b9 13 if not fileexists(dir):
8911f226 14 print >>sys.stderr, 'ERR: ' + config.value['ftp_dir']+'/' + dir + " does not exist"
81e9387d 15 sys.exit(1)
6ebc8df7 16
6992b18d 17if 'HOME' in os.environ:
304fcc79 18 ftpadmdir = os.environ['HOME'] + '/pld-ftp-admin'
6992b18d 19else:
304fcc79 20 ftpadmdir = '..'
151d31cc 21
8911f226
ER
22# noarchcachedir is dir where noarch files contents are stored for AI
23# XXX: file reference where the AI resides
304fcc79 24noarchcachedir = ftpadmdir + '/var/noarch-cache/'
8911f226 25
304fcc79 26tmpdir = ftpadmdir + '/var/tmp/'
This page took 0.069691 seconds and 4 git commands to generate.