Changeset 22867
- Timestamp:
- 03/17/2008 01:10:02 PM (2 years ago)
- Files:
-
- 1 removed
- 4 modified
- 1 copied
-
branches/version-identifier-3086 (copied) (copied from trunk)
-
branches/version-identifier-3086/doc/web2/howto/intro.xhtml (modified) (1 diff)
-
branches/version-identifier-3086/doc/web2/howto/tap-deploy.xhtml (modified) (1 diff)
-
branches/version-identifier-3086/twisted/web2/http_headers.py (modified) (2 diffs)
-
branches/version-identifier-3086/twisted/web2/tap.py (modified) (3 diffs)
-
trunk/twisted/web2/dav (deleted)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-identifier-3086/doc/web2/howto/intro.xhtml
r17173 r22867 36 36 <p>Currently, twisted.web2 does not include a HTTP client or 37 37 proxy, but will at a future date.</p> 38 39 <p>Finally, it includes a DAV server library.</p>40 38 41 39 <h2>What twisted.web2 is not</h2> -
branches/version-identifier-3086/doc/web2/howto/tap-deploy.xhtml
r16213 r22867 85 85 with no arguments passed to the constructor.</p> 86 86 87 <h3>The one line WebDAV configuration</h3>88 <p>Creating a WebDAV server is as easy as serving a static89 directory. In fact you could say it's even easier, because there90 is one character less to type.</p>91 92 <p>But before I tell you how to do it, a word of warning: This is93 a fully writeable webdav server with absolutely no protections94 of any kind, no HTTP Authentication, no DAV ACLs, just a directory95 on your hard disk that you're presenting to the world to be96 written by whomever should stumble across it. In other words,97 don't do this on a publically accessible system. It's simply98 here for you to fool around with in the privacy of your own home.</p>99 100 <pre class="shell">101 % mktap web2 --dav /some/path102 </pre>103 104 87 <h2>Virtual Hosts</h2> 105 88 -
branches/version-identifier-3086/twisted/web2/http_headers.py
r17544 r22867 1522 1522 } 1523 1523 1524 parser_dav_headers = {1525 'DAV' : (tokenize, list),1526 'Depth' : (last, parseDepth),1527 'Destination' : (last,), # TODO: URI object?1528 #'If' : (),1529 #'Lock-Token' : (),1530 'Overwrite' : (last, parseOverWrite),1531 #'Status-URI' : (),1532 #'Timeout' : (),1533 }1534 1535 generator_dav_headers = {1536 'DAV' : (generateList, singleHeader),1537 'Depth' : (singleHeader),1538 'Destination' : (singleHeader),1539 #'If' : (),1540 #'Lock-Token' : (),1541 'Overwrite' : (),1542 #'Status-URI' : (),1543 #'Timeout' : (),1544 }1545 1546 1524 DefaultHTTPHandler.updateParsers(parser_general_headers) 1547 1525 DefaultHTTPHandler.updateParsers(parser_request_headers) 1548 1526 DefaultHTTPHandler.updateParsers(parser_response_headers) 1549 1527 DefaultHTTPHandler.updateParsers(parser_entity_headers) 1550 DefaultHTTPHandler.updateParsers(parser_dav_headers)1551 1528 1552 1529 DefaultHTTPHandler.updateGenerators(generator_general_headers) … … 1554 1531 DefaultHTTPHandler.updateGenerators(generator_response_headers) 1555 1532 DefaultHTTPHandler.updateGenerators(generator_entity_headers) 1556 DefaultHTTPHandler.updateGenerators(generator_dav_headers)1557 1533 1558 1534 -
branches/version-identifier-3086/twisted/web2/tap.py
r16387 r22867 8 8 9 9 from twisted.web2 import static, iweb, log, server, channel, vhost 10 from twisted.web2.dav import static as dav_static11 10 12 11 class Options(usage.Options): … … 36 35 mktap web2 --path=/tmp/ 37 36 38 To serve a dav collection:39 40 mktap web2 --dav=/tmp/41 42 37 To serve a dynamic resource: 43 38 … … 192 187 self['root'].addHost(domain, iweb.IResource(classObj())) 193 188 194 def opt_vhost_dav(self, virtualHost):195 """Specify a virtual host in the form of domain=path,196 to have path served as a DAV collection at the root of197 domain198 """199 200 if (self['root'] and not \201 isinstance(self['root'], vhost.NameVirtualHost)):202 203 raise usage.UsageError("You can only use --vhost-static alone "204 "or with --vhost-class and --vhost-path")205 206 domain, path = virtualHost.split('=', 1)207 208 if not self['root']:209 self['root'] = vhost.NameVirtualHost()210 211 self['root'].addHost(domain, dav_static.DAVFile(os.path.abspath(path)))212 213 def opt_dav(self, path):214 """A path that will be used to serve the root resource as a DAV Collection.215 """216 217 if self['root']:218 raise usage.UsageError("You may only have one root resource")219 220 self['root'] = dav_static.DAVFile(os.path.abspath(path))221 222 189 def postOptions(self): 223 190 if self['https']:
