Ejemplo n.º 1
0
def getunZippedContent(content):
    zipper = ChecksumZipper()
    zippedArray = content.split(',')
    zippedList = []
    for zippedByte in zippedArray:
        zippedList.append(Byte.parseByte(zippedByte))
    unzipBytes = zipper.unzip(zippedList)
    buffer = str(String(unzipBytes))
    return buffer
Ejemplo n.º 2
0
def getunZippedContent(content):
    zipper = ChecksumZipper()
    zippedArray = content.split(',')
    zippedList = []
    for zippedByte in zippedArray:
        zippedList.append(Byte.parseByte(zippedByte))
    unzipBytes = zipper.unzip(zippedList)
    buffer = str(String(unzipBytes))
    return buffer
Ejemplo n.º 3
0
 def _createSpServiceOsh(self, name, content, container):
     serviceOsh = ObjectStateHolder("sharepoint_service")
     serviceOsh.setAttribute('data_name', name)
     serviceOsh.setContainer(container)
     if content:
         bytes = String(content).getBytes()
         zipper = ChecksumZipper()
         zippedBytes = zipper.zip(bytes)
         #3000 is field size in sharepoint_service CMDB class
         if len(zippedBytes) <= 3000:
             serviceOsh.setBytesAttribute('document_data', zippedBytes)
     return serviceOsh
Ejemplo n.º 4
0
def stringToZippedBytesArray(value):
    zipper = ChecksumZipper()
    return zipper.zip(stringToBytesArray(value))
Ejemplo n.º 5
0
def stringToZippedBytesArray(value):
	zipper = ChecksumZipper()
	return zipper.zip(stringToBytesArray(value))
Ejemplo n.º 6
0
 def _getContentBytes(self, contentString):
     if not contentString: raise ValueError("content is empty")
     bytes = String(contentString).getBytes()
     zipper = ChecksumZipper()
     zippedBytes = zipper.zip(bytes)
     return zippedBytes