]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - modules/common.py
- minor changes - mainly removing some additional files for noarch rpms
[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
11     try:
12         os.stat(fullpath)
13     except OSError, (errno, errmsg):
14         return False
15     else:
16         return True
17
18 def checkdir(dir):
19     if not fileexists(sys.argv[1]):
20         print config.value['ftp_dir']+'/'+sys.argv[1] + " does not exist"
21         sys.exit(1)
22
23 pldftpadmdir=os.environ['HOME']+'/pld-ftp-admin/'
24 noarchcachedir=pldftpadmdir+'var/noarch-cache/'
This page took 0.052429 seconds and 3 git commands to generate.