Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/pyexcel_io/_compact.py : 50%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2 pyexcel_io._compact
3 ~~~~~~~~~~~~~~~~~~~
5 Compatibles
7 :copyright: (c) 2014-2020 by Onni Software Ltd.
8 :license: New BSD License, see LICENSE for more details
9"""
10import sys
11import logging
12from io import BytesIO, StringIO # noqa: F401
13from collections import OrderedDict # noqa: F401
15try:
16 from logging import NullHandler
17except ImportError:
19 class NullHandler(logging.Handler):
20 def emit(self, record):
21 pass
24text_type = str
25irange = range
26PY2 = sys.version[0] == 2
29def isstream(instance):
30 """ check if a instance is a stream """
31 try:
32 import mmap
34 i_am_not_mmap_obj = not isinstance(instance, mmap.mmap)
35 except ImportError:
36 # Python 2.6 or Google App Engine
37 i_am_not_mmap_obj = True
39 return hasattr(instance, "read") and i_am_not_mmap_obj
42def is_string(atype):
43 """find out if a type is str or not"""
44 return atype == str