Exemplo n.º 1
0
    def translate(self, foreign):
        final_url = foreign.get('final_url')

        if final_url:
            return final_url
        else:
            response = self.environment.json( util.translate_endpoint( foreign['original_url'], foreign['foreign_url'] ) )
            return util.translated_from(response)
Exemplo n.º 2
0
def translate(foreign):
    final_url = foreign.get('final_url')

    if final_url:
        return final_url
    else:
        endpoint = util.translate_endpoint( foreign['original_url'], foreign['foreign_url'])
        response = environment.json_from_url(endpoint)

        return util.translated_from(response)
Exemplo n.º 3
0
def translate(foreign):
    final_url = foreign.get('final_url')

    if final_url:
        return final_url
    else:
        endpoint = util.translate_endpoint(foreign['original_url'],
                                           foreign['foreign_url'])
        response = environment.json_from_url(endpoint)

        return util.translated_from(response)