lawwenda.sharehttpapp package

Submodules

lawwenda.sharehttpapp.davprop module

WebDAV properties.

class lawwenda.sharehttpapp.davprop.CommentDavProp

Bases: lawwenda.sharehttpapp.davprop.DavProp

Custom WebDAV property {DAV:xattr}xdg.comment that mirrors lawwenda.fs.Filesystem.Node.comment.

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode – The node to inquire.

class lawwenda.sharehttpapp.davprop.DavProp(davname, *, is_writable)

Bases: object

Base class for WebDAV properties.

Each subclass implements one particular property as used in e.g. PROPFIND requests.

Must be registered with register_prop().

Parameters
  • davname (str) –

  • is_writable (bool) –

property davname

The name of this property.

Return type

str

Return type

str

Return type

str

Return type

str

Return type

str

Return type

str

Return type

str

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode (lawwenda.fs.Filesystem.Node) – The node to inquire.

Return type

Optional[str]

property is_writable

Whether this property can also be modified (in contrast to read-only properties like the file size).

Return type

bool

Return type

bool

Return type

bool

Return type

bool

Return type

bool

Return type

bool

Return type

bool

class lawwenda.sharehttpapp.davprop.GeoDavProp

Bases: lawwenda.sharehttpapp.davprop.DavProp

Custom WebDAV property {DAV:xattr}pino.geo that mirrors lawwenda.fs.Filesystem.Node.geo.

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode – The node to inquire.

class lawwenda.sharehttpapp.davprop.MtimeDavProp

Bases: lawwenda.sharehttpapp.davprop.DavProp

The WebDAV getlastmodified property.

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode – The node to inquire.

class lawwenda.sharehttpapp.davprop.RatingDavProp

Bases: lawwenda.sharehttpapp.davprop.DavProp

Custom WebDAV property {DAV:xattr}baloo.rating that mirrors lawwenda.fs.Filesystem.Node.rating.

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode – The node to inquire.

class lawwenda.sharehttpapp.davprop.ResourceTypeDavProp

Bases: lawwenda.sharehttpapp.davprop.DavProp

The WebDAV resourcetype property.

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode – The node to inquire.

class lawwenda.sharehttpapp.davprop.SizeDavProp

Bases: lawwenda.sharehttpapp.davprop.DavProp

The WebDAV getcontentlength property.

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode – The node to inquire.

class lawwenda.sharehttpapp.davprop.TagsDavProp

Bases: lawwenda.sharehttpapp.davprop.DavProp

Custom WebDAV property {DAV:xattr}xdg.tags that mirrors lawwenda.fs.Filesystem.Node.tagstring.

get_for_node(fsnode)

Return the property value for a node.

Parameters

fsnode – The node to inquire.

lawwenda.sharehttpapp.davprop.get_prop_by_davname(davname)

Return a DavProp by name or None if no such ones exist.

Parameters

davname (str) – The name to find, as used in WebDAV.

Return type

Optional[lawwenda.sharehttpapp.davprop.DavProp]

lawwenda.sharehttpapp.davprop.register_prop(prop)

Register a DavProp implementation.

Returns the same type afterwards, so it can be used as class decorator.

Parameters

prop (Type[DavProp]) – A subclass of DavProp.

Return type

Type[lawwenda.sharehttpapp.davprop.DavProp]

Module contents

A wsgi application that provides an http interface to a filesystem.

See ShareHttpApp.

class lawwenda.sharehttpapp.ShareHttpApp(filesystem)

Bases: object

A wsgi application that provides an http interface to a filesystem.

It provides bare http access, and also WebDAV extensions for a more complete interface. It does not provide an own user interface or user authentication.

Parameters

filesystem (lawwenda.fs.Filesystem) –

property __allowed_methods
Return type

t.List[str]

Return type

t.List[str]

Return type

t.List[str]

Return type

t.List[str]

Return type

t.List[str]

Return type

t.List[str]

Return type

t.List[str]

_method_copy(request, fsnode, *, xfermethod='copy_to')
Parameters
_method_delete(request, fsnode)
Parameters
_method_get(request, fsnode, is_head_request=False)
Parameters
_method_head(request, fsnode)
Parameters
_method_mkcol(request, fsnode)
Parameters
_method_move(request, fsnode)
Parameters
_method_options(request, fsnode)
Parameters
_method_propfind(request, fsnode)
Parameters
_method_proppatch(request, fsnode)
Parameters
_method_put(request, fsnode)
Parameters
property filesystem

The filesystem used by this ShareHttpApp.

Return type

lawwenda.fs.Filesystem

Return type

lawwenda.fs.Filesystem

Return type

lawwenda.fs.Filesystem

Return type

lawwenda.fs.Filesystem

Return type

lawwenda.fs.Filesystem

Return type

lawwenda.fs.Filesystem

Return type

lawwenda.fs.Filesystem