Browse Source

Just use _transform instead of transform

main
Paul Bonser 13 years ago
committed by Lakshmi Vyasarajan
parent
commit
8a8bbbfe37
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      hyde/model.py
  2. +1
    -1
      hyde/tests/ext/test_tagger.py

+ 3
- 3
hyde/model.py View File

@@ -45,10 +45,10 @@ class Expando(object):
Sets the expando attribute after Sets the expando attribute after
transforming the value. transforming the value.
""" """
setattr(self, unicode(key).encode('utf-8'), self.transform(value))
setattr(self, unicode(key).encode('utf-8'), self._transform(value))




def transform(self, primitive):
def _transform(self, primitive):
""" """
Creates an expando object, a sequence of expando objects or just Creates an expando object, a sequence of expando objects or just
returns the primitive based on the primitive's type. returns the primitive based on the primitive's type.
@@ -57,7 +57,7 @@ class Expando(object):
return Expando(primitive) return Expando(primitive)
elif isinstance(primitive, (tuple, list, set, frozenset)): elif isinstance(primitive, (tuple, list, set, frozenset)):
seq = type(primitive) seq = type(primitive)
return seq(self.transform(attr) for attr in primitive)
return seq(self._transform(attr) for attr in primitive)
else: else:
return primitive return primitive




+ 1
- 1
hyde/tests/ext/test_tagger.py View File

@@ -34,7 +34,7 @@ class TestTagger(object):
assert self.s.tagger.tags assert self.s.tagger.tags
tags = self.s.tagger.tags.to_dict() tags = self.s.tagger.tags.to_dict()


assert len(tags) == 5
assert len(tags) == 6


for tag in ['sad', 'happy', 'angry', 'thoughts', 'events']: for tag in ['sad', 'happy', 'angry', 'thoughts', 'events']:
assert tag in tags assert tag in tags


Loading…
Cancel
Save