Add pylint: disable-msg= where needed in Melange modules.
authorPawel Solyga <Pawel.Solyga@gmail.com>
Wed, 27 May 2009 03:31:58 +0200
changeset 2365 a66e1dd8ced7
parent 2364 a1cbd3143277
child 2366 1a954e80d444
Add pylint: disable-msg= where needed in Melange modules.
app/soc/cache/home.py
app/soc/cache/logic.py
app/soc/cache/rights.py
app/soc/cache/sidebar.py
app/soc/cron/student_proposal_mailer.py
app/soc/logic/cleaning.py
app/soc/logic/models/priority_group.py
app/soc/views/helper/templatetags/comments_helpers.py
--- a/app/soc/cache/home.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/cache/home.py	Wed May 27 03:31:58 2009 +0200
@@ -56,6 +56,7 @@
 
   memcache_key = key(entity)
   logging.info("Retrieving %s" % memcache_key)
+  # pylint: disable-msg=E1101
   return memcache.get(memcache_key), memcache_key
 
 def put(result, memcache_key, *args, **kwargs):
@@ -74,6 +75,7 @@
   retention = 10*60
 
   logging.info("Setting %s" % memcache_key)
+  # pylint: disable-msg=E1101
   memcache.add(memcache_key, result, retention)
 
 
@@ -88,6 +90,7 @@
 
   memcache_key = key(entity)
   logging.info("Flushing %s" % memcache_key)
+  # pylint: disable-msg=E1101
   memcache.delete(memcache_key)
 
 
--- a/app/soc/cache/logic.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/cache/logic.py	Wed May 27 03:31:58 2009 +0200
@@ -53,6 +53,7 @@
   """
 
   memcache_key = key(model, filter, order)
+  # pylint: disable-msg=E1101
   return memcache.get(memcache_key), memcache_key
 
 
@@ -65,6 +66,7 @@
 
   # Store data for fifteen minutes to force a refresh every so often
   retention = 15*60
+  # pylint: disable-msg=E1101
   memcache.add(memcache_key, data, retention)
 
 
@@ -73,6 +75,7 @@
   """
 
   memcache_key = key(model, filter)
+  # pylint: disable-msg=E1101
   memcache.delete(memcache_key)
 
 
--- a/app/soc/cache/rights.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/cache/rights.py	Wed May 27 03:31:58 2009 +0200
@@ -55,4 +55,5 @@
   """
 
   key_prefix = '%s.' % id
+  # pylint: disable-msg=E1101
   memcache.delete_multi(RIGHTS, key_prefix=key_prefix)
--- a/app/soc/cache/sidebar.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/cache/sidebar.py	Wed May 27 03:31:58 2009 +0200
@@ -41,6 +41,7 @@
   """
 
   memcache_key = key(id)
+  # pylint: disable-msg=E1101
   return memcache.get(memcache_key), memcache_key
 
 
@@ -53,7 +54,7 @@
 
   # Store sidebar for just three minutes to force a refresh every so often
   retention = 3*60
-
+  # pylint: disable-msg=E1101
   memcache.add(memcache_key, sidebar, retention)
 
 
@@ -70,6 +71,7 @@
     id = soc.logic.accounts.getCurrentAccount()
 
   memcache_key = key(id)
+  # pylint: disable-msg=E1101
   memcache.delete(memcache_key)
   soc.cache.rights.flush(id)
 
--- a/app/soc/cron/student_proposal_mailer.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/cron/student_proposal_mailer.py	Wed May 27 03:31:58 2009 +0200
@@ -149,6 +149,7 @@
       (sender_name, sender) = default_sender
 
     # construct the contents of the email
+    # pylint: disable-msg=E1103
     student_entity = proposal.scope
     program_entity = proposal.program
 
@@ -165,7 +166,6 @@
     accepted_proposal = proposal_logic.getForFields(fields, unique=True)
 
     if accepted_proposal:
-      org_entity = accepted_proposal.org
       # use the accepted template and subject
       template = DEF_ACCEPTED_MAIL_TEMPLATE
       context['subject'] = 'Congratulations!'
--- a/app/soc/logic/cleaning.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/logic/cleaning.py	Wed May 27 03:31:58 2009 +0200
@@ -191,7 +191,7 @@
     link_id = clean_link_id(field_name)(self)
 
     user_entity = user_logic.getForCurrentAccount()
-
+    # pylint: disable-msg=E1103
     if not user_entity or user_entity.link_id != link_id:
       # this user is not the current user
       raise forms.ValidationError("This user is not you.")
@@ -234,7 +234,7 @@
     user_entity = clean_user_field(self)
 
     current_user_entity = user_logic.getForCurrentAccount()
-
+    # pylint: disable-msg=E1103
     if user_entity.key() == current_user_entity.key():
       # users are equal
       raise forms.ValidationError("You cannot enter yourself here.")
@@ -534,6 +534,7 @@
 
       # if the proposal has not been accepted or it's not the applicant
       # creating the new group then show link ID in use message
+      # pylint: disable-msg=E1103
       if group_app_entity and (group_app_entity.status != 'accepted' or (
           group_app_entity.applicant.key() != user_entity.key())):
         # add the error message to the link id field
@@ -688,7 +689,8 @@
     rights = params['rights']
 
     user = user_logic.getForCurrentAccount()
-
+    
+    # pylint: disable-msg=E1103
     rights.setCurrentUser(user.account, user)
 
     prefix = self.cleaned_data['prefix']
--- a/app/soc/logic/models/priority_group.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/logic/models/priority_group.py	Wed May 27 03:31:58 2009 +0200
@@ -36,6 +36,7 @@
     """Defines the name, key_name and model for this entity.
     """
 
+    # pylint: disable-msg=C0103
     self.EMAIL = 'emails'
     self.CONVERT = 'convert'
 
--- a/app/soc/views/helper/templatetags/comments_helpers.py	Wed May 27 03:31:27 2009 +0200
+++ b/app/soc/views/helper/templatetags/comments_helpers.py	Wed May 27 03:31:58 2009 +0200
@@ -49,7 +49,7 @@
 
   edit_link = ''
   current_user = user_logic.logic.getForCurrentAccount()
-
+  # pylint: disable-msg=E1103
   if current_user and comment.author.key() == current_user.key():
     params = {'url_name': context['comment_on_url_name']}
     edit_link = redirects.getEditRedirect(comment, params)