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
4b5a209b
Commit
4b5a209b
authored
Apr 30, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up imports
parent
5e844e3d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
61 deletions
+7
-61
djangoapps/courseware/content_parser.py
+1
-13
djangoapps/courseware/module_render.py
+1
-20
djangoapps/courseware/views.py
+0
-8
djangoapps/simplewiki/views.py
+2
-11
djangoapps/staticbook/views.py
+2
-7
djangoapps/student/views.py
+1
-2
No files found.
djangoapps/courseware/content_parser.py
View file @
4b5a209b
import
hashlib
import
json
import
logging
import
os
import
re
...
...
@@ -14,7 +13,7 @@ try: # This lets us do __name__ == ='__main__'
from
student.models
import
UserProfile
from
student.models
import
UserTestGroup
from
mitxmako.shortcuts
import
render_to_
response
,
render_to_
string
from
mitxmako.shortcuts
import
render_to_string
from
util.cache
import
cache
except
:
settings
=
None
...
...
@@ -97,20 +96,9 @@ def item(l, default="", process=lambda x:x):
def
id_tag
(
course
):
''' Tag all course elements with unique IDs '''
old_ids
=
{
'video'
:
'youtube'
,
'problem'
:
'filename'
,
'sequential'
:
'id'
,
'html'
:
'filename'
,
'vertical'
:
'id'
,
'tab'
:
'id'
,
'schematic'
:
'id'
,
'book'
:
'id'
}
import
courseware.modules
default_ids
=
courseware
.
modules
.
get_default_ids
()
#print default_ids, old_ids
#print default_ids == old_ids
# Tag elements with unique IDs
elements
=
course
.
xpath
(
"|"
.
join
([
'//'
+
c
for
c
in
default_ids
]))
for
elem
in
elements
:
...
...
djangoapps/courseware/module_render.py
View file @
4b5a209b
import
StringIO
import
json
import
logging
import
os
import
sys
import
sys
import
urllib
import
uuid
from
lxml
import
etree
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
django.core.context_processors
import
csrf
from
django.db
import
connection
from
django.http
import
Http404
from
django.http
import
HttpResponse
from
django.shortcuts
import
redirect
from
django.template
import
Context
from
django.template
import
Context
,
loader
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
mitxmako.shortcuts
import
render_to_string
from
models
import
StudentModule
from
student.models
import
UserProfile
import
track.views
import
courseware.content_parser
as
content_parser
import
courseware.modules
log
=
logging
.
getLogger
(
"mitx.courseware"
)
...
...
djangoapps/courseware/views.py
View file @
4b5a209b
import
json
import
logging
import
os
import
random
import
sys
import
StringIO
import
urllib
import
uuid
from
django.conf
import
settings
from
django.core.context_processors
import
csrf
from
django.contrib.auth.models
import
User
from
django.http
import
HttpResponse
,
Http404
from
django.shortcuts
import
redirect
from
django.template
import
Context
,
loader
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
#from django.views.decorators.csrf import ensure_csrf_cookie
from
django.db
import
connection
from
django.views.decorators.cache
import
cache_control
from
lxml
import
etree
...
...
djangoapps/simplewiki/views.py
View file @
4b5a209b
...
...
@@ -4,21 +4,12 @@ import types
from
django.conf
import
settings
from
django.contrib.auth.decorators
import
login_required
from
django.core.context_processors
import
csrf
from
django.core.urlresolvers
import
get_callable
from
django.core.urlresolvers
import
reverse
from
django.db.models
import
Q
from
django.http
import
Http404
,
HttpResponse
,
HttpResponseRedirect
,
HttpResponseServerError
,
HttpResponseForbidden
,
HttpResponseNotAllowed
from
django.http
import
HttpResponse
from
django.shortcuts
import
get_object_or_404
from
django.shortcuts
import
redirect
from
django.template
import
Context
from
django.template
import
RequestContext
,
Context
,
loader
from
django.http
import
HttpResponse
,
HttpResponseRedirect
from
django.utils
import
simplejson
from
django.utils.translation
import
ugettext_lazy
as
_
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
mako.lookup
import
TemplateLookup
from
mako.template
import
Template
import
mitxmako.middleware
from
mitxmako.shortcuts
import
render_to_response
from
models
import
*
# TODO: Clean up
from
settings
import
*
...
...
djangoapps/staticbook/views.py
View file @
4b5a209b
# Create your views here.
import
os
from
django.conf
import
settings
from
django.http
import
Http404
from
django.shortcuts
import
redirect
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
django.contrib.auth.decorators
import
login_required
from
mitxmako.shortcuts
import
render_to_response
def
index
(
request
,
page
=
0
):
if
not
request
.
user
.
is_authenticated
():
...
...
djangoapps/student/views.py
View file @
4b5a209b
...
...
@@ -10,14 +10,13 @@ from django.conf import settings
from
django.contrib.auth
import
logout
,
authenticate
,
login
from
django.contrib.auth.forms
import
PasswordResetForm
from
django.contrib.auth.models
import
User
from
django.contrib.auth.decorators
import
login_required
from
django.core.context_processors
import
csrf
from
django.core.mail
import
send_mail
from
django.core.validators
import
validate_email
,
validate_slug
,
ValidationError
from
django.db
import
connection
from
django.http
import
HttpResponse
,
Http404
from
django.shortcuts
import
redirect
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
mako
import
exceptions
from
django_future.csrf
import
ensure_csrf_cookie
...
...
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