return default
def getint(self, facet, default=None):
- """Return values as int/long type."""
+ """Return values as int type."""
if default is None:
default = 0
if self.origin.data.has_option(self.key, facet):
def set(self, facet, value):
"""Set values."""
if not self.has_facet(facet) or not self.get(facet) == value:
- if type(value) is long or repr(type(value)) == "<type 'unicode'>":
+ # TODO: remove this check after the switch to py3k
+ if repr(type(value)) == "<type 'unicode'>":
value = str(value)
- elif not type(value) is str:
+ if not type(value) is str:
value = repr(value)
self.origin.data.set(self.key, facet, value)
self.origin.modified = True
def append(self, facet, value):
- """Append value tp a list."""
- if type(value) is long:
- value = str(value)
- elif not type(value) is str:
+ """Append value to a list."""
+ if not type(value) is str:
value = repr(value)
newlist = self.getlist(facet)
newlist.append(value)