Beispiel #1
0
# -*- coding: utf-8 -*- 

from realty.utils.errorhandler import get_error_handler
from realty.config.config import Config

error_handler = get_error_handler()

config = Config(error_handler)

print config.read('connection')

print config.read('connection.host')

print config.read("defaults.limit")
Beispiel #2
0
  "limit": {
    "records": config.read("defaults.limit.records")
    }
})
project = json.loads(j)
"""

from realty.config.config import Config
from realty.utils import errorhandler
from realty.models.db import get_database
from realty.models.projectDAO import ProjectDAO


error_handler = errorhandler.get_error_handler()

config = Config(error_handler)

database = get_database(config)

projects = ProjectDAO(database, error_handler)


project_code = u'irr.ru'
code = u'general'

project = projects.get(project_code, code)
project[u'params'] = {}
project[u'limit'] = config.read("defaults.limit")

process.crawl(RealtySpider, project=project)
process.start() # the script will block here until the crawling is finished