Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #10 from sergio-garcia/master
Browse files Browse the repository at this point in the history
Melhorado cobertura pylint e pep8 (landscape).
  • Loading branch information
sergiogarciadev committed Nov 5, 2015
2 parents 99b1884 + 862894e commit dc59968
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
13 changes: 6 additions & 7 deletions sped/arquivos.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
from collections import OrderedDict
from io import StringIO

from .registros import RegistroIndefinido


class ArquivoDigital(object):
registros = None
blocos = None

def registro_abertura():
pass

def registro_fechamento():
pass
registro_abertura = RegistroIndefinido
registro_fechamento = RegistroIndefinido

def __init__(self):
self._registro_abertura = self.__class__.registro_abertura()
self._registro_fechamento = self.__class__.registro_fechamento()
self._registro_abertura = self.registro_abertura()
self._registro_fechamento = self.registro_fechamento()
self._blocos = OrderedDict()

def readfile(self, filename):
Expand Down
9 changes: 4 additions & 5 deletions sped/blocos.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-

from .registros import RegistroIndefinido


class Bloco(object):
def __init__(self):
self._registros = []

def registro_abertura():
pass

def registro_fechamento():
pass
registro_abertura = RegistroIndefinido
registro_fechamento = RegistroIndefinido

@property
def abertura(self):
Expand Down
4 changes: 2 additions & 2 deletions sped/fci/arquivos.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from ..arquivos import ArquivoDigital
from .. import arquivos
from . import registros
from . import blocos
from .blocos import Bloco0
Expand All @@ -10,7 +10,7 @@
from .registros import Registro9999


class ArquivoDigital(ArquivoDigital):
class ArquivoDigital(arquivos.ArquivoDigital):
registro_abertura = Registro0000
registro_fechamento = Registro9999
registros = registros
Expand Down
7 changes: 7 additions & 0 deletions sped/registros.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .campos import CampoRegex
from .erros import CampoError
from .erros import CampoInexistenteError
from .erros import RegistroError


class Registro(object):
Expand Down Expand Up @@ -114,3 +115,9 @@ def __setattr__(self, name, value):

def as_line(self):
return '|'.join(self._valores)


class RegistroIndefinido(Registro):
def __init__(self):
super(RegistroIndefinido, self).__init__()
raise RegistroError(self)

0 comments on commit dc59968

Please sign in to comment.