web: remove t=XML, and other dead code

This commit is contained in:
Brian Warner 2007-07-07 22:55:15 -07:00
parent 159f8bfd50
commit bd8625076a
3 changed files with 1 additions and 75 deletions

View File

@ -84,7 +84,6 @@ for files and directories which do not yet exist.
state (it may leave some intermediate directory nodes).
GET FILEURL?t=json
GET FILEURL?t=xml
This returns machine-parseable information about the file in the HTTP
response body, including file size, metadata (like Content-Type), and URIs.
@ -135,7 +134,6 @@ for files and directories which do not yet exist.
do their job.
GET DIRURL?t=json
GET DIRURL?t=xml
This returns machine-parseable information about this directory in the HTTP
response body. This information first contains a flag to indicate that
@ -144,7 +142,7 @@ for files and directories which do not yet exist.
dirnode. Finally it also contains information about the children of this
directory, probably as a mapping from child name to a set of metadata about
the child (basically the same data that would appear in a corresponding
GET?t=xml of the child itself). A programmatic client should be able to use
GET?t=json of the child itself). A programmatic client should be able to use
the information from this query to display filesystem navigation choices to
a human user.

View File

@ -845,31 +845,3 @@ class Web(unittest.TestCase):
raise unittest.SkipTest("not yet")
pass
"""
# GET / (welcome)
# GET FILEURL
# PUT NEWFILEURL
# DELETE FILEURL
# GET FILEURL?t=json
# GET FILEURL?localfile=$FILENAME
# PUT NEWFILEURL?localfile=$FILENAME
# GET FILEURL?t=uri
# GET DIRURL
# GET DIRURL?t=json
# GET DIRURL?t=uri
# GET DIRURL?t=readonly-uri
# PUT NEWDIRURL?t=mkdir
# DELETE DIRURL
# GET DIRURL?localdir=$DIRNAME
# PUT NEWDIRURL?localdir=$DIRNAME
# POST DIRURL?t=upload-form
# POST DIRURL?t=mkdir-form
# POST DIRURL?t=put-uri-form
# POST DIRURL?t=delete-form
# GET .../url/$URI
# and a few others
# PUT NEWFILEURL?t=uri
# /xmlrpc
"""

View File

@ -84,7 +84,6 @@ class Directory(rend.Page):
uri_link = urllib.quote(target.get_uri().replace("/", "!"))
childdata = [T.a(href="%s?t=json" % name)["JSON"], ", ",
T.a(href="%s?t=xml" % name)["XML"], ", ",
T.a(href="%s?t=uri" % name)["URI"], ", ",
T.a(href="%s?t=readonly-uri" % name)["readonly-URI"], ", ",
T.a(href="/uri/%s" % uri_link)["URI-link"],
@ -225,18 +224,6 @@ class WebDownloadTarget:
def finish(self):
pass
class TypedFile(static.File):
# serve data from a named file, but using a Content-Type derived from a
# different filename
isLeaf = True
def __init__(self, path, requested_filename):
static.File.__init__(self, path)
gte = static.getTypeAndEncoding
self.type, self.encoding = gte(requested_filename,
self.contentTypes,
self.contentEncodings,
self.defaultType)
class FileDownloader(resource.Resource):
def __init__(self, filenode, name):
IFileNode(filenode)
@ -319,16 +306,6 @@ class FileJSONMetadata(rend.Page):
data += "uri=%s, size=%s" % (file_uri, pieces['size'])
return data
class FileXMLMetadata(FileJSONMetadata):
def renderNode(self, filenode):
file_uri = filenode.get_uri()
pieces = unpack_uri(file_uri)
data = "<xmlish>\n"
data += "filenode\n"
data += "stuff here\n"
data += "uri=%s, size=%s" % (file_uri, pieces['size'])
return data
class FileURI(FileJSONMetadata):
def renderNode(self, filenode):
file_uri = filenode.get_uri()
@ -420,23 +397,6 @@ class DirectoryJSONMetadata(rend.Page):
d.addCallback(_done)
return d
class DirectoryXMLMetadata(DirectoryJSONMetadata):
def renderNode(self, node):
data = "<xmlish>\n"
data += "dirnode\n"
data += "stuff here\n"
d = node.list()
def _got(children, data):
for name, childnode in children.iteritems():
data += "name=%s, child_uri=%s" % (name, childnode.get_uri())
return data
d.addCallback(_got, data)
def _done(data):
data += "</done>\n"
return data
d.addCallback(_done)
return d
class DirectoryURI(DirectoryJSONMetadata):
def renderNode(self, node):
return node.get_uri()
@ -731,8 +691,6 @@ class VDrive(rend.Page):
return FileDownloader(node, filename), ()
elif t == "json":
return FileJSONMetadata(node), ()
elif t == "xml":
return FileXMLMetadata(node), ()
elif t == "uri":
return FileURI(node), ()
elif t == "readonly-uri":
@ -748,8 +706,6 @@ class VDrive(rend.Page):
return Directory(self.name, node, path), ()
elif t == "json":
return DirectoryJSONMetadata(node), ()
elif t == "xml":
return DirectoryXMLMetadata(node), ()
elif t == "uri":
return DirectoryURI(node), ()
elif t == "readonly-uri":