get rid of dead code
This commit is contained in:
Родитель
e9ca6fce9c
Коммит
67458ee82b
|
@ -410,107 +410,6 @@ def filestats(request, response):
|
|||
_populate_stats(file_obj, result)
|
||||
return _respond_json(response, result)
|
||||
|
||||
# Edits may be changing with collab. Commented out for now
|
||||
# DELETE once we know these are done...
|
||||
|
||||
# @expose(r'^/edit/at/(?P<path>.*)$', 'PUT')
|
||||
# def save_edit(request, response):
|
||||
# user = request.user
|
||||
#
|
||||
# owner, project, path = _split_path(request)
|
||||
# project = get_project(user, owner, project, create=True)
|
||||
#
|
||||
# fm.save_edit(user, project, path, request.body)
|
||||
# return response()
|
||||
#
|
||||
# def _get_edit_list(request, response, start_at=0):
|
||||
# fm = request.file_manager
|
||||
# user = request.user
|
||||
#
|
||||
# owner, project, path = _split_path(request)
|
||||
# project = fm.get_project(user, owner, project)
|
||||
#
|
||||
# edits = fm.list_edits(user, project, path, start_at)
|
||||
# return _respond_json(response, edits)
|
||||
#
|
||||
# @expose(r'^/edit/list/(?P<path>.*)$', 'GET')
|
||||
# def list_edits(request, response):
|
||||
# return _get_edit_list(request, response)
|
||||
#
|
||||
# @expose(r'^/edit/recent/(?P<start_at>\d+)/(?P<path>.*)$', 'GET')
|
||||
# def list_recent(request, response):
|
||||
# start_at = int(request.kwargs['start_at'])
|
||||
# return _get_edit_list(request, response, start_at)
|
||||
#
|
||||
# @expose(r'^/edit/reset/$', 'POST')
|
||||
# def reset_all(request, response):
|
||||
# request.file_manager.reset_edits(request.user)
|
||||
# return response()
|
||||
#
|
||||
# @expose(r'^/edit/reset/(?P<path>.+)$', 'POST')
|
||||
# def reset(request, response):
|
||||
# fm = request.file_manager
|
||||
# user = request.user
|
||||
#
|
||||
# owner, project, path = _split_path(request)
|
||||
# project = fm.get_project(user, owner, project)
|
||||
#
|
||||
# fm.reset_edits(user, project, path)
|
||||
# return response()
|
||||
|
||||
TH_SRC_BLOCK = """
|
||||
<script type="text/javascript" src="/js/thsrc/jstraits.js"></script>
|
||||
<script type="text/javascript" src="/js/thsrc/util.js"></script>
|
||||
<script type="text/javascript" src="/js/thsrc/traits.js"></script>
|
||||
<script type="text/javascript" src="/js/thsrc/css.js"></script>
|
||||
<script type="text/javascript" src="/js/thsrc/th.js"></script>
|
||||
<script type="text/javascript" src="/js/thsrc/components.js"></script>
|
||||
<script type="text/javascript" src="/js/thsrc/jshashtable.js"></script>
|
||||
<script type="text/javascript" src="/js/thsrc/formlayout/formLayout.js"></script>
|
||||
<script>
|
||||
// Tell Th where the base URL is so it knows where to load resources
|
||||
th.global_resources.load("/js/thsrc/");
|
||||
</script>
|
||||
"""
|
||||
|
||||
def _replace_block(html_lines, begin, end, new_content):
|
||||
start_marker = None
|
||||
end_marker = None
|
||||
for i in range(0, len(html_lines)):
|
||||
if begin in html_lines[i]:
|
||||
start_marker = i
|
||||
elif end in html_lines[i]:
|
||||
end_marker = i
|
||||
del html_lines[start_marker:end_marker+1]
|
||||
html_lines.insert(start_marker, new_content)
|
||||
return html_lines
|
||||
|
||||
@expose(r'^/editor\.html', 'GET', auth=False, skip_token_check=True)
|
||||
def editor_page(request, response):
|
||||
"""Ensure that the user is logged in. Redirect them to the front
|
||||
page if they're not. If they are logged in, go ahead and serve
|
||||
up the static file."""
|
||||
if not 'REMOTE_USER' in request.environ:
|
||||
response.location = "/"
|
||||
response.status = "302 Not logged in"
|
||||
response.body = ""
|
||||
else:
|
||||
response.status = "200 OK"
|
||||
response.content_type = "text/html"
|
||||
body = open("%s/editor.html" % (c.static_dir,
|
||||
)).read()
|
||||
if c.th_src:
|
||||
bodylines = body.split("\n")
|
||||
bodylines = _replace_block(bodylines, "<!-- begin Th -->",
|
||||
"<!-- end Th -->", TH_SRC_BLOCK)
|
||||
body = "\n".join(bodylines)
|
||||
|
||||
if c.using_dojo_source:
|
||||
body = body.replace("dojo.js.uncompressed.js", "dojo.js")
|
||||
|
||||
response.body = body
|
||||
return response()
|
||||
|
||||
@expose(r'^/project/import/(?P<project_name>[^/]+)', "POST")
|
||||
def import_project(request, response):
|
||||
project_name = request.kwargs['project_name']
|
||||
|
|
Загрузка…
Ссылка в новой задаче