Ejemplo n.º 1
0
 def test_logger(self):
     logger = setup_logger("Tester")
     cl = logger.debug
     cl("Logger Test")
     self.assertTrue(True)
     pass
Ejemplo n.º 2
0
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Copyright (c) 2013, Revolution Analytics Singapore.
# All rights reserved.

import json
from WebCrawler.util.logger import setup_logger

logger = setup_logger("Configuration")
ld = logger.debug
le = logger.error


def load_websites(filename):
    """ load the global website configuration.
    """
    configs = None
    with open(filename, 'r') as f:
        configs = json.load(f)
    if not configs:
        le("Error in loading global configuration.")
    if "websites" not in configs.keys():
        le("Error in loading global configuration.")
        return None
    return configs["websites"]
    pass

def load_pages(filename):
    """ load the page configuration for website.
    """