(obj, level=9)
Pickles the object and compress the dumped string with zlib

   :param obj: the object to be pickled
   :param level: the compression level, 9 is the best
                    and -1 is to not compress
Pickles the object and compress the dumped string with zlib
Pickles the object and compress the dumped string with zlib
def pickleAndCompress(obj, level=9):
   """ Pickles the object and compress the dumped string with zlib

   :param obj: the object to be pickled
   :param level: the compression level, 9 is the best
                    and -1 is to not compress

   """
   pickled = cPickle.dumps(obj)
   if level < 0:
       return pickled
   else:
      if not ZLIB_SUPPORT:
         Util.raiseException('zlib not found !', ImportError)
      pickled_zlib = zlib.compress(pickled, level)
      return pickled_zlib
def pickleAndCompress ( obj , level = 9 ) : pickled = cPickle . dumps ( obj ) if level < 0 : return pickled else : if not ZLIB_SUPPORT : Util . raiseException ( 'zlib not found !' , ImportError ) pickled_zlib = zlib . compress ( pickled , level ) return pickled_zlib