示例#1
0
 def get_projectdb():
     return projectdb.ProjectDB(self.projectdb_path)
示例#2
0
文件: webui.py 项目: rmaC7/pyspider
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<*****@*****.**>
#         http://binux.me
# Created on 2014-02-22 23:19:11

import xmlrpclib

from webui.app import app
from fetcher import tornado_fetcher
from database.sqlite import taskdb, projectdb


def fetch(task):
    t, f = tornado_fetcher.Fetcher(None, None, async=False).fetch(task)
    return f


config = {
    'fetch': fetch,
    'projectdb': projectdb.ProjectDB('data/project.db'),
    'taskdb': taskdb.TaskDB('./data/task.db'),
    'scheduler_rpc': xmlrpclib.ServerProxy('http://localhost:23333')
}

if __name__ == '__main__':
    app.config.update(**config)
    app.debug = True
    app.run()
示例#3
0
文件: run.py 项目: rmaC7/pyspider
def get_projectdb():
    return projectdb.ProjectDB('./data/project.db')