Exemplo n.º 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")
Exemplo n.º 2
0
# -*- coding: utf-8 -*- 


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'
scrapy_config = {
    u"concurrent_spiders": 10,
    u"download_timeout": 15
  }
project_config = {
    u"allowed_domains": [
        u"irr.ru"
    ],
    u"start_urls": [
        u"http://irr.ru/real-estate/commercial/search/currency=RUR/sourcefrom=0/date_create=yesterday/page_len60/",
        u"http://irr.ru/real-estate/commercial/search/currency=RUR/sourcefrom=1/date_create=yesterday/page_len60/",
Exemplo n.º 3
0
# -*- coding: utf-8 -*- 


from realty.utils.errorhandler import get_error_handler

error_handler = get_error_handler()

try:
	1 / 0
except Exception as e:
    error_handler.add_error_and_process({"error": e, "source": "errorhandler_test.py: 1"})

print error_handler.pop()


def process_last_error(error):
    print error
    return False

error_handler = get_error_handler(process_last_error)

try:
    1 / 0
except Exception as e:
    error_handler.add_error_and_process({"error": e, "source": "errorhandler_test.py: 2"})


print error_handler.pop()