Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Read database from a configfile, so beta can now easily have

it's own database.
  • Loading branch information...
commit ce807cdaa3f3e8cd1d600df9134c23ac7bd7c4cf 1 parent 62ec6ca
@mhagander authored
Showing with 12 additions and 3 deletions.
  1. +4 −1 aggregator.py
  2. +4 −1 discovery.py
  3. +4 −1 generator.py
View
5 aggregator.py
@@ -11,6 +11,7 @@
import feedparser
import datetime
import socket
+import ConfigParser
class Aggregator:
def __init__(self, db):
@@ -68,4 +69,6 @@ def StoreEntry(self, feedid, guid, date, link, guidisperma, title, txt):
self.stored += 1
if __name__=="__main__":
- Aggregator(psycopg2.connect('dbname=planetpg host=/tmp/')).Update()
+ c = ConfigParser.ConfigParser()
+ c.read('planet.ini')
+ Aggregator(psycopg2.connect(c.get('planet','db'))).Update()
View
5 discovery.py
@@ -12,6 +12,7 @@
import feedparser
import datetime
import socket
+import ConfigParser
class Aggregator:
def __init__(self, db):
@@ -44,4 +45,6 @@ def DiscoverFeed(self, feedinfo):
print feed
if __name__=="__main__":
- Aggregator(psycopg2.connect('dbname=planetpg host=/tmp/')).Update()
+ c = ConfigParser.ConfigParser()
+ c.read('planet.ini')
+ Aggregator(psycopg2.connect(c.get('planet','db'))).Update()
View
5 generator.py
@@ -10,6 +10,7 @@
import psycopg2
import psycopg2.extensions
import PyRSS2Gen
+import ConfigParser
import datetime
import sys
import tidy
@@ -154,4 +155,6 @@ def GetText(self):
return self.fulltxt
if __name__=="__main__":
- Generator(psycopg2.connect('dbname=planetpg host=/tmp')).Generate()
+ c = ConfigParser.ConfigParser()
+ c.read('planet.ini')
+ Generator(psycopg2.connect(c.get('planet','db'))).Generate()
Please sign in to comment.
Something went wrong with that request. Please try again.