Exemple #1
0
 def set(self, key, data):
     filename = path.join(self.directory, '%s' % make_md5(self.V, key))
     f = open(filename, 'wb')
     try:
         f.write(pickle.dumps(data))
     finally:
         f.close()
Exemple #2
0
 def set(self, key, data):
     filename = path.join(self.directory, '%s' % make_md5(self.V, key))
     f = open(filename, 'wb')
     try:
         f.write(pickle.dumps(data))
     finally:
         f.close()
Exemple #3
0
def maybe_pickle(value):
    """Pickle the given value if it is not a string."""
    if not isinstance(value, basestring):
        return pickle.dumps(value)
    return value
Exemple #4
0
def maybe_pickle(value):
    """Pickle the given value if it is not a string."""
    if not isinstance(value, str):
        return pickle.dumps(value)
    return value