• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2712)  |  Call(2483)  |  Derive(0)  |  Import(229)
dumps(obj, protocol=0) -- Return a string containing an object in pickle format.

See the Pickler docstring for the meaning of optional argument proto.

src/z/a/zamboni-lib-HEAD/lib/python/werkzeug/contrib/cache.py   zamboni-lib(Download)
    from md5 import new as md5
from itertools import izip
from time import time
from cPickle import loads, dumps, load, dump, HIGHEST_PROTOCOL
 
 
class BaseCache(object):
    def set(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        self._prune()
        self._cache[key] = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))
 
    def add(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        if len(self._cache) > self._threshold:
            self._prune()
        item = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))

src/w/e/webnest-HEAD/env/lib/python2.6/site-packages/werkzeug/contrib/cache.py   webnest(Download)
    from md5 import new as md5
from itertools import izip
from time import time
from cPickle import loads, dumps, load, dump, HIGHEST_PROTOCOL
 
 
class BaseCache(object):
    def set(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        self._prune()
        self._cache[key] = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))
 
    def add(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        if len(self._cache) > self._threshold:
            self._prune()
        item = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))

src/u/l/uliweb-HEAD/uliweb/lib/werkzeug/contrib/cache.py   uliweb(Download)
    from md5 import new as md5
from itertools import izip
from time import time
from cPickle import loads, dumps, load, dump, HIGHEST_PROTOCOL
 
have_memcache = True
try:
    def set(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        self._prune()
        self._cache[key] = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))
 
    def add(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        if len(self._cache) > self._threshold:
            self._prune()
        item = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))

src/p/y/pythonedinburgh-HEAD/werkzeug/contrib/cache.py   pythonedinburgh(Download)
    from md5 import new as md5
from itertools import izip
from time import time
from cPickle import loads, dumps, load, dump, HIGHEST_PROTOCOL
 
 
class BaseCache(object):
    def set(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        self._prune()
        self._cache[key] = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))
 
    def add(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        if len(self._cache) > self._threshold:
            self._prune()
        item = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))

src/u/l/Uliweb-0.0.1a2/uliweb/lib/werkzeug/contrib/cache.py   Uliweb(Download)
    from md5 import new as md5
from itertools import izip
from time import time
from cPickle import loads, dumps, load, dump, HIGHEST_PROTOCOL
 
 
class BaseCache(object):
    def set(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        self._prune()
        self._cache[key] = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))
 
    def add(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        if len(self._cache) > self._threshold:
            self._prune()
        item = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))

src/w/e/Werkzeug-0.6.2/werkzeug/contrib/cache.py   Werkzeug(Download)
    from md5 import new as md5
from itertools import izip
from time import time
from cPickle import loads, dumps, load, dump, HIGHEST_PROTOCOL
 
 
class BaseCache(object):
    def set(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        self._prune()
        self._cache[key] = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))
 
    def add(self, key, value, timeout=None):
        if timeout is None:
            timeout = self.default_timeout
        if len(self._cache) > self._threshold:
            self._prune()
        item = (time() + timeout, dumps(value, HIGHEST_PROTOCOL))

src/p/r/Products.CMFEditions-2.0.2/Products/CMFEditions/ZVCStorageTool.py   Products.CMFEditions(Download)
import time
import types
from StringIO import StringIO
from cPickle import Pickler, Unpickler, dumps, loads, HIGHEST_PROTOCOL
from zope.interface import implements
 
from App.class_init import InitializeClass
    def _encodeMetadata(self, metadata):
        # metadata format is:
        #    - first line with trailing \x00: comment or empty comment
        #    - then: pickled metadata (incl. comment)
        try:
            comment = metadata['sys_metadata']['comment']
            comment = dumps(comment)
        except KeyError:
            comment = ''
        return '\x00\n'.join((comment, dumps(metadata, HIGHEST_PROTOCOL)))

src/p/y/PyProp-HEAD/extern/pypar/pypar.py   PyProp(Download)
            stat = receive_string(buffer, source, tag)
 
        elif protocol == 'vanilla':
            from cPickle import dumps, loads     
            if buffer is None:
                s = ' '*size      
            else:
                s = dumps(buffer, 1)
    elif protocol == 'string':
        broadcast_string(buffer, root)          
    elif protocol == 'vanilla':
        from cPickle import loads, dumps 
        s = dumps(buffer, 1)
        s = s + ' '*int(0.1*len(s)) #safety
 
 
    #Pickle general structures using the vanilla protocol                
    if protocol == 'vanilla':                    
        from cPickle import dumps     
        x = dumps(x, 1)
        size = len(x) # Let count be length of pickled object
 

src/a/p/AppTools-3.3.2/enthought/sweet_pickle/__init__.py   AppTools(Download)
def dumps(obj, protocol=2):
    _flush_traits(obj)
    from cPickle import dumps as ds
    return ds(obj, protocol)
 
# We don't customize exceptions so just map to the Python pickle package
from pickle import PickleError, PicklingError, UnpicklingError

src/p/o/poop-HEAD/poop.py   poop(Download)
import os
import sys
import traceback
from base64 import b64decode, b64encode
from cPickle import dumps, loads, HIGHEST_PROTOCOL
from itertools import groupby
from operator import itemgetter
    def encode(obj):
        return b64encode(dumps(obj, HIGHEST_PROTOCOL))
 
    @staticmethod
    def decode(obj):
        return loads(b64decode(obj))
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next