Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3553)

Unified Diff: boto/mturk/question.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « boto/mturk/notification.py ('k') | boto/provider.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: boto/mturk/question.py
diff --git a/boto/mturk/question.py b/boto/mturk/question.py
index b1556ad1390008dac8873453ee6a58e8bf6aebe3..bf16b3e93165056821f21513b135a1c51b6f7aa5 100644
--- a/boto/mturk/question.py
+++ b/boto/mturk/question.py
@@ -22,7 +22,8 @@
class Question(object):
template = "<Question>%(items)s</Question>"
- def __init__(self, identifier, content, answer_spec, is_required=False, display_name=None):
+ def __init__(self, identifier, content, answer_spec,
+ is_required=False, display_name=None):
# copy all of the parameters into object attributes
self.__dict__.update(vars())
del self.self
@@ -176,27 +177,31 @@ class QuestionForm(ValidatingXML, list):
"""
From the AMT API docs:
- The top-most element of the QuestionForm data structure is a QuestionForm element. This
- element contains optional Overview elements and one or more Question elements. There can be
- any number of these two element types listed in any order. The following example structure has an
- Overview element and a Question element followed by a second Overview element and Question
- element--all within the same QuestionForm.
+ The top-most element of the QuestionForm data structure is a
+ QuestionForm element. This element contains optional Overview
+ elements and one or more Question elements. There can be any
+ number of these two element types listed in any order. The
+ following example structure has an Overview element and a
+ Question element followed by a second Overview element and
+ Question element--all within the same QuestionForm.
- <QuestionForm xmlns="[the QuestionForm schema URL]">
- <Overview>
- [...]
- </Overview>
- <Question>
- [...]
- </Question>
- <Overview>
- [...]
- </Overview>
- <Question>
+ ::
+
+ <QuestionForm xmlns="[the QuestionForm schema URL]">
+ <Overview>
+ [...]
+ </Overview>
+ <Question>
+ [...]
+ </Question>
+ <Overview>
+ [...]
+ </Overview>
+ <Question>
+ [...]
+ </Question>
[...]
- </Question>
- [...]
- </QuestionForm>
+ </QuestionForm>
QuestionForm is implemented as a list, so to construct a
QuestionForm, simply append Questions and Overviews (with at least
@@ -291,13 +296,14 @@ class FreeTextAnswer(object):
def __init__(self, default=None, constraints=None, num_lines=None):
self.default = default
- if constraints is None: constraints = Constraints()
- self.constraints = Constraints(constraints)
+ if constraints is None:
+ self.constraints = Constraints()
+ else:
+ self.constraints = Constraints(constraints)
self.num_lines = num_lines
def get_as_xml(self):
- constraints = Constraints()
- items = [constraints]
+ items = [self.constraints]
if self.default:
items.append(SimpleField('DefaultText', self.default))
if self.num_lines:
« no previous file with comments | « boto/mturk/notification.py ('k') | boto/provider.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698