Commit 3fd9d678 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

removed automatic editor view -- to tricky with JSON files

parent 2118c13b
......@@ -62,5 +62,11 @@
<p>A surprising discovery has been the re-finding of writing &quot;template&quot; code in the form of a sample table row with rdfa properties. It seems it might be useful to revisit early web publishing flows that must have used this kind of mechanism (vague memories of Internet Explorer specific html element properties like data-source).</p>
<p>Next step? * Data value filters (based on a type? ... or simply connected to a specific value) to do date formating and file size niceness!</p>
<p>(later: I realize that this data join stuff was best separate from the main line of the makefile based server and can better be split off and developed on it raises quite a few questions on it's own)</p>
<h2 id="dec-2016">1 Dec 2016</h2>
<p>In explaining the project yesterday, I naturally described the server as the &quot;make server&quot; ... and given that make is now by far the focus of it's operation, this seems indeed the best / most descriptive and honest naming. So I made the change. One interesting consequent is that in typing makeserver to start it, one is reminded, nicedly of the make command. Also: Folded in the submodules including editor (leaving ace-builds a submodule). Need to decide what to do with draggable / player.</p>
<p>TODO: Clean the editor code to not require the (rather) unholy mess of both jquery + d3.</p>
<ul>
<li>Enable making files in subdirectories that don't (yet) exist. (make_server.py:FileMaker)</li>
</ul>
</body>
</html>
......@@ -19,7 +19,8 @@ from makeserver.makedirectorylisting import MakeDirectoryListingFactory
# todo: parameterize this.... or default for text files!!
TEXT_SERVE_BY_DEFAULT = ("html", "svg", "js", "css")
# TEXT_SERVE_BY_DEFAULT = ("html", "svg", "js", "css")
# TEXT_SERVE_BY_DEFAULT = ()
# http://stackoverflow.com/questions/898669/how-can-i-detect-if-a-file-is-binary-non-text-in-python
textchars = bytearray({7,8,9,10,12,13,27} | set(range(0x20, 0x100)) - {0x7f})
......@@ -143,14 +144,14 @@ class FileMaker (Resource):
basenoext = basenoext.lower()
ext = ext.lstrip('.').lower()
# print ("FILE '{0}'/'{1}'".format(base, ext))
if (xRequestedWith != "XMLHttpRequest") and \
"serve" not in query \
and ext not in TEXT_SERVE_BY_DEFAULT \
and base != self.index \
and is_text_file(fpath):
# print ("returning EDITOR", EDITOR, EDITOR.isLeaf)
return EDITOR
elif "edit" in query:
use_editor = "edit" in query
# use_editor = "edit" in query or ((xRequestedWith != "XMLHttpRequest") and \
# "serve" not in query \
# and ext not in TEXT_SERVE_BY_DEFAULT \
# and base != self.index \
# and is_text_file(fpath))
if use_editor:
return EDITOR
else:
# print ("returning File", fpath)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment