Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ad6e4f2c
Commit
ad6e4f2c
authored
Dec 27, 2013
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2020 from edx/christina/export-bug2
Support non-ascii chars as arguments to format.
parents
719a898e
367ea683
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
13 deletions
+13
-13
common/lib/xmodule/xmodule/conditional_module.py
+1
-1
common/lib/xmodule/xmodule/crowdsource_hinter.py
+1
-1
common/lib/xmodule/xmodule/gst_module.py
+3
-3
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
+2
-2
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
+2
-2
common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py
+2
-2
common/lib/xmodule/xmodule/raw_module.py
+1
-1
common/lib/xmodule/xmodule/seq_module.py
+1
-1
No files found.
common/lib/xmodule/xmodule/conditional_module.py
View file @
ad6e4f2c
...
...
@@ -241,7 +241,7 @@ class ConditionalDescriptor(ConditionalFields, SequenceDescriptor):
for
child
in
self
.
get_children
():
location
=
str
(
child
.
location
)
if
location
in
self
.
show_tag_list
:
show_str
=
'<{tag_name} sources="{sources}" />'
.
format
(
show_str
=
u
'<{tag_name} sources="{sources}" />'
.
format
(
tag_name
=
'show'
,
sources
=
location
)
xml_object
.
append
(
etree
.
fromstring
(
show_str
))
else
:
...
...
common/lib/xmodule/xmodule/crowdsource_hinter.py
View file @
ad6e4f2c
...
...
@@ -392,7 +392,7 @@ class CrowdsourceHinterDescriptor(CrowdsourceHinterFields, RawDescriptor):
except
Exception
as
e
:
log
.
exception
(
"Unable to load child when parsing CrowdsourceHinter. Continuing..."
)
if
system
.
error_tracker
is
not
None
:
system
.
error_tracker
(
"ERROR: "
+
str
(
e
))
system
.
error_tracker
(
u"ERROR: {0}"
.
format
(
e
))
continue
return
{},
children
...
...
common/lib/xmodule/xmodule/gst_module.py
View file @
ad6e4f2c
...
...
@@ -218,13 +218,13 @@ class GraphicalSliderToolDescriptor(GraphicalSliderToolFields, XMLEditingDescrip
expected_children_level_0
=
[
'render'
,
'configuration'
]
for
child
in
expected_children_level_0
:
if
len
(
xml_object
.
xpath
(
child
))
!=
1
:
raise
ValueError
(
"Graphical Slider Tool definition must include
\
raise
ValueError
(
u
"Graphical Slider Tool definition must include
\
exactly one '{0}' tag"
.
format
(
child
))
expected_children_level_1
=
[
'functions'
]
for
child
in
expected_children_level_1
:
if
len
(
xml_object
.
xpath
(
'configuration'
)[
0
]
.
xpath
(
child
))
!=
1
:
raise
ValueError
(
"Graphical Slider Tool definition must include
\
raise
ValueError
(
u
"Graphical Slider Tool definition must include
\
exactly one '{0}' tag"
.
format
(
child
))
# finished
...
...
@@ -234,7 +234,7 @@ class GraphicalSliderToolDescriptor(GraphicalSliderToolFields, XMLEditingDescrip
def
definition_to_xml
(
self
,
resource_fs
):
'''Return an xml element representing this definition.'''
data
=
'<{tag}>{body}</{tag}>'
.
format
(
data
=
u
'<{tag}>{body}</{tag}>'
.
format
(
tag
=
'graphical_slider_tool'
,
body
=
self
.
data
)
xml_object
=
etree
.
fromstring
(
data
)
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
View file @
ad6e4f2c
...
...
@@ -1122,7 +1122,7 @@ class CombinedOpenEndedV1Descriptor():
if
len
(
xml_object
.
xpath
(
child
))
==
0
:
# This is a staff_facing_error
raise
ValueError
(
"Combined Open Ended definition must include at least one '{0}' tag. Contact the learning sciences group for assistance. {1}"
.
format
(
u
"Combined Open Ended definition must include at least one '{0}' tag. Contact the learning sciences group for assistance. {1}"
.
format
(
child
,
xml_object
))
def
parse_task
(
k
):
...
...
@@ -1141,7 +1141,7 @@ class CombinedOpenEndedV1Descriptor():
elt
=
etree
.
Element
(
'combinedopenended'
)
def
add_child
(
k
):
child_str
=
'<{tag}>{body}</{tag}>'
.
format
(
tag
=
k
,
body
=
self
.
definition
[
k
])
child_str
=
u
'<{tag}>{body}</{tag}>'
.
format
(
tag
=
k
,
body
=
self
.
definition
[
k
])
child_node
=
etree
.
fromstring
(
child_str
)
elt
.
append
(
child_node
)
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
View file @
ad6e4f2c
...
...
@@ -804,7 +804,7 @@ class OpenEndedDescriptor():
if
len
(
xml_object
.
xpath
(
child
))
!=
1
:
# This is a staff_facing_error
raise
ValueError
(
"Open Ended definition must include exactly one '{0}' tag. Contact the learning sciences group for assistance."
.
format
(
u
"Open Ended definition must include exactly one '{0}' tag. Contact the learning sciences group for assistance."
.
format
(
child
))
def
parse
(
k
):
...
...
@@ -820,7 +820,7 @@ class OpenEndedDescriptor():
elt
=
etree
.
Element
(
'openended'
)
def
add_child
(
k
):
child_str
=
'<{tag}>{body}</{tag}>'
.
format
(
tag
=
k
,
body
=
self
.
definition
[
k
])
child_str
=
u
'<{tag}>{body}</{tag}>'
.
format
(
tag
=
k
,
body
=
self
.
definition
[
k
])
child_node
=
etree
.
fromstring
(
child_str
)
elt
.
append
(
child_node
)
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py
View file @
ad6e4f2c
...
...
@@ -304,7 +304,7 @@ class SelfAssessmentDescriptor():
if
len
(
xml_object
.
xpath
(
child
))
!=
1
:
# This is a staff_facing_error
raise
ValueError
(
"Self assessment definition must include exactly one '{0}' tag. Contact the learning sciences group for assistance."
.
format
(
u
"Self assessment definition must include exactly one '{0}' tag. Contact the learning sciences group for assistance."
.
format
(
child
))
def
parse
(
k
):
...
...
@@ -318,7 +318,7 @@ class SelfAssessmentDescriptor():
elt
=
etree
.
Element
(
'selfassessment'
)
def
add_child
(
k
):
child_str
=
'<{tag}>{body}</{tag}>'
.
format
(
tag
=
k
,
body
=
getattr
(
self
,
k
))
child_str
=
u
'<{tag}>{body}</{tag}>'
.
format
(
tag
=
k
,
body
=
getattr
(
self
,
k
))
child_node
=
etree
.
fromstring
(
child_str
)
elt
.
append
(
child_node
)
...
...
common/lib/xmodule/xmodule/raw_module.py
View file @
ad6e4f2c
...
...
@@ -28,7 +28,7 @@ class RawDescriptor(XmlDescriptor, XMLEditingDescriptor):
# re-raise
lines
=
self
.
data
.
split
(
'
\n
'
)
line
,
offset
=
err
.
position
msg
=
(
"Unable to create xml for module {loc}. "
msg
=
(
u
"Unable to create xml for module {loc}. "
"Context: '{context}'"
.
format
(
context
=
lines
[
line
-
1
][
offset
-
40
:
offset
+
40
],
loc
=
self
.
location
))
...
...
common/lib/xmodule/xmodule/seq_module.py
View file @
ad6e4f2c
...
...
@@ -131,7 +131,7 @@ class SequenceDescriptor(SequenceFields, MakoModuleDescriptor, XmlDescriptor):
except
Exception
as
e
:
log
.
exception
(
"Unable to load child when parsing Sequence. Continuing..."
)
if
system
.
error_tracker
is
not
None
:
system
.
error_tracker
(
"ERROR: "
+
unicode
(
e
))
system
.
error_tracker
(
u"ERROR: {0}"
.
format
(
e
))
continue
return
{},
children
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment