]> 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 c43aa6814b4ea5360734aa868235b2d030006cb7..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()
 
@@ -35,21 +35,26 @@ if 'sign_key' in value:
 else:
     sign_key = None
 
+if 'logs_list' in value:
+    logs_list = value['logs_list']
+else:
+    logs_list = None
+
 if 'signed_trees' in value:
     signed_trees = value['signed_trees'].split(' ')
 else:
     signed_trees = None
 
+if 'archived_trees' in value:
+    archived_trees = value['archived_trees'].split(' ')
+else:
+    archived_trees = None
+
 if 'old_poldek' in value and value['old_poldek'] == 'yes':
     old_poldek = True
 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:
@@ -64,3 +69,8 @@ if separate_noarch:
     all_ftp_archs = ['noarch'] + ftp_archs
 else:
     all_ftp_archs = ftp_archs
+
+if 'ftp_dist' in value:
+    ftp_dist = value['ftp_dist']
+else:
+    ftp_dist = 'pld'
This page took 0.025912 seconds and 4 git commands to generate.