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
be103dfa
Commit
be103dfa
authored
Jul 31, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improving code style
parent
4896444d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
41 deletions
+29
-41
common/lib/xmodule/xmodule/x_module.py
+29
-41
No files found.
common/lib/xmodule/xmodule/x_module.py
View file @
be103dfa
...
@@ -711,20 +711,20 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
...
@@ -711,20 +711,20 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
# =============================== BUILTIN METHODS ==========================
# =============================== BUILTIN METHODS ==========================
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
eq
=
(
self
.
__class__
==
other
.
__class__
and
return
(
self
.
__class__
==
other
.
__class__
and
all
(
getattr
(
self
,
attr
,
None
)
==
getattr
(
other
,
attr
,
None
)
all
(
getattr
(
self
,
attr
,
None
)
==
getattr
(
other
,
attr
,
None
)
for
attr
in
self
.
equality_attributes
))
for
attr
in
self
.
equality_attributes
))
return
eq
def
__repr__
(
self
):
def
__repr__
(
self
):
return
(
"{class_}({system!r}, location={location!r},"
return
(
" model_data={model_data!r})"
.
format
(
"{class_}({system!r}, location={location!r},"
class_
=
self
.
__class__
.
__name__
,
" model_data={model_data!r})"
.
format
(
system
=
self
.
system
,
class_
=
self
.
__class__
.
__name__
,
location
=
self
.
location
,
system
=
self
.
system
,
model_data
=
self
.
_model_data
,
location
=
self
.
location
,
))
model_data
=
self
.
_model_data
,
)
)
@property
@property
def
non_editable_metadata_fields
(
self
):
def
non_editable_metadata_fields
(
self
):
...
@@ -785,15 +785,17 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
...
@@ -785,15 +785,17 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
editor_type
=
"Float"
editor_type
=
"Float"
elif
isinstance
(
field
,
List
):
elif
isinstance
(
field
,
List
):
editor_type
=
"List"
editor_type
=
"List"
metadata_fields
[
field
.
name
]
=
{
'field_name'
:
field
.
name
,
metadata_fields
[
field
.
name
]
=
{
'type'
:
editor_type
,
'field_name'
:
field
.
name
,
'display_name'
:
field
.
display_name
,
'type'
:
editor_type
,
'value'
:
field
.
to_json
(
value
),
'display_name'
:
field
.
display_name
,
'options'
:
[]
if
values
is
None
else
values
,
'value'
:
field
.
to_json
(
value
),
'default_value'
:
field
.
to_json
(
default_value
),
'options'
:
[]
if
values
is
None
else
values
,
'inheritable'
:
inheritable
,
'default_value'
:
field
.
to_json
(
default_value
),
'explicitly_set'
:
explicitly_set
,
'inheritable'
:
inheritable
,
'help'
:
field
.
help
}
'explicitly_set'
:
explicitly_set
,
'help'
:
field
.
help
,
}
return
metadata_fields
return
metadata_fields
...
@@ -885,28 +887,14 @@ class ModuleSystem(Runtime):
...
@@ -885,28 +887,14 @@ class ModuleSystem(Runtime):
Note that these functions can be closures over e.g. a django request
Note that these functions can be closures over e.g. a django request
and user, or other environment-specific info.
and user, or other environment-specific info.
'''
'''
def
__init__
(
self
,
def
__init__
(
ajax_url
,
self
,
ajax_url
,
track_function
,
get_module
,
render_template
,
track_function
,
replace_urls
,
xblock_model_data
,
user
=
None
,
filestore
=
None
,
get_module
,
debug
=
False
,
xqueue
=
None
,
publish
=
None
,
node_path
=
""
,
render_template
,
anonymous_student_id
=
''
,
course_id
=
None
,
replace_urls
,
open_ended_grading_interface
=
None
,
s3_interface
=
None
,
xblock_model_data
,
cache
=
None
,
can_execute_unsafe_code
=
None
,
replace_course_urls
=
None
,
user
=
None
,
replace_jump_to_id_urls
=
None
):
filestore
=
None
,
debug
=
False
,
xqueue
=
None
,
publish
=
None
,
node_path
=
""
,
anonymous_student_id
=
''
,
course_id
=
None
,
open_ended_grading_interface
=
None
,
s3_interface
=
None
,
cache
=
None
,
can_execute_unsafe_code
=
None
,
replace_course_urls
=
None
,
replace_jump_to_id_urls
=
None
):
'''
'''
Create a closure around the system environment.
Create a closure around the system environment.
...
...
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