summaryrefslogtreecommitdiff
path: root/tabbed/helpers.py
blob: 0f5232ce6153930b1c8ae96da8e777906fdf9d0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- 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