Commit 446da7b2 authored by W. Trevor King's avatar W. Trevor King
Browse files

Don't use u'...' syntax in igor.igorpy.

This breaks Python 2 Unicode handling, but it allows igorpy to be used
in its raw form by Python 3.
parent e82fdde8
...@@ -118,7 +118,7 @@ class Wave(IgorObject): ...@@ -118,7 +118,7 @@ class Wave(IgorObject):
def __array__(self): def __array__(self):
return self.data return self.data
__repr__ = __str__ = lambda s: u"<igor.Wave %s>" % s.format() __repr__ = __str__ = lambda s: "<igor.Wave %s>" % s.format()
class Recreation(IgorObject): class Recreation(IgorObject):
""" """
...@@ -187,7 +187,7 @@ class Folder(IgorObject): ...@@ -187,7 +187,7 @@ class Folder(IgorObject):
raise KeyError("Folder %s does not exist"%key) raise KeyError("Folder %s does not exist"%key)
def __str__(self): def __str__(self):
return u"<igor.Folder %s>" % "/".join(self.path) return "<igor.Folder %s>" % "/".join(self.path)
__repr__ = __str__ __repr__ = __str__
...@@ -207,9 +207,9 @@ class Folder(IgorObject): ...@@ -207,9 +207,9 @@ class Folder(IgorObject):
pass pass
def format(self, indent=0): def format(self, indent=0):
parent = u" "*indent+self.name parent = " "*indent+self.name
children = [r.format(indent=indent+2) for r in self.children] children = [r.format(indent=indent+2) for r in self.children]
return u"\n".join([parent]+children) return "\n".join([parent]+children)
def loads(s, **kwargs): def loads(s, **kwargs):
...@@ -231,7 +231,7 @@ def load(filename, **kwargs): ...@@ -231,7 +231,7 @@ def load(filename, **kwargs):
def _convert(packed_experiment, ignore_unknown=True): def _convert(packed_experiment, ignore_unknown=True):
records, filesystem = packed_experiment records, filesystem = packed_experiment
stack = [Folder(path=[u'root'])] stack = [Folder(path=['root'])]
for record in records: for record in records:
if isinstance(record, _UnknownRecord): if isinstance(record, _UnknownRecord):
if ignore_unknown: if ignore_unknown:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment