From bd8625076a08da949aa1ec963d1a5c985b2c9f02 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 7 Jul 2007 22:55:15 -0700 Subject: [PATCH] web: remove t=XML, and other dead code --- docs/webapi.txt | 4 +--- src/allmydata/test/test_web.py | 28 ---------------------- src/allmydata/webish.py | 44 ---------------------------------- 3 files changed, 1 insertion(+), 75 deletions(-) diff --git a/docs/webapi.txt b/docs/webapi.txt index b5f6355f..a325321d 100644 --- a/docs/webapi.txt +++ b/docs/webapi.txt @@ -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. diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index 414a9aa6..5b064241 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -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 -""" diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index 4744d913..1d6a8d21 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -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 = "\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 = "\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 += "\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": -- 2.45.2