# Stream Domain
-USER_DOMAIN = 'userstream.twitter.com',
-PUBLIC_DOMAIN = 'stream.twitter.com',
-SITE_DOMAIN = 'sitestream.twitter.com',
+USER_DOMAIN = 'userstream.twitter.com'
+PUBLIC_DOMAIN = 'stream.twitter.com'
+SITE_DOMAIN = 'sitestream.twitter.com'
# Actually called
DOMAIN = USER_DOMAIN
+import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from table_def import Map
-
+from .table_def import *
class RainbowDB():
engine=None
def __init__(self):
+ if not os.path.isfile('rainbow.db'):
+ init_db()
self.engine = create_engine('sqlite:///rainbow.db', echo=False)
def store(self, tweet_id):
def __init__(self, tweet_id):
self.tweet_id = tweet_id
-Base.metadata.create_all(engine)
\ No newline at end of file
+def init_db():
+ Base.metadata.create_all(engine)
\ No newline at end of file