PYME.ParallelTasks.webdav module

class PYME.ParallelTasks.webdav.BufWriter(w, debug=True)

Methods

flush()
getSize()
write(s)
flush()
getSize()
write(s)
class PYME.ParallelTasks.webdav.Collection(name)

Bases: PYME.ParallelTasks.webdav.Member

Methods

getMembers()
getProperties()
getMembers()
class PYME.ParallelTasks.webdav.DAVRequestHandler(request, client_address, server)

Bases: BaseHTTPServer.BaseHTTPRequestHandler

Attributes

timeout  

Methods

WebAuth()
do_COPY()
do_DELETE()
do_GET([onlyhead])
do_HEAD()
do_LOCK()
do_MKCOL()
do_MOVE()
do_OPTIONS()
do_PROPFIND()
do_PROPPATCH()
do_PUT()
do_UNLOCK()
log_message(format, *args)
path_elem() Returns split path (see split_path()) and Member object of the last element
path_elem_prev() Returns split path (see split_path()) and Member object of the next-to-last element
split_path(path) Splits path string in form ‘/dir1/dir2/file’ into parts
Auserlist = []
WebAuth()
all_props = ['name', 'parentname', 'href', 'ishidden', 'isreadonly', 'getcontenttype', 'contentclass', 'getcontentlanguage', 'creationdate', 'lastaccessed', 'getlastmodified', 'getcontentlength', 'iscollection', 'isstructureddocument', 'defaultdocument', 'displayname', 'isroot', 'resourcetype']
auth_enable = False
auth_file = False
basic_props = ['name', 'getcontenttype', 'getcontentlength', 'creationdate', 'iscollection']
do_COPY()
do_DELETE()
do_GET(onlyhead=False)
do_HEAD()
do_LOCK()
do_MKCOL()
do_MOVE()
do_OPTIONS()
do_PROPFIND()
do_PROPPATCH()
do_PUT()
do_UNLOCK()
log_message(format, *args)
path_elem()

Returns split path (see split_path()) and Member object of the last element

path_elem_prev()

Returns split path (see split_path()) and Member object of the next-to-last element

server_version = 'Pythonista_dav'
split_path(path)

Splits path string in form ‘/dir1/dir2/file’ into parts

class PYME.ParallelTasks.webdav.DAVServer(addr, handler, root, userpwd)

Bases: SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer

Attributes

timeout  

Methods

finish_request(request, client_address)
finish_request(request, client_address)
class PYME.ParallelTasks.webdav.DirCollection(fsdir, virdir, parent=None)

Bases: PYME.ParallelTasks.webdav.FileMember, PYME.ParallelTasks.webdav.Collection

Methods

findMember(name) Search for a particular member.
getMembers() Get immediate members of this collection.
getProperties()
recvMember(rfile, name, size, req) Receive (save) a member file
rootdir()
sendData(wfile) Send “file” to the client.
COLLECTION_MIME_TYPE = 'httpd/unix-directory'
findMember(name)

Search for a particular member.

getMembers()

Get immediate members of this collection.

getProperties()
recvMember(rfile, name, size, req)

Receive (save) a member file

rootdir()
sendData(wfile)

Send “file” to the client. Since this is a directory, build some arbitrary HTML.

class PYME.ParallelTasks.webdav.DummyFileMember(name, parent)

Bases: PYME.ParallelTasks.webdav.FileMember

Methods

getProperties()
sendData(wfile[, bpoint, epoint]) Send the file to the client.
getProperties()
class PYME.ParallelTasks.webdav.FileMember(name, parent)

Bases: PYME.ParallelTasks.webdav.Member

Methods

getProperties() Return dictionary with WebDAV properties.
sendData(wfile[, bpoint, epoint]) Send the file to the client.
getProperties()

Return dictionary with WebDAV properties. Values shold be formatted according to the WebDAV specs.

sendData(wfile, bpoint=0, epoint=0)

Send the file to the client. Literally.

class PYME.ParallelTasks.webdav.Member

Methods

getProperties()
M_COLLECTION = 2
M_MEMBER = 1
getProperties()
class PYME.ParallelTasks.webdav.Tag(name, attrs, data='', parser=None)

Methods

addChild(tag) Adds a child to self.
addChild(tag)

Adds a child to self. tag must be instance of Tag

class PYME.ParallelTasks.webdav.TempDirCollection(fsdir, virdir, parent=None)

Bases: PYME.ParallelTasks.webdav.DirCollection

Temporary directories do not exist on disk. They are held in memory on the server to provide a mechanism for creating new directories with the create + rename/move mechanism used by most OSs

Methods

findMember(name)
getMembers()
getProperties() Return dictionary with WebDAV properties.
recvMember(rfile, name, size, req)
rootdir()
sendData(wfile) Send “file” to the client.
findMember(name)
getMembers()
getProperties()

Return dictionary with WebDAV properties. Values shold be formatted according to the WebDAV specs.

recvMember(rfile, name, size, req)
class PYME.ParallelTasks.webdav.XMLDict_Parser(xml)

Methods

builddict() Builds a nested-dictionary-like structure from the xml.
getnexttag()
processTag(dtag) Process single tag’s data
builddict()

Builds a nested-dictionary-like structure from the xml. This method picks up tags on the main level and calls processTag() for nested tags.

getnexttag()
processTag(dtag)

Process single tag’s data

PYME.ParallelTasks.webdav.builddict(xml)

Wrapper function for straightforward parsing

PYME.ParallelTasks.webdav.get_localip()
PYME.ParallelTasks.webdav.main()
PYME.ParallelTasks.webdav.makedirs_safe(dir)

A safe wrapper for makedirs, which won’t throw an error if the directory already exists. This replicates the functionality of the exists_ok flag in the python 3 version of os.makedirs, but should work with both pytion 2 and python 3.

Parameters:dir : str, directory to be created
PYME.ParallelTasks.webdav.splitattrs(att)

Extracts name=”value” pairs from string; returns them as dictionary

PYME.ParallelTasks.webdav.unixdate2httpdate(d)
PYME.ParallelTasks.webdav.unixdate2iso8601(d)