gyrus r327 - in branches/gyrus-python: . src



Author: csaavedra
Date: Tue Mar  4 15:11:58 2008
New Revision: 327
URL: http://svn.gnome.org/viewvc/gyrus?rev=327&view=rev

Log:
2008-03-04  Claudio Saavedra  <csaavedra alumnos utalca cl>

	* src/gyrus_admin_mailbox.py: Use more descriptive
	variable names. Fixes bug #520301 (Francisco Rojas)




Modified:
   branches/gyrus-python/ChangeLog
   branches/gyrus-python/src/gyrus_admin_mailbox.py

Modified: branches/gyrus-python/src/gyrus_admin_mailbox.py
==============================================================================
--- branches/gyrus-python/src/gyrus_admin_mailbox.py	(original)
+++ branches/gyrus-python/src/gyrus_admin_mailbox.py	Tue Mar  4 15:11:58 2008
@@ -15,21 +15,21 @@
 
 
 def remove_mailbox (admin,mailbox):
-	r = admin.cnx.delete(NAMESPACE + mailbox)
+	response = admin.cnx.delete(NAMESPACE + mailbox)
 
-	if r[0] == 'OK':
+	if response[0] == 'OK':
 		return True,None
 	else:
-		return False,r[1][0]
+		return False,response[1][0]
 
 
 def create_mailbox (admin,mailbox):
-	r = admin.cnx.create(NAMESPACE + mailbox)
+	response = admin.cnx.create(NAMESPACE + mailbox)
 
-	if r[0] == 'OK':
+	if response[0] == 'OK':
 		return True,None
 	else:
-		return False,r[1][0]
+		return False,response[1][0]
 
 
 def set_quota_of_mailbox (admin,mailbox,quota):
@@ -56,36 +56,37 @@
 	if not data[0] == None:
 
 		token = None
-		i = 0
-		for b in data:
-			c = b.split("\"")
-			d = c[3].split(".")
+		num_users = 0
+		for mailbox in data:
+			info_mailbox = mailbox.split("\"")
+			domain_name_mailbox = info_mailbox[3].split(".")
 			try:
-				mb = d[1]
-				if not (mb == token):
-					token = mb
+				name_mailbox = domain_name_mailbox[1]
+				#Checks name_mailbox will not repeat
+				if not (name_mailbox == token):
+					token = name_mailbox
 					iter = model.append(None)
 					model.set (iter,COLUMN_MAILBOX_ICON, 
 							gtk.gdk.pixbuf_new_from_file_at_size (DIRGYRUS + "images/gyrus.png",15,15),
-							COLUMN_MAILBOX,mb)
-					i = i + 1
+							COLUMN_MAILBOX,name_mailbox)
+					num_users = num_users + 1
 			except:
 				print "error"
 				pass
 
-		col.set_title(_("Mailboxs" + " (" + str(i) + ")"))
+		col.set_title(_("Mailboxs" + " (" + str(num_users) + ")"))
 	else:
 		col.set_title(_("Mailboxs") + " (0)")
 		
 	
 
 def get_quota_of_mailbox (admin,mailbox):
-	r = admin.cnx.getquota(NAMESPACE + mailbox)
-
-	if r[0] == 'OK':
-		tm = r[1]
-		tmp = tm[0].split(" ")
+	response = admin.cnx.getquota(NAMESPACE + mailbox)
 
+	if response[0] == 'OK':
+		data_quota_mailbox = response[1]		
+		tmp = data_quota_mailbox[0].split(" ")
+		
 		used = tmp[2]
 		quota = tmp[3].split(")")[0]
 



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