Skip to content

Fix a few more Python3 errors #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Bumped version; Fixes issue in fields.py to allow for unicode strings…
… to be processed properly.
  • Loading branch information
zgypa committed Oct 10, 2018
commit 146fee25c5e9cc6423ad24b340a42e083a58011c
11 changes: 11 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# file GENERATED by distutils, do NOT edit
setup.py
PyFePA/__init__.py
PyFePA/fepa.py
PyFePA/fields.py
PyFePA/sdi.py
PyFePA/serializer.py
PyFePA/siamm.py
PyFePA/utils.py
PyFePA/xsd/fatturapa_v1.2.xsd
PyFePA/xsd/xmldsig-core-schema.xsd
10 changes: 5 additions & 5 deletions PyFePA/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ def validate(self, value):
elif not (self.minlen and self.maxlen ):
valid = True
elif self.minlen and not self.maxlen :
valid = self.minlen <= len(str(value))
valid = self.minlen <= len(unicode(value))
elif self.maxlen and not self.minlen:
valid = len(str(value)) <= self.maxlen
valid = len(unicode(value)) <= self.maxlen
else:
valid = self.minlen <= len(str(value)) <= self.maxlen
valid = self.minlen <= len(unicode(value)) <= self.maxlen

if valid:
return value if isinstance(value,str) else str(value)
return value if isinstance(value,unicode) else unicode(value)
else:
return valid

Expand All @@ -77,7 +77,7 @@ def __init__(self, **kwargs):

@classmethod
def tostring(cls,value):
return str(value)
return unicode(value)


class FieldCostant(FieldType):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
setup(
name = 'PyFePA',
packages = ['PyFePA'],
version = '1.2.1b',
version = '1.2.2b',
description = 'Python object of italian FatturaPA, serialize, deserialize and verify',
author = 'Luigi Di Naro',
author_email = 'Luigi.DiNaro@ktec.it',
Expand Down