Exemplo n.º 1
0
    def __init__(self, partido, config={}):
        '''
        Carga el callejero
        '''
        # default config
        self.config = default_settings.copy()
        # custom config
        self.config.update(config)

        self.partido = partido

        try:
            self.cargarCallejero()
        except Exception, e:
            raise e
    def __init__(self, partido, config={}):
        '''
        Carga el callejero
        '''
        # default config
        self.config = default_settings.copy()
        # custom config
        self.config.update(config)

        self.partido = partido

        try:
            self.cargarCallejero()
        except Exception as e:
            raise e
    def __init__(self, partido, config={}):
        '''
        @param partido: Indica el partido del callejero
        @type partido: Partido
        '''
        # default config
        self.config = default_settings.copy()
        # custom config
        self.config.update(config)

        try:
            if partido is None:
                raise Exception('Debe indicar el partido.')
            self.c = Callejero(partido, config)
            self.partido = partido
        except Exception as e:
            raise e
Exemplo n.º 4
0
    def __init__(self, partido, config={}):
        '''
        @param partido: Indica el partido del callejero
        @type partido: Partido
        '''
        # default config
        self.config = default_settings.copy()
        # custom config
        self.config.update(config)

        try:
            if partido is None:
                raise Exception(u'Debe indicar el partido.')
            self.c = Callejero(partido, config)
            self.partido = partido
        except Exception, e:
            raise e
Exemplo n.º 5
0
    def __init__(self, include_list=[], exclude_list=[], config={}):
        # default config
        self.config = default_settings.copy()
        # custom config
        self.config.update(config)

        self.normalizadores = []
        try:
            partidos = self._getPartidosAMBA()
            partidos = [[1, u'caba', u'CABA', u'CABA Ciudad Autónoma de Buenos Aires']] + partidos

            for p in partidos:
                if p[1] not in exclude_list and (len(include_list) == 0 or p[1] in include_list):
                    partido = Partido(p[1], p[2], p[3], p[0])
                    nd = NormalizadorDirecciones(partido, self.config)
                    self.normalizadores.append(nd)

        except urllib2.HTTPError, e:
            e.detalle = u'Se produjo un error al intentar cargar la información de partidos.'
            raise e