Ejemplo n.º 1
0
    def getDB(self):
        # The database is lazily created here instead of the constructor
        # so that it can be created and used in the bot's thread.
        if self.db is None:
            self.db = btcebot.MarketDatabase(self.database_path)

        return self.db
Ejemplo n.º 2
0
    def get_db(self):
        if not self.enabled:
            return

        if getattr(self.storage, 'db', None) is None:
            self.storage.db = btcebot.MarketDatabase()

        return self.storage.db