[sysadmin-bin] Polish it a bit in terms of indentations.



commit 415434a32eb9134f34da61f43e22f8f057e6d4d3
Author: Andrea Veri <av gnome org>
Date:   Sat Sep 14 17:09:47 2013 +0200

    Polish it a bit in terms of indentations.

 generate-mirror-list.py |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/generate-mirror-list.py b/generate-mirror-list.py
index f4f2fac..026e1d7 100755
--- a/generate-mirror-list.py
+++ b/generate-mirror-list.py
@@ -7,13 +7,13 @@ file = open('/home/admin/secret/mango','r')
 lines = file.readlines()
 
 for line in lines:
-        if line.find("mysql_password") > -1:
-                dirty_password = line.split()
-                mirrors_password = str(dirty_password)
+    if line.find("mysql_password") > -1:
+        dirty_password = line.split()
+        mirrors_password = str(dirty_password)
 
-                sanitize_file=["\'","(",")","mysql_password","=","[","]","\"",";"]
-                for i in range(len(sanitize_file)):
-                        mirrors_password = mirrors_password.replace(sanitize_file[i],"")
+        sanitize_file=["\'","(",")","mysql_password","=","[","]","\"",";"]
+        for i in range(len(sanitize_file)):
+            mirrors_password = mirrors_password.replace(sanitize_file[i],"")
 file.close()
 
 db = MySQLdb.connect(host="drawable-back",
@@ -29,16 +29,17 @@ f = open ('/ftp/pub/GNOME/MIRRORS', 'w' )
 f.write('GNOME HTTP and FTP mirrors list' + '\n')
 
 for location in continents_list:
-        f.write('\n' + location + '\n')
-        cur.execute("select url from ftpmirrors where location = '%s' and active = '1'" % location)
-        result = cur.fetchall()
-
-        if not result:
-                f.write('\n' + '\t' + "No available mirrors for this country / continent as of now." + '\n')
-        else:
-               for i in result:
-                        f.write('\n' + '\t' + (str(i[0])))
-        f.write('\n')
+    f.write('\n' + location + '\n')
+
+    cur.execute("select url from ftpmirrors where location = '%s' and active = '1'" % location)
+    result = cur.fetchall()
+
+    if not result:
+        f.write('\n' + '\t' + "No available mirrors for this country / continent as of now." + '\n')
+    else:
+        for i in result:
+            f.write('\n' + '\t' + (str(i[0])))
+    f.write('\n')
 
 f.write('\n')
 f.write('------------------------------------------------------------' + '\n')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]