diff options
author | cedricbonhomme <devnull@localhost> | 2012-03-09 08:13:21 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2012-03-09 08:13:21 +0100 |
commit | 0e8780ff6ba24cc0b370037e71a9c6aa25bca192 (patch) | |
tree | 75cea6d48e04faed448a42562bb9a692af1f8442 | |
parent | Updated revision date. (diff) | |
download | newspipe-0e8780ff6ba24cc0b370037e71a9c6aa25bca192.tar.gz newspipe-0e8780ff6ba24cc0b370037e71a9c6aa25bca192.tar.bz2 newspipe-0e8780ff6ba24cc0b370037e71a9c6aa25bca192.zip |
MongoDB configuration (address, port, username and password) is loaded at launch.
-rwxr-xr-x | cfg/pyAggr3g470r.cfg-sample | 2 | ||||
-rwxr-xr-x | pyAggr3g470r.py | 2 | ||||
-rwxr-xr-x | utils.py | 11 |
3 files changed, 12 insertions, 3 deletions
diff --git a/cfg/pyAggr3g470r.cfg-sample b/cfg/pyAggr3g470r.cfg-sample index ae749b11..2e90df68 100755 --- a/cfg/pyAggr3g470r.cfg-sample +++ b/cfg/pyAggr3g470r.cfg-sample @@ -4,7 +4,7 @@ max_nb_articles = 50 [MongoDB] address = 127.0.0.1 port = 27017 -username = nickname +user = username password = pwd [mail] mail_from = pyAggr3g470r@no-reply.com diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index aeb28558..ae7af2d4 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -109,7 +109,7 @@ class Root: def __init__(self): """ """ - self.mongo = mongodb.Articles() + self.mongo = mongodb.Articles(utils.MONGODB_ADDRESS, utils.MONGODB_PORT) def index(self): """ @@ -72,15 +72,24 @@ try: except: config.read("./cfg/pyAggr3g470r.cfg-sample") path = os.path.abspath(".") + +MONGODB_ADDRESS = config.get('MongoDB', 'address') +MONGODB_PORT = int(config.get('MongoDB', 'port')) +MONGODB_USER = config.get('MongoDB', 'user') +MONGODB_PASSWORD = config.get('MongoDB', 'password') + sqlite_base = os.path.abspath(config.get('global', 'sqlitebase')) + MAX_NB_ARTICLES = int(config.get('global', 'max_nb_articles')) -DIASPORA_POD = config.get('misc', 'diaspora_pod') + mail_from = config.get('mail','mail_from') mail_to = config.get('mail','mail_to') smtp_server = config.get('mail','smtp') username = config.get('mail','username') password = config.get('mail','password') +DIASPORA_POD = config.get('misc', 'diaspora_pod') + # regular expression to chech URL url_finders = [ \ re.compile("([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}|(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+)(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\),\\\"]"), \ |