Back to index

plone3  3.1.7
Classes | Functions | Variables
upload Namespace Reference

Classes

class  FakeResponse

Functions

def upload
def getText

Variables

tuple start = time.time()
string usage = "usage: %prog [options] server[:port] /path/to/col/ [atxml files...]"
tuple parser = OptionParser(usage=usage)
string help = "WebDAV user name"
string default = "admin"
list files = args[2:]
list server = args[0]
list pathstarts = args[1]
tuple conn = davlib.DAV(server, timeout=300)
list bad = []
int count = 0
tuple metafile = open(file)
tuple metacontent = metafile.read()
 name = metafile.name
list id = fidname[:-len(options.atxmlend)]
tuple f = open(fid+options.contentend)
tuple content = f.read()
tuple dom = minidom.parseString(metacontent)
list field
string path = "%s%s%s"
 errormeta = None
tuple response = upload(metacontent, conn, path)
 errorcontent = None
tuple end = time.time()

Class Documentation

class upload::FakeResponse

Definition at line 43 of file upload.py.


Function Documentation

def upload.getText (   nodelist)
DOM helper, for extracting text

Definition at line 53 of file upload.py.

00053 
00054 def getText(nodelist):
00055     """DOM helper, for extracting text"""
00056     rc = ""
00057     for node in nodelist:
00058         if node.nodeType == node.TEXT_NODE:
00059             rc = rc + node.data
00060     return rc

def upload.upload (   content,
  conn,
  path 
)

Definition at line 45 of file upload.py.

00045 
00046 def upload(content, conn, path):
00047     if content:
00048         return conn.put(path, content, content_type='text/html')
00049     else:
00050         x = FakeResponse()
00051         x.status = 0
00052         return x


Variable Documentation

list upload.bad = []

Definition at line 99 of file upload.py.

tuple upload.conn = davlib.DAV(server, timeout=300)

Definition at line 96 of file upload.py.

string upload.content = f.read()

Definition at line 120 of file upload.py.

int upload.count = 0

Definition at line 100 of file upload.py.

string upload.default = "admin"

Definition at line 67 of file upload.py.

tuple upload.dom = minidom.parseString(metacontent)

Definition at line 127 of file upload.py.

tuple upload.end = time.time()

Definition at line 168 of file upload.py.

string upload.errorcontent = None

Definition at line 144 of file upload.py.

string upload.errormeta = None

Definition at line 138 of file upload.py.

tuple upload.f = open(fid+options.contentend)

Definition at line 119 of file upload.py.

Initial value:
00001 [x for x in dom.getElementsByTagName('field') \
00002                      if x.getAttribute("id")=="id"]

Definition at line 128 of file upload.py.

list upload.files = args[2:]

Definition at line 89 of file upload.py.

string upload.help = "WebDAV user name"

Definition at line 66 of file upload.py.

tuple upload.id = fidname[:-len(options.atxmlend)]

Definition at line 112 of file upload.py.

tuple upload.metacontent = metafile.read()

Definition at line 104 of file upload.py.

tuple upload.metafile = open(file)

Definition at line 103 of file upload.py.

upload.name = metafile.name

Definition at line 106 of file upload.py.

tuple upload.parser = OptionParser(usage=usage)

Definition at line 64 of file upload.py.

string upload.path = "%s%s%s"

Definition at line 135 of file upload.py.

list upload.pathstarts = args[1]

Definition at line 95 of file upload.py.

Definition at line 139 of file upload.py.

list upload.server = args[0]

Definition at line 94 of file upload.py.

tuple upload.start = time.time()

Definition at line 61 of file upload.py.

string upload.usage = "usage: %prog [options] server[:port] /path/to/col/ [atxml files...]"

Definition at line 63 of file upload.py.