]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - modules/common.py
- www stuff auths through ftpiod (daemon just has stub functions, but adding
[projects/pld-ftp-admin.git] / modules / common.py
1 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
2
3 import os, sys, config
4
5 def fileexists(path):
6     if path[0]=='/':
7         fullpath=path
8     else:
9         fullpath=config.ftp_dir+path
10     return os.path.exists(fullpath)
11
12 def checkdir(dir):
13     if not fileexists(sys.argv[1]):
14         print config.value['ftp_dir']+'/'+sys.argv[1] + " does not exist"
15         sys.exit(1)
16
17 if 'HOME' in os.environ:
18     pldftpadmdir=os.environ['HOME']+'/pld-ftp-admin/'
19 else:
20     pldftpadmdir='../'
21 noarchcachedir=pldftpadmdir+'var/noarch-cache/'
22 tmpdir=pldftpadmdir+'var/tmp'
23
This page took 0.052949 seconds and 3 git commands to generate.