]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blobdiff - modules/config.py
Fix readlines() semantics
[projects/pld-ftp-admin.git] / modules / config.py
index bb43f4e560a0f2f163d50a1f3e9fc72f42bf1bc0..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()
 
@@ -55,11 +55,6 @@ if 'old_poldek' in value and value['old_poldek'] == 'yes':
 else:
     old_poldek = False
 
-if 'poldek_indexes' in value:
-    poldek_indexes = value['poldek_indexes']
-else:
-    poldek_indexes = 'old'
-
 if value['separate_noarch'] == 'yes':
     separate_noarch = True
 else:
This page took 0.024897 seconds and 4 git commands to generate.