Style and pylint fixes in Melange modules.
--- a/app/soc/logic/helper/notifications.py Wed May 27 00:31:40 2009 +0200
+++ b/app/soc/logic/helper/notifications.py Wed May 27 01:47:38 2009 +0200
@@ -191,6 +191,7 @@
'scope_path': to_user.link_id
}
+ # pylint: disable-msg=W0612
import soc.logic.models.notification
key_name = model_logic.notification.logic.getKeyNameFromFields(fields)
@@ -204,7 +205,7 @@
Args:
notification_entity: Notification about which the message should be sent
"""
-
+ # pylint: disable-msg=W0612
import soc.views.models.notification
# create the url to show this notification
--- a/app/soc/logic/mail_dispatcher.py Wed May 27 00:31:40 2009 +0200
+++ b/app/soc/logic/mail_dispatcher.py Wed May 27 01:47:38 2009 +0200
@@ -157,6 +157,7 @@
# and the GAE admin API is case sensitive
user_entity = user_logic.logic.getForAccount(account)
+ # pylint: disable-msg=E1103
name = user_entity.name if user_entity else account.nickname()
return (name, account.email())
--- a/app/soc/views/models/student.py Wed May 27 00:31:40 2009 +0200
+++ b/app/soc/views/models/student.py Wed May 27 01:47:38 2009 +0200
@@ -155,7 +155,8 @@
user_entity = user_logic.logic.getForCurrentAccount()
params['create_form'] = params['user_create_form']
-
+
+ # pylint: disable-msg=E1103
return self.create(request, access_type='unspecified', page_name=page_name,
params=params, link_id=user_entity.link_id, **kwargs)
@@ -171,6 +172,7 @@
user_entity = user_logic.logic.getForCurrentAccount()
+ # pylint: disable-msg=E1103
fields = {'link_id': user_entity.link_id,
'scope_path': kwargs['scope_path']}
--- a/app/soc/views/models/student_project.py Wed May 27 00:31:40 2009 +0200
+++ b/app/soc/views/models/student_project.py Wed May 27 01:47:38 2009 +0200
@@ -75,7 +75,7 @@
('checkStudentProjectHasStatus', [['accepted', 'mid_term_passed']])]
rights['manage_overview'] = [('checkHasActiveRoleForScope',
org_admin_logic)]
- # TODO lack of better name here!
+ # TODO: lack of better name here!
rights['st_edit'] = ['checkIsMyStudentProject',
('checkStudentProjectHasStatus',
[['accepted', 'mid_term_passed', 'passed']])
@@ -244,6 +244,7 @@
mentor = mentor_logic.logic.getForFields(fields, unique=True)
additional_mentors = entity.additional_mentors
+ # pylint: disable-msg=E1103
if additional_mentors and mentor.key() in additional_mentors:
# remove the mentor from the additional mentors list
additional_mentors.remove(mentor.key())
@@ -411,6 +412,7 @@
additional_mentors = entity.additional_mentors
+ # pylint: disable-msg=E1103
if additional_mentors and mentor.key() in additional_mentors:
# remove the mentor that is now becoming the primary mentor
additional_mentors.remove(mentor.key())
@@ -453,6 +455,7 @@
mentor = mentor_logic.logic.getForFields(fields, unique=True)
# add this mentor to the additional mentors
+ # pylint: disable-msg=E1103
if not entity.additional_mentors:
additional_mentors = [mentor.key()]
else:
--- a/app/soc/views/models/student_proposal.py Wed May 27 00:31:40 2009 +0200
+++ b/app/soc/views/models/student_proposal.py Wed May 27 01:47:38 2009 +0200
@@ -147,7 +147,8 @@
new_params['edit_template'] = 'soc/student_proposal/edit.html'
new_params['review_template'] = 'soc/student_proposal/review.html'
- new_params['review_after_deadline_template'] = 'soc/student_proposal/review_after_deadline.html'
+ new_params['review_after_deadline_template'] = \
+ 'soc/student_proposal/review_after_deadline.html'
params = dicts.merge(params, new_params)
@@ -355,7 +356,7 @@
if comment:
# create a new public review containing the comment
user_entity = user_logic.logic.getForCurrentAccount()
-
+ # pylint: disable-msg=E1103
if user_entity.key() == entity.scope.user.key():
# student is posting
reviewer = entity.scope
@@ -401,6 +402,7 @@
user_entity = user_logic.logic.getForCurrentAccount()
# create the fields that should be in the ReviewFollower entity
+ # pylint: disable-msg=E1103
fields = {'link_id': user_entity.link_id,
'scope': entity,
'scope_path': entity.key().id_or_name(),
@@ -446,6 +448,7 @@
user_entity = user_logic.logic.getForCurrentAccount()
# check if the current user is the student
+ # pylint: disable-msg=E1103
if user_entity.key() == student_entity.user.key():
# show the proposal edit link
context['edit_link'] = redirects.getEditRedirect(entity, params)
@@ -487,6 +490,7 @@
if org_entity:
# organization found use special form and also seed this form
params['create_form'] = params['student_create_form']
+ # pylint: disable-msg=E1103
kwargs['organization'] = org_entity.link_id
kwargs['content'] = org_entity.contrib_template
@@ -805,6 +809,7 @@
user_entity = user_logic.logic.getForCurrentAccount()
# create the fields that should be in the ReviewFollower entity
+ # pylint: disable-msg=E1103
fields = {'link_id': user_entity.link_id,
'scope': entity,
'scope_path': entity.key().id_or_name(),
@@ -875,8 +880,9 @@
return responses.respond(request, template, context=context)
- def reviewAfterDeadline(self,request, context, params, entity,**kwargs):
- """View that shows the review view after the accepted students announced deadline.
+ def reviewAfterDeadline(self, request, context, params, entity, **kwargs):
+ """View that shows the review view after the accepted students
+ announced deadline.
For Args see base.View.public().
"""
@@ -989,6 +995,7 @@
follower_entity = review_follower_logic.getForFields(fields, unique=True)
if follower_entity:
+ # pylint: disable-msg=E1103
context['is_subscribed_public'] = follower_entity.subscribed_public
context['is_subscribed_private'] = follower_entity.subscribed_private
--- a/app/soc/views/models/user_self.py Wed May 27 00:31:40 2009 +0200
+++ b/app/soc/views/models/user_self.py Wed May 27 01:47:38 2009 +0200
@@ -150,6 +150,7 @@
# set the link_id to the current user's link_id
user_entity = user_logic.getForCurrentAccount()
+ # pylint: disable-msg=E1103
link_id = user_entity.link_id
return self.edit(request, access_type, page_name=page_name,
@@ -235,6 +236,7 @@
user = user_logic.getForCurrentAccount()
# only select the roles for the current user
+ # pylint: disable-msg=E1103
filter = {
'link_id': user.link_id,
'status': ['active', 'inactive']