mirror of
https://github.com/jlengrand/twitterboard.git
synced 2026-03-10 08:51:22 +00:00
Implements automatic way to find config file without providing path
Removes database files from repo.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ basic.keys
|
|||||||
lib_tests/tweepy
|
lib_tests/tweepy
|
||||||
*.pyc
|
*.pyc
|
||||||
test.py
|
test.py
|
||||||
|
*.db
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ engine=sqlite:///twiderboard.db
|
|||||||
|
|
||||||
[log]
|
[log]
|
||||||
|
|
||||||
debug=False
|
debug=Falsez
|
||||||
name=board.log
|
name=board.log
|
||||||
|
|
||||||
[keys]
|
[keys]
|
||||||
@@ -3,12 +3,14 @@
|
|||||||
|
|
||||||
from ConfigParser import SafeConfigParser
|
from ConfigParser import SafeConfigParser
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
# FIXME: find how to read it from anywhere.
|
# FIXME: find how to read it from anywhere.
|
||||||
#(without having to be in correct folder)
|
#(without having to be in correct folder)
|
||||||
|
|
||||||
parser = SafeConfigParser()
|
parser = SafeConfigParser()
|
||||||
parser.read('basic.ini')
|
# ini file should be located one folder up from data module (in main repo)
|
||||||
|
ini_path = os.path.join(os.path.dirname(os.path.dirname( __file__ )), 'basic.ini')
|
||||||
|
parser.read(ini_path)
|
||||||
|
|
||||||
# Base :
|
# Base :
|
||||||
engine_url = parser.get('base', 'engine')
|
engine_url = parser.get('base', 'engine')
|
||||||
|
|||||||
Reference in New Issue
Block a user