Пример #1
0
 def __init__(self):
     """
         The only async framework that PyMongo fully supports is Gevent.
         Currently there is no great way to use PyMongo in conjunction with Tornado or Twisted. PyMongo provides built-in connection pooling, so some of the benefits of those frameworks can be achieved just by writing multi-threaded code that shares a MongoClient.
     """
     self.style = color.color_style()
     self.session = loadSession()
Пример #2
0
 def __init__(self):
     """
         The only async framework that PyMongo fully supports is Gevent.
         Currently there is no great way to use PyMongo in conjunction with Tornado or Twisted. PyMongo provides built-in connection pooling, so some of the benefits of those frameworks can be achieved just by writing multi-threaded code that shares a MongoClient.
     """
     self.style = color.color_style()
     try:
         client = MongoClient(self.MONGODB_SERVER, self.MONGODB_PORT)
         self.db = client[self.MONGODB_DB]
     except Exception as e:
         print(self.style.ERROR("ERROR(SingleMongodbPipeline): %s" % (str(e),)))
         traceback.print_exc()
Пример #3
0
 def __init__(self, file_url=None, *args):
     self.file_url = file_url
     self.style = color.color_style()
     Exception.__init__(self, *args)
Пример #4
0
 def __init__(self, store_uri, download_func=None):
     if not store_uri:
         raise NotConfigured
     self.store = self._get_store(store_uri)
     self.style = color.color_style()
     super(FilePipeline, self).__init__(download_func=download_func)
Пример #5
0
 def __init__(self):
     self.style = color.color_style()