Index: main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 11813)
+++ main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 11814)
@@ -29,5 +29,8 @@
 from waeup.kofa.utils.helpers import get_sorted_preferred
 
-def send_mail(from_name,from_addr,rcpt_name,rcpt_addr,subject,body,config):
+
+def send_mail(from_name, from_addr,
+              rcpt_name, rcpt_addr,
+              subject, body, config):
     """Wrapper for the real SMTP functionality in :mod:`waeup.kofa.smtp`.
 
@@ -39,4 +42,5 @@
     return True
 
+
 #: A list of phone prefixes (order num, country, prefix).
 #: Items with same order num will be sorted alphabetically.
@@ -44,9 +48,10 @@
 INT_PHONE_PREFIXES = [
     (99, _('Germany'), '49'),
-    ( 1, _('Nigeria'), '234'),
+    (1, _('Nigeria'), '234'),
     (99, _('U.S.'), '1'),
     ]
 
-def sorted_phone_prefixes(data = INT_PHONE_PREFIXES, request=None):
+
+def sorted_phone_prefixes(data=INT_PHONE_PREFIXES, request=None):
     """Sorted tuples of phone prefixes.
 
@@ -67,7 +72,8 @@
             for x, y, z in data]
     return tuple([
-        ('%s (+%s)' % (x[1],x[2]), '+%s' % x[2])
+        ('%s (+%s)' % (x[1], x[2]), '+%s' % x[2])
         for x in sorted(data)
         ])
+
 
 class KofaUtils(grok.GlobalUtility):
@@ -82,10 +88,10 @@
 
     PREFERRED_LANGUAGES_DICT = {
-        'en':(1, u'English'),
-        'fr':(2, u'Fran&ccedil;ais'),
-        'de':(3, u'Deutsch'),
-        'ha':(4, u'Hausa'),
-        'yo':(5, u'Yoruba'),
-        'ig':(6, u'Igbo'),
+        'en': (1, u'English'),
+        'fr': (2, u'Fran&ccedil;ais'),
+        'de': (3, u'Deutsch'),
+        'ha': (4, u'Hausa'),
+        'yo': (5, u'Yoruba'),
+        'ig': (6, u'Igbo'),
         }
 
@@ -179,9 +185,9 @@
 
     MODE_GROUPS = {
-        'All':('all',),
-        'Undergraduate Full-Time':('ug_ft',),
-        'Undergraduate Part-Time':('ug_pt',),
-        'Postgraduate Full-Time':('pg_ft',),
-        'Postgraduate Part-Time':('pg_pt',),
+        'All': ('all',),
+        'Undergraduate Full-Time': ('ug_ft',),
+        'Undergraduate Part-Time': ('ug_pt',),
+        'Postgraduate Full-Time': ('pg_ft',),
+        'Postgraduate Part-Time': ('pg_pt',),
         }
 
@@ -200,6 +206,6 @@
         }
 
-    def sendContactForm(self,from_name,from_addr,rcpt_name,rcpt_addr,
-                from_username,usertype,portal,body,subject):
+    def sendContactForm(self, from_name, from_addr, rcpt_name, rcpt_addr,
+                        from_username, usertype, portal, body, subject):
         """Send an email with data provided by forms.
         """
@@ -212,11 +218,10 @@
 ${e}
 """)
-        text = _(text,
-            mapping = {
-            'a':from_name,
-            'b':from_username,
-            'c':usertype,
-            'd':portal,
-            'e':body})
+        text = _(text, mapping={
+            'a': from_name,
+            'b': from_username,
+            'c': usertype,
+            'd': portal,
+            'e': body})
         body = translate(text, 'waeup.kofa',
             target_language=self.PORTAL_LANGUAGE)
@@ -224,5 +229,6 @@
             return False
         return send_mail(
-            from_name,from_addr,rcpt_name,rcpt_addr,subject,body,config)
+            from_name, from_addr, rcpt_name, rcpt_addr,
+            subject, body, config)
 
     @property
@@ -232,5 +238,5 @@
         return pytz.utc
 
-    def fullname(self,firstname,lastname,middlename=None):
+    def fullname(self, firstname, lastname, middlename=None):
         """Full name constructor.
         """
@@ -240,6 +246,6 @@
         else:
             name = '%s %s' % (firstname, lastname)
-        return string.capwords(name.replace('-',' - ')).replace(' - ','-')
-
+        return string.capwords(
+            name.replace('-', ' - ')).replace(' - ', '-')
 
     def genPassword(self, length=8, chars=string.letters + string.digits):
@@ -247,5 +253,4 @@
         """
         return ''.join([r().choice(chars) for i in range(length)])
-
 
     def sendCredentials(self, user, password=None, url_info=None, msg=None):
@@ -280,17 +285,17 @@
         rcpt_name = user.title
         rcpt_addr = user.email
-        text = _(text,
-            mapping = {
-            'a':rcpt_name,
-            'b':msg,
-            'c':config.name,
-            'd':user.name,
-            'e':password,
-            'f':url_info})
+        text = _(text, mapping={
+            'a': rcpt_name,
+            'b': msg,
+            'c': config.name,
+            'd': user.name,
+            'e': password,
+            'f': url_info})
 
         body = translate(text, 'waeup.kofa',
             target_language=self.PORTAL_LANGUAGE)
         return send_mail(
-            from_name,from_addr,rcpt_name,rcpt_addr,subject,body,config)
+            from_name, from_addr, rcpt_name, rcpt_addr,
+            subject, body, config)
 
     def getPaymentItem(self, payment):
