/usr/lib/python2.7/dist-packages/setoptconf/util.py is in python-setoptconf 0.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import csv
import StringIO
import sys
__all__ = (
'csv_to_list',
'UnicodeMixin',
)
def csv_to_list(value):
if isinstance(value, basestring) and value:
reader = csv.reader(StringIO.StringIO(value))
parsed = next(reader)
return parsed
return []
# Adapted from http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/
# pylint: disable=R0903
class UnicodeMixin(object):
if sys.version_info >= (3, 0):
__str__ = lambda x: x.__unicode__()
else:
__str__ = lambda x: unicode(x).encode('utf-8')
|