예제 #1
0
파일: reminders.py 프로젝트: nmlorg/metabot
 def _hourly():
     try:
         multibot.multical.poll()
         _daily_messages(multibot, records)
         if recordsfname:
             pickleutil.dump(recordsfname, records)
     finally:
         _queue()
예제 #2
0
def test_dump_load(tmpdir):
    """Verify the dumper and loader work as expected."""

    tmpfile = tmpdir.join('test.pickle')
    obj = {b'key': [b'value', b'value']}
    assert pickleutil.dump(tmpfile.strpath, obj) == obj
    assert pickleutil.load(tmpfile.strpath) == obj
예제 #3
0
def test_dump_simple(tmpdir):
    """Verify the dumper preserves simple objects."""

    tmpfile = tmpdir.join('test.pickle')
    obj = 1
    assert pickleutil.dump(tmpfile.strpath, obj) == obj
    assert tmpfile.load() == obj
예제 #4
0
def _save():
    pickleutil.dump(_CACHEFILE, _CACHE)
예제 #5
0
파일: loader.py 프로젝트: nmlorg/metabot
 def __save(self):
     logging.info('Rewriting %r.', self.__fname)
     self.__dict__.update(pickleutil.dump(self.__fname, self.__dict__))