X-Git-Url: https://git.tld-linux.org/?p=tld-ftp-admin.git;a=blobdiff_plain;f=modules%2Fconfig.py;fp=modules%2Fconfig.py;h=cab0594b267a4b2de9376e416bdc719923393e24;hp=ee32dfac8bdc58c4bc3ad333b92a111f775d6527;hb=51b9814081f743180ffed6c80fd7945acb554ce2;hpb=f7b22268ab563fa906be0653d037f1805e220e5c diff --git a/modules/config.py b/modules/config.py index ee32dfa..cab0594 100644 --- a/modules/config.py +++ b/modules/config.py @@ -4,7 +4,7 @@ import string, os value = {} -if os.environ.has_key('HOME'): +if 'HOME' in os.environ: path = os.environ['HOME'] else: path = '../../' # cgi-bin interface @@ -12,13 +12,13 @@ else: f = open(path + '/.ftpadmrc', 'r') for line in f.readlines(): - if line[0] == '#' or string.find(line, '=') == -1: + if line[0] == '#' or str.find(line, '=') == -1: continue - tuple = string.split(string.strip(line), '=') + tuple = str.split(str.strip(line), '=') if tuple[1][0] == '"': - value[string.strip(tuple[0])] = tuple[1][1:-1] + value[str.strip(tuple[0])] = tuple[1][1:-1] else: - value[string.strip(tuple[0])] = string.strip(tuple[1]) + value[str.strip(tuple[0])] = str.strip(tuple[1]) f.close()