Skip to content

Commit

Permalink
Merge pull request #34 from thombashi/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
thombashi authored Jul 9, 2016
2 parents e99275c + 0e26c6e commit d48d4c6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ language: python

matrix:
include:
- python: 2.6
env: TOXENV=python2.6
- python: 2.7
env: TOXENV=python2.7
- python: 3.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DataProperty>=0.5.4
DataProperty>=0.7.0
jsonschema
pathvalidate>=0.4.2
path.py
Expand Down
2 changes: 1 addition & 1 deletion requirements/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest
pytest-cov
pytest
tox
XlsxWriter
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

setuptools.setup(
name="SimpleSQLite",
version="0.4.1",
version="0.4.2",
url="https://github.com/thombashi/SimpleSQLite",
bugtrack_url="https://github.com/thombashi/SimpleSQLite/issues",

Expand All @@ -48,7 +48,6 @@
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
Expand Down
4 changes: 3 additions & 1 deletion simplesqlite/loader/csv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ def __init__(self, source):
self.encoding = "utf-8"

def _to_data_matrix(self):
from dataproperty.type import FloatTypeChecker

return [
[
six.b(data).decode(self.encoding, "ignore")
if not dataproperty.is_float(data) else data
if not FloatTypeChecker(data).is_type() else data
for data in row
]
for row in self._csv_reader
Expand Down
7 changes: 6 additions & 1 deletion simplesqlite/sqlquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,16 @@ def to_value_str(cls, value):
>>> SqlQuery.to_value_str(None)
'NULL'
"""
from dataproperty.type import IntegerTypeChecker
from dataproperty.type import FloatTypeChecker

if value is None:
return "NULL"

if dataproperty.is_integer(value) or dataproperty.is_float(value):
if any([
IntegerTypeChecker(value).is_type(),
FloatTypeChecker(value).is_type()
]):
return str(value)

return "'%s'" % (value)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = python{2.6,2.7,3.3,3.4,3.5}
envlist = python{2.7,3.3,3.4,3.5}

[testenv]
deps =
Expand Down

0 comments on commit d48d4c6

Please sign in to comment.