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). state (it may leave some intermediate directory nodes).
GET FILEURL?t=json GET FILEURL?t=json
GET FILEURL?t=xml
This returns machine-parseable information about the file in the HTTP This returns machine-parseable information about the file in the HTTP
response body, including file size, metadata (like Content-Type), and URIs. 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. do their job.
GET DIRURL?t=json GET DIRURL?t=json
GET DIRURL?t=xml
This returns machine-parseable information about this directory in the HTTP This returns machine-parseable information about this directory in the HTTP
response body. This information first contains a flag to indicate that 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 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 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 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 the information from this query to display filesystem navigation choices to
a human user. a human user.

View File

@ -845,31 +845,3 @@ class Web(unittest.TestCase):
raise unittest.SkipTest("not yet") raise unittest.SkipTest("not yet")
pass 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("/", "!")) uri_link = urllib.quote(target.get_uri().replace("/", "!"))
childdata = [T.a(href="%s?t=json" % name)["JSON"], ", ", 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=uri" % name)["URI"], ", ",
T.a(href="%s?t=readonly-uri" % name)["readonly-URI"], ", ", T.a(href="%s?t=readonly-uri" % name)["readonly-URI"], ", ",
T.a(href="/uri/%s" % uri_link)["URI-link"], T.a(href="/uri/%s" % uri_link)["URI-link"],
@ -225,18 +224,6 @@ class WebDownloadTarget:
def finish(self): def finish(self):
pass 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): class FileDownloader(resource.Resource):
def __init__(self, filenode, name): def __init__(self, filenode, name):
IFileNode(filenode) IFileNode(filenode)
@ -319,16 +306,6 @@ class FileJSONMetadata(rend.Page):
data += "uri=%s, size=%s" % (file_uri, pieces['size']) data += "uri=%s, size=%s" % (file_uri, pieces['size'])
return data 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): class FileURI(FileJSONMetadata):
def renderNode(self, filenode): def renderNode(self, filenode):
file_uri = filenode.get_uri() file_uri = filenode.get_uri()
@ -420,23 +397,6 @@ class DirectoryJSONMetadata(rend.Page):
d.addCallback(_done) d.addCallback(_done)
return d 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): class DirectoryURI(DirectoryJSONMetadata):
def renderNode(self, node): def renderNode(self, node):
return node.get_uri() return node.get_uri()
@ -731,8 +691,6 @@ class VDrive(rend.Page):
return FileDownloader(node, filename), () return FileDownloader(node, filename), ()
elif t == "json": elif t == "json":
return FileJSONMetadata(node), () return FileJSONMetadata(node), ()
elif t == "xml":
return FileXMLMetadata(node), ()
elif t == "uri": elif t == "uri":
return FileURI(node), () return FileURI(node), ()
elif t == "readonly-uri": elif t == "readonly-uri":
@ -748,8 +706,6 @@ class VDrive(rend.Page):
return Directory(self.name, node, path), () return Directory(self.name, node, path), ()
elif t == "json": elif t == "json":
return DirectoryJSONMetadata(node), () return DirectoryJSONMetadata(node), ()
elif t == "xml":
return DirectoryXMLMetadata(node), ()
elif t == "uri": elif t == "uri":
return DirectoryURI(node), () return DirectoryURI(node), ()
elif t == "readonly-uri": elif t == "readonly-uri":