mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 06:46:16 +00:00
cf0c0bda70
File "piped.py", line 7
from __future__ import with_statement
SyntaxError: from __future__ imports must occur at the beginning of the file
27 lines
572 B
Python
27 lines
572 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import with_statement
|
|
|
|
import sys
|
|
import os
|
|
|
|
sys.path.insert(0, os.path.abspath('..'))
|
|
|
|
from clint import piped_in
|
|
from clint.textui import colored, indent, puts
|
|
|
|
|
|
if __name__ == '__main__':
|
|
in_data = piped_in()
|
|
|
|
with indent(4, quote='>>>'):
|
|
|
|
if in_data:
|
|
|
|
puts('Data was piped in! Here it is:')
|
|
with indent(5, quote=colored.red(' |')):
|
|
puts(in_data)
|
|
else:
|
|
puts(colored.red('Warning: ') + 'No data was piped in.')
|