Moving setuptools and twitools to subdirs

This commit is contained in:
Klaus-Uwe Mitterer 2016-03-16 13:57:57 +01:00
parent 9a4ce98f2d
commit 61d049a01f
2 changed files with 4 additions and 2 deletions

View file

@ -1,11 +1,13 @@
import configparser
conffile = "config.cfg"
class SetupException(Exception):
def __str__(self):
return "Seems like config.cfg has not been created yet. Run setup.py to do so."
def getSetting(section, setting):
config = configparser.RawConfigParser()
config.read('config.cfg')
config.read(conffile)
return config.get(section, setting)

View file

@ -2,7 +2,7 @@ import setuptools, tweepy
def cke():
try:
return getSetting("Twitter", "cke")
return setuptools.getSetting("Twitter", "cke")
except:
raise setuptools.SetupException()