Skip to content

Commit 950f186

Browse files
author
Sergio Garcia
committed
Atualizado pacote e requerimentos para Python 2.7.
1 parent 266ca92 commit 950f186

File tree

7 files changed

+15
-6
lines changed

7 files changed

+15
-6
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
language: python
22
python:
33
- '3.4'
4+
- '2.7'
45
install:
6+
- pip install six
57
- pip install pytest
68
- pip install coveralls
79
script:

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
[![Coverage Status](https://coveralls.io/repos/sped-br/python-sped/badge.svg)](https://coveralls.io/r/sped-br/python-sped)
55
[![Stories in Ready](https://badge.waffle.io/sped-br/python-sped.svg?label=ready&title=Ready)](http://waffle.io/sped-br/python-sped)
66

7-
Biblioteca para geração dos arquivos do Sistema Público de Escrituração Digital (SPED) para Python 3.4+.
7+
Biblioteca para geração dos arquivos do Sistema Público de Escrituração Digital (SPED) para Python.
88

99
> This software is coded and documented in portuguese only as it is intended to be used to generate the necessary files for the brazilian government regarding to digital bookkeeping.
1010
1111
## Requisitos
1212

13-
* python 3.4+
13+
* python
14+
* six
1415

1516
## Como instalar
1617

@@ -24,7 +25,7 @@ Não é objetivo deste projeto, remover a necessidade do programador em conhecer
2425

2526
## Compatibilidade do Projeto
2627

27-
O projeto inicialmente suportará apenas Python 3.4+, devido a minha necessidade de integra-lo ao meu sistema ERP. Em breve e se houver tempo e necessidade, poderei auxiliar a portabilidade para Python 2.7 para facilitar seu uso no OpenERP. Pull requests que adicionem compatibilidade são bem vindos.
28+
O projeto inicialmente suportará apenas Python 3.4+, o suporte para Python 2.7 está em desenvolvimento. Pull requests que melhorem a compatibilidade são bem vindos.
2829

2930
Outras linguagens de programação poderão ter versões especificas conforme minha disponibilidade de tempo.
3031

requeriments.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
coveralls==0.5
2+
six==1.9.0
23
pytest==2.6.4

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ description-file = README.md
55
addopts = sped --doctest-modules
66

77
[bdist_wheel]
8-
python-tag = py34
8+
universal = 1

setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ def run_tests(self):
4444
'Development Status :: 3 - Alpha',
4545
'Intended Audience :: Developers',
4646
'License :: OSI Approved :: MIT License',
47+
'Programming Language :: Python :: 2',
48+
'Programming Language :: Python :: 2.7',
4749
'Programming Language :: Python :: 3',
4850
'Programming Language :: Python :: 3.4',
4951
],
5052
keywords='sped fiscal contábil contabilidade receita federal',
53+
install_requires=['six'],
5154
tests_require=['pytest'],
5255
cmdclass={'test': PyTest},
5356
)

sped/campos.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from datetime import datetime
88
from decimal import Decimal
99

10+
from six import string_types
11+
1012
from .erros import CampoFixoError
1113
from .erros import CampoObrigatorioError
1214
from .erros import FormatoInvalidoError
@@ -57,7 +59,7 @@ def set(self, registro, valor):
5759
return
5860
if valor and not self.__class__.validar(valor):
5961
raise FormatoInvalidoError(registro, self.nome)
60-
if not isinstance(valor, basestring):
62+
if not isinstance(valor, string_types):
6163
raise FormatoInvalidoError(registro, self.nome)
6264
registro.valores[self._indice] = valor or ''
6365

sped/registros.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __getattr__(self, name):
104104
return campo.get(self)
105105

106106
def __setattr__(self, name, value):
107-
if name.startswith('_'):
107+
if name.startswith(u'_'):
108108
super(Registro, self).__setattr__(name, value)
109109
return
110110
campo = ([c for c in self.campos if c.nome == name] or [None])[0]

0 commit comments

Comments
 (0)