Moving setuptools and twitools to subdirs
This commit is contained in:
parent
9a4ce98f2d
commit
61d049a01f
|
@ -1,11 +1,13 @@
|
||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
|
conffile = "config.cfg"
|
||||||
|
|
||||||
class SetupException(Exception):
|
class SetupException(Exception):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Seems like config.cfg has not been created yet. Run setup.py to do so."
|
return "Seems like config.cfg has not been created yet. Run setup.py to do so."
|
||||||
|
|
||||||
def getSetting(section, setting):
|
def getSetting(section, setting):
|
||||||
config = configparser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
config.read('config.cfg')
|
config.read(conffile)
|
||||||
return config.get(section, setting)
|
return config.get(section, setting)
|
||||||
|
|
|
@ -2,7 +2,7 @@ import setuptools, tweepy
|
||||||
|
|
||||||
def cke():
|
def cke():
|
||||||
try:
|
try:
|
||||||
return getSetting("Twitter", "cke")
|
return setuptools.getSetting("Twitter", "cke")
|
||||||
except:
|
except:
|
||||||
raise setuptools.SetupException()
|
raise setuptools.SetupException()
|
||||||
|
|
Loading…
Reference in a new issue