mirror of
https://github.com/bspeice/metrik
synced 2024-11-23 15:48:10 -05:00
13 lines
302 B
Python
13 lines
302 B
Python
from pickle import dump, load
|
|
|
|
from metrik.targets.temp_file import TempFileTarget
|
|
|
|
|
|
class PickleTarget(TempFileTarget):
|
|
def write(self, obj):
|
|
with open(self.full_path(), 'w+b') as handle:
|
|
dump(obj, handle)
|
|
|
|
def read(self):
|
|
return load(open(self.full_path(), 'rb'))
|