value = {}
-if os.environ.has_key('HOME'):
+if 'HOME' in os.environ:
path = os.environ['HOME']
else:
path = '../../' # cgi-bin interface
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()
if 'ftp_dist' in value:
ftp_dist = value['ftp_dist']
else:
- ftp_dist = 'pld'
+ ftp_dist = 'tld'