Skip to content

Commit

Permalink
Dropped python 2.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kerfab committed Sep 21, 2017
1 parent 0d0e202 commit bb582db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
@@ -1,8 +1,5 @@
language: python
env:
- LANG=en_US.UTF-8
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
Expand Down
13 changes: 4 additions & 9 deletions jdic/jdic.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
The Jdic module provides the features required to manipulate
JSON objects through a consistent API.
Expand Down Expand Up @@ -40,8 +39,7 @@ def __str__(self):
return str(self._obj)

def __iter__(self):
for entry in self._obj.__iter__():
yield entry
yield from self._obj.__iter__()

def __getitem__(self, item):
return self._obj[item]
Expand Down Expand Up @@ -158,8 +156,7 @@ def __getitem__(self, item):
return self._obj[int(item)]

def __iter__(self):
for entry in self._obj.__iter__():
yield entry
yield from self._obj.__iter__()

def __len__(self):
return len(self._obj)
Expand Down Expand Up @@ -375,8 +372,7 @@ def browse(self, sort=False, depth=None, maxdepth=None, _start=True):
yield MatchResult(parent=self, parent_path=self._path, key=key,
value=val, path=path, depth=self._depth)
if isinstance(val, Jdic):
for entry in val.browse(sort=sort, depth=depth, maxdepth=maxdepth, _start=False):
yield entry
yield from val.browse(sort=sort, depth=depth, maxdepth=maxdepth, _start=False)

def checksum(self, algo='sha256'):
""" Returns an ASCII hexadecimal checksum representing the state of the object """
Expand Down Expand Up @@ -421,8 +417,7 @@ def diff(self, obj):

def enumerate(self, sort=False):
""" Yields a key, value pair with both Jdic Mappings and Sequences """
for entry in jdic_enumerate(self._obj, sort=sort):
yield entry
yield from jdic_enumerate(self._obj, sort=sort):

def find(self, value, limit=None, sort=False, depth=None, maxdepth=None):
""" Finds a value within the Jdic object, the search is recursive """
Expand Down
3 changes: 1 addition & 2 deletions tests/tests_mongo.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
from jdic import settings, jdic, JdicSequence
from copy import copy, deepcopy

settings.json_path_driver = "mongo"

def new(asdict = False, schema = None, serializer = None, driver = None):
o = {
1 : u'éàè',
1 : 'éàè',
2 : Exception('TestSerialize', 'Just a test'),
3 : { None : 0 },
None : { "None" },
Expand Down

0 comments on commit bb582db

Please sign in to comment.