Back to index

plone3  3.1.7
Functions
plone.app.linkintegrity.utils Namespace Reference

Functions

def encodeStrings
def decodeStrings
def encodeRequestData
def decodeRequestData
def encodeInts
def decodeInts

Function Documentation

decode a string to a list of integers 

Definition at line 47 of file utils.py.

00047 
00048 def decodeInts(data):
00049     """ decode a string to a list of integers """
00050     return map(int, data.split(':'))
00051 

Here is the caller graph for this function:

decode the relevant request data, i.e. body and env 

Definition at line 33 of file utils.py.

00033 
00034 def decodeRequestData(data):
00035     """ decode the relevant request data, i.e. body and env """
00036     def _pertwo():
00037         while True:
00038             yield data.next(), data.next()
00039     data = decodeStrings(data)
00040     return data.next(), dict(_pertwo())
00041 

Here is the call graph for this function:

Here is the caller graph for this function:

decode and uncompress a string as a generator 

Definition at line 13 of file utils.py.

00013 
00014 def decodeStrings(data):
00015     """ decode and uncompress a string as a generator """
00016     data = decompress(b64decode(data))
00017     while data:
00018         pos = data.find(':')
00019         end = pos + int(data[:pos]) + 1
00020         yield data[pos+1:end]
00021         data = data[end:]
00022 

Here is the caller graph for this function:

encode a list of integers into a string 

Definition at line 42 of file utils.py.

00042 
00043 def encodeInts(ints):
00044     """ encode a list of integers into a string """
00045     return ':'.join(map(str, ints))
00046 

Here is the caller graph for this function:

encode the relevant request data, i.e. body and env 

Definition at line 23 of file utils.py.

00023 
00024 def encodeRequestData((body, env)):
00025     """ encode the relevant request data, i.e. body and env """
00026     def _iterdata():
00027         yield body
00028         for key, val in env.iteritems():
00029             yield str(key)
00030             yield str(val)
00031     return encodeStrings(_iterdata())
00032 

Here is the call graph for this function:

Here is the caller graph for this function:

compress and encode a list of strings into a single string 

Definition at line 5 of file utils.py.

00005 
00006 def encodeStrings(strings):
00007     """ compress and encode a list of strings into a single string """
00008     def _encode(strings):
00009         for string in strings:
00010             yield '%d:%s' % (len(string), string)
00011     return b64encode(compress(''.join(_encode(strings))))
00012 

Here is the caller graph for this function: