Files
tablib/tabbed/helpers.py
T
2010-07-13 13:42:44 -04:00

17 lines
367 B
Python

# -*- coding: utf-8 -*-
import sys
class Object(object):
"""Your attributes are belong to us."""
def __init__(self, **entries):
self.__dict__.update(entries)
def __getitem__(self, key):
return getattr(self, key)
def piped():
"""Returns piped input via stdin, else False"""
with sys.stdin as stdin:
return stdin.read() if not stdin.isatty() else None