Skip to content

Instantly share code, notes, and snippets.

@jefperito
Last active August 29, 2015 13:57
Show Gist options
  • Save jefperito/9519551 to your computer and use it in GitHub Desktop.
Save jefperito/9519551 to your computer and use it in GitHub Desktop.
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