from .. import curve as curve
from .. import experiment as experiment
+from ..util.util import Closing as Closing
from . import Driver as Driver
-class Closing (object):
- """Add .__enter__() .__exit__() for `with` statements.
-
- See :pep:`343`.
- """
- def __init__(self, obj):
- self.obj = obj
-
- def __enter__(self):
- return self.obj
-
- def __exit__(self, *exc_info):
- try:
- close_it = self.obj.close
- except AttributeError:
- pass
- else:
- close_it()
-
-
class JPKDriver (Driver):
"""Handle JPK ForceRobot's data format.
"""
headlines = []
for i in range(3):
headlines.append(f.readline())
- if headlines[0].startswith('# xPosition') \
- and headlines[1].startswith('# yPosition'):
- return True
+ if headlines[0].startswith('# xPosition') \
+ and headlines[1].startswith('# yPosition'):
+ return True
return False
def read(self, path, info=None):
--- /dev/null
+# Copyright
+
+
+class Closing (object):
+ """Add .__enter__() .__exit__() for `with` statements.
+
+ See :pep:`343`.
+ """
+ def __init__(self, obj):
+ self.obj = obj
+
+ def __enter__(self):
+ return self.obj
+
+ def __exit__(self, *exc_info):
+ try:
+ close_it = self.obj.close
+ except AttributeError:
+ pass
+ else:
+ close_it()