public
Description: maemo fork of zapys lj client
Homepage:
Clone URL: git://github.com/egv/zapys-maemo.git
zapys-maemo / cache.py
100644 21 lines (14 sloc) 0.382 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
 
import os
 
cache_dir = os.path.expanduser('~/.zapys/entries/')
 
if not os.path.isdir(cache_dir):
os.makedirs(cache_dir)
 
def put(id, text):
f = open(cache_dir+str(id)+'.text', 'w')
f.write(text)
f.close()
 
def get(id):
return open(cache_dir+str(id)+'.text').read()
 
def get_temp():
return open(cache_dir+'entry.html', 'w')