示例#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
示例#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
示例#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
示例#4
0
def stringToZippedBytesArray(value):
    zipper = ChecksumZipper()
    return zipper.zip(stringToBytesArray(value))
示例#5
0
def stringToZippedBytesArray(value):
	zipper = ChecksumZipper()
	return zipper.zip(stringToBytesArray(value))
示例#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