Last active
August 29, 2015 13:57
-
-
Save jefperito/9519551 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Importador(object): | |
def __init__(self, arquivo): | |
# ... | |
def obtemRegistros(self): | |
registros = [] | |
for linha in self.linhas: | |
registro = Registro() | |
registro.tipo = self.obtemTipo() | |
# Outras info | |
registros.append(registro) | |
return registros | |
# outros metodos | |
def obtemTipo(self): | |
raise NotImplementedError('obtemTipo precisa ser implementado.') | |
class Yahoo(Importador): | |
def obtemTipo(self): | |
return 'Yahoo' | |
class Google(Importador): | |
def obtemTipo(self): | |
return 'Google' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment