remove py2 print
parent
bc3e5e4ef7
commit
9e7c7fa4b7
|
@ -1,3 +1,4 @@
|
|||
from __future__ import print_function
|
||||
from django.core.management.base import BaseCommand
|
||||
from ...models import Landing
|
||||
|
||||
|
@ -10,5 +11,5 @@ class Command(BaseCommand):
|
|||
how_many=int(how_many)
|
||||
while how_many > 0:
|
||||
landing = Landing.objects.create(label = label)
|
||||
print landing.nonce
|
||||
print(landing.nonce)
|
||||
how_many -= 1
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import print_function
|
||||
from django.core.management.base import NoArgsCommand
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
|
@ -5,4 +6,4 @@ class Command(NoArgsCommand):
|
|||
from ...emails import send_emails
|
||||
res = send_emails()
|
||||
if res:
|
||||
print res
|
||||
print(res)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import print_function
|
||||
import hotshot
|
||||
import os
|
||||
import time
|
||||
|
@ -51,7 +52,7 @@ def timethis(fn):
|
|||
def wrapper(*args, **kwargs):
|
||||
start = time.time()
|
||||
result = fn(*args, **kwargs)
|
||||
print fn.__name__, 'took', time.time() - start
|
||||
print(fn.__name__, 'took', time.time() - start)
|
||||
return result
|
||||
|
||||
return wrapper
|
||||
|
@ -62,7 +63,7 @@ def sqlprint(fn):
|
|||
def wrapper(*args, **kwargs):
|
||||
connection.queries = list()
|
||||
result = fn(*args, **kwargs)
|
||||
print fn.__name__, 'issued'
|
||||
print(fn.__name__, 'issued')
|
||||
pprint(connection.queries)
|
||||
return result
|
||||
return wrapper
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import print_function
|
||||
from json import dumps
|
||||
import ast
|
||||
from django.utils.translation import ugettext as _, ungettext
|
||||
|
@ -84,8 +85,6 @@ def question_multiple(request, question):
|
|||
prev_vals[choice_value] = str(prev_value)
|
||||
possiblelist = pl
|
||||
|
||||
# print 'possible value is ', possibledbvalue, ', possiblelist is ', possiblelist
|
||||
|
||||
for choice in question.choices():
|
||||
counter += 1
|
||||
key = "question_%s_multiple_%d" % (question.number, choice.sortid)
|
||||
|
@ -94,7 +93,7 @@ def question_multiple(request, question):
|
|||
# so that the number box will be activated when item is checked
|
||||
|
||||
#try database first and only after that fall back to post choices
|
||||
# print 'choice multiple checking for match for choice ', choice
|
||||
# print('choice multiple checking for match for choice ', choice)
|
||||
checked = ' checked'
|
||||
prev_value = ''
|
||||
qvalue = "%s_%s" % (question.number, choice.value)
|
||||
|
|
|
@ -84,7 +84,6 @@ def question_open(request, question):
|
|||
|
||||
@answer_proc('open', 'open-textfield', 'choice-yesno', 'choice-yesnocomment', 'choice-yesnodontknow','choice-yesno-optional', 'choice-yesnocomment-optional', 'choice-yesnodontknow-optional')
|
||||
def process_simple(question, ansdict):
|
||||
# print 'process_simple has question, ansdict ', question, ',', ansdict
|
||||
checkdict = question.getcheckdict()
|
||||
ans = ansdict['ANSWER'] or ''
|
||||
qtype = question.get_type()
|
||||
|
|
|
@ -50,11 +50,11 @@ class request_cache(object):
|
|||
|
||||
@request_cache()
|
||||
def cached(name):
|
||||
print "My name is %s and I'm cached" % name
|
||||
print("My name is %s and I'm cached" % name)
|
||||
|
||||
@request_cache(keyfn=lambda p: p['id'])
|
||||
def cached(param):
|
||||
print "My id is %s" % p['id']
|
||||
print("My id is %s" % p['id'])
|
||||
|
||||
If no keyfn is provided the decorator expects the args to be hashable.
|
||||
|
||||
|
|
|
@ -166,7 +166,6 @@ def questionnaire(request, runcode=None, qs=None):
|
|||
We only commit on success, to maintain consistency. We also specifically
|
||||
rollback if there were errors processing the answers for this questionset.
|
||||
"""
|
||||
print translation.get_language()
|
||||
|
||||
if use_session:
|
||||
session_runcode = request.session.get('runcode', None)
|
||||
|
@ -662,7 +661,6 @@ def new_questionnaire(request, item_id):
|
|||
if form.is_valid():
|
||||
if not item and form.item:
|
||||
item = form.item
|
||||
print "create landing"
|
||||
landing = Landing.objects.create(label=form.cleaned_data['label'], questionnaire=form.cleaned_data['questionnaire'], content_object=item)
|
||||
return HttpResponseRedirect(reverse('questionnaires'))
|
||||
return render(request, "manage_questionnaire.html", {"item":item, "form":form})
|
||||
|
@ -670,7 +668,6 @@ def new_questionnaire(request, item_id):
|
|||
|
||||
|
||||
def questionnaires(request):
|
||||
print "here"
|
||||
if not request.user.is_authenticated() :
|
||||
return render(request, "questionnaires.html")
|
||||
items = item_model.objects.all()
|
||||
|
|
Loading…
Reference in New Issue