PEP8: Forgot a few binops

This commit is contained in:
Théophile Bastian 2016-07-09 23:26:02 +01:00
parent 6d68f6638f
commit 483ddf0f86
6 changed files with 17 additions and 18 deletions

View file

@ -119,8 +119,8 @@ Le Bureau des Arts
else:
message_bit = u"%d membres ont" % count
plural = "s"
self.message_user(request, u"%s été informé%s avec succès." %
(message_bit, plural))
self.message_user(request, u"%s été informé%s avec succès."
% (message_bit, plural))
send_attribs.short_description = u"Envoyer les résultats par mail"

View file

@ -24,8 +24,8 @@ def add_link_field(target_model='', field='', link_text=unicode,
if not link_obj.id:
return ""
url = reverse(reverse_path, args=(link_obj.id,))
return mark_safe("<a href='%s'>%s</a>" %
(url, link_text(link_obj)))
return mark_safe("<a href='%s'>%s</a>"
% (url, link_text(link_obj)))
link.allow_tags = True
link.short_description = desc_text(reverse_name + ' link')
cls.link = link

View file

@ -7,8 +7,8 @@ from django.apps import apps
def export(qs, fields=None):
model = qs.model
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename=%s.csv' %\
slugify(model.__name__)
response['Content-Disposition'] = 'attachment; filename=%s.csv' \
% slugify(model.__name__)
writer = csv.writer(response)
# Write headers to CSV file
if fields:

View file

@ -108,8 +108,7 @@ class SurveyStatusFilterForm(forms.Form):
else:
initial = "none"
field = forms.ChoiceField(
label="%s : %s" %
(question.question, answer.answer),
label="%s : %s" % (question.question, answer.answer),
choices=[("yes", "yes"), ("no", "no"), ("none", "none")],
widget=TriStateCheckbox,
required=False,

View file

@ -186,8 +186,8 @@ def _traitement_other_preparing(request, demande):
continue
user = candidates[choice]
if user in proposals[matiere]:
errors.append(u"La proposition %d en %s est un doublon" %
(choice_id + 1, matiere))
errors.append(u"La proposition %d en %s est un doublon"
% (choice_id + 1, matiere))
continue
proposals[matiere].append(user)
attribdata[matiere.id].append(user.id)
@ -198,9 +198,9 @@ def _traitement_other_preparing(request, demande):
if not proposals[matiere]:
errors.append(u"Aucune proposition pour %s" % (matiere,))
elif len(proposals[matiere]) < 3:
errors.append(u"Seulement %d proposition%s pour %s" %
(len(proposals[matiere]), "s"
if len(proposals[matiere]) > 1 else "",
errors.append(u"Seulement %d proposition%s pour %s"
% (len(proposals[matiere]),
"s" if len(proposals[matiere]) > 1 else "",
matiere))
else:
unsatisfied.append(matiere)

View file

@ -26,8 +26,8 @@ if __name__ == "__main__":
print "%d places" % available_slots
print "%d participants" % len(members)
print "%d demandes" % len(choices)
print "%d places demandées" % (len(choices) +
len(choices.filter(double=True).all()))
print "%d places demandées" % (len(choices)
+ len(choices.filter(double=True).all()))
print "%.02f€ à brasser" % total_price
print "Récupération: %.2fs" % (time.time() - start)
start_init = time.time()
@ -57,8 +57,8 @@ if __name__ == "__main__":
members2[member].append(show)
member.total += show.price
if len(members) < show.slots:
print "%d place(s) invendue(s) pour %s" %\
(show.slots - len(members), show)
print "%d place(s) invendue(s) pour %s" \
% (show.slots - len(members), show)
members2 = members2.items()
print "Temps total: %.2fs" % (time.time() - start)
print "Requêtes SQL:"