egv / zapys-maemo

maemo fork of zapys lj client

This URL has Read+Write access

zapys-maemo / conf.py
100644 23 lines (15 sloc) 0.453 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
 
import ConfigParser
c = ConfigParser.ConfigParser(dict(username = 'test', password = 'test'))
 
import os
 
conf_dir = os.path.expanduser('~/.zapys/')
 
if not os.path.isdir(conf_dir):
os.makedirs(conf_dir)
 
userconf = conf_dir+'config'
 
if os.path.exists(userconf):
    c.read(userconf)
else:
    c.write(open(userconf, 'w'))
 
username = c.get('DEFAULT', 'username')
password = c.get('DEFAULT', 'password')