egv / zapys-maemo

maemo fork of zapys lj client

This URL has Read+Write access

zapys-maemo / cache.py
ec0aeb97 » egv 2008-06-22 initial commit of zapys 0.11 1 #!/usr/bin/env python
2 # -*- coding: UTF-8 -*-
3
4 import os
5
6 cache_dir = os.path.expanduser('~/.zapys/entries/')
7
8 if not os.path.isdir(cache_dir):
9 os.makedirs(cache_dir)
10
11 def put(id, text):
12 f = open(cache_dir+str(id)+'.text', 'w')
13 f.write(text)
14 f.close()
15
16 def get(id):
17 return open(cache_dir+str(id)+'.text').read()
18
19 def get_temp():
20 return open(cache_dir+'entry.html', 'w')
21