Exemplo n.º 1
0
 def __init__(self, statusManage, userManage, commentManage, logFileName):
     self.errorLog = os.path.abspath(
         os.path.join(os.path.dirname(__file__), os.path.pardir,
                      os.path.pardir, "logs", "merge_error.log"))
     self.statusManager = statusManage
     self.userManager = userManage
     self.commentManager = commentManage
     self.logFile = logFileName
     databaseConnector.connect()
 def __init__(self):
     Thread.__init__(self)
     databaseConnector.connect()
     self.logFile = os.path.abspath(
         os.path.join(os.path.dirname(__file__), os.path.pardir,
                      os.path.pardir, "logs",
                      "recollect_comments_error.log"))
     self.status_care_period = int(
         configReader.getOptionValue('time_spand', 'time_in_days'))
     self.scheduler = sched.scheduler(time.time, time.sleep)
 def connect_db_(self,
                 databaseName,
                 conn_alias,
                 db_port=27017,
                 db_host='127.0.0.1'):
     """
         连接数据库
     """
     databaseConnector.connect(dbname=databaseName,
                               alias=conn_alias,
                               host=db_host,
                               port=db_port)
Exemplo n.º 4
0
 def __init__(self, task_database_name=None):
     self.task_database_host = configReader.getOptionValue(
         'task_db', 'db_host')
     self.task_database_port = configReader.getOptionValue(
         'task_db', 'db_port')
     self.task_database_name = configReader.getOptionValue(
         'task_db', 'task_save_db')
     self.conn_alias = configReader.getOptionValue('task_db',
                                                   'connect_alias')
     databaseConnector.connect(dbname=self.task_database_name,
                               host=self.task_database_host,
                               port=int(self.task_database_port),
                               alias=self.conn_alias)
     self.insert_default_task()
 def __init__(self):
     # self.analysis_status(u'我很伤心')
     databaseConnector.connect()
     self.analysisScheduler = sched.scheduler(time.time, time.sleep)
 def __init__(self):
     Thread.__init__(self)
     databaseConnector.connect()
     self.comments_manager = CommentManager()
     self.scheduler = sched.scheduler(time.time, time.sleep)
Exemplo n.º 7
0
 def __init__(self):
     #连接到默认数据库
     databaseConnector.connect()
Exemplo n.º 8
0
 def __init__(self):
     databaseConnector.connect()