Commits

Bruno Bord  committed e5836da Merge

storage without connection issues

  • Participants
  • Parent commits 9e37a25, 5e64633
  • Branches twitter_oauth

Comments (0)

Files changed (1)

File src/home_at_home/storage.py

 #-*- coding: utf-8 -*-
 "Storage handling"
+import sys
 import re
 import logging
 logging.basicConfig(level=logging.NOTSET)
     
     def __init__(self, host='localhost', dbname='twitter', collection='tweets',
         twitter_email='', twitter_password='', twitter_username=''):
-        connection = Connection(host)
+        try:
+            connection = Connection(host)
+        except:
+            print "Issues with the database connection. Please check"
+            sys.exit()
         self.store = connection[dbname][collection]
         self.twitter_email = twitter_email
         self.twitter_password = twitter_password