view tests/printrepr.py @ 10045:d1f9640e9a67

color: Do not pass --color, --no-color parameters to wrapped function Passing the --color and --no-color parameter to the wrapped function can cause a invalid argument exception if the wrapped function doesn't accepts a **opts dict.
author David Soria Parra <dsp@php.net>
date Fri, 11 Dec 2009 11:04:31 +0100
parents 0eb8c4df61bd
children 25e572394f5c
line wrap: on
line source

#!/usr/bin/env python
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.

"""prints repr(sys.stdin) but preserves newlines in input"""

import sys
print repr(sys.stdin.read())[1:-1].replace('\\n', '\n'),