]> TLD Linux GIT Repositories - tld-ftp-admin.git/blobdiff - modules/config.py
- merged PLD changes
[tld-ftp-admin.git] / modules / config.py
index ee32dfac8bdc58c4bc3ad333b92a111f775d6527..cab0594b267a4b2de9376e416bdc719923393e24 100644 (file)
@@ -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()