summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobyrosen@gmail.com <tobyrosen@gmail.com@8ebc04a2-01ca-80aa-3703-73c302266661>2011-08-08 14:11:50 +0000
committertobyrosen@gmail.com <tobyrosen@gmail.com@8ebc04a2-01ca-80aa-3703-73c302266661>2011-08-08 14:11:50 +0000
commita127e16ca8f1378fe5151d61d7a13e85c190cd9a (patch)
tree6a07d09d9e37a05972541517404b6e38908c4ddf
parent18b63cc9ef22f62662c4a59441ec1d9a656c63ab (diff)
fixed mac color issue
git-svn-id: http://pyp.googlecode.com/svn/trunk@101 8ebc04a2-01ca-80aa-3703-73c302266661
-rw-r--r--pyp16
1 files changed, 8 insertions, 8 deletions
diff --git a/pyp b/pyp
index 3dea4b9..9e9b103 100644
--- a/pyp
+++ b/pyp
@@ -544,7 +544,7 @@ class Pyp(object):
nf = 0
output = ''
if power_pipe:
- n_index = Colors.MAGENTA + '[%s]' % (self.n - 1) + Colors.GREEN
+ n_index = Colors.MAGENTA + '[%s]' % (self.n - 1) + Colors.OFF
else:
n_index = ''
#DEALS WITH DIFFERENT TYPES OF INPUTS
@@ -553,23 +553,23 @@ class Pyp(object):
for field in input:
if not nf == len(input):
if type(field) in [str, PypStr]:
- COLOR = Colors.GREEN
+ COLOR = Colors.OFF
else:
COLOR = Colors.MAGENTA
- output = str(output) + Colors.BOLD + Colors.BLUE + "[%s]" % nf + Colors.OFF + COLOR + str(field) + Colors.GREEN
+ output = str(output) + Colors.BOLD + Colors.BLUE + "[%s]" % nf + Colors.OFF + COLOR + str(field) + Colors.OFF
nf = nf + 1
- return n_index + Colors.GREEN + Colors.BOLD + '[' + Colors.OFF + output + Colors.GREEN + Colors.BOLD + ']' + Colors.OFF
+ return n_index + Colors.OFF + Colors.BOLD + '[' + Colors.OFF + output + Colors.OFF + Colors.BOLD + ']' + Colors.OFF
elif type(input) in [str, int, PypStr] :
- return n_index + str(input)
+ return n_index + str(input) + Colors.OFF
elif type(input) is dict: #deals with dictionaries
for field in sorted(input,key=lambda x : x.lower()):
- output = output + Colors.OFF + Colors.BOLD + Colors.BLUE + "'" + field + "'" + Colors.GREEN + ": " + Colors.OFF + Colors.GREEN + str(input[field]) + Colors.BOLD + Colors.GREEN + ',\n '
- return n_index + Colors.GREEN + Colors.BOLD + '{' + output.strip().strip(' ,') + Colors.GREEN + Colors.BOLD + '}' + Colors.OFF
+ output = output + Colors.OFF + Colors.BOLD + Colors.BLUE + "'" + field + "'" + Colors.OFF + ": " + Colors.OFF + Colors.OFF + str(input[field]) + Colors.BOLD + Colors.OFF + ',\n '
+ return n_index + Colors.OFF + Colors.BOLD + '{' + output.strip().strip(' ,') + Colors.GREEN + Colors.BOLD + '}' + Colors.OFF
else: #catches every else
return n_index + Colors.MAGENTA + str(input) + Colors.OFF
@@ -1367,7 +1367,7 @@ used to enclose any strings.
Here is a simple example for splitting the output of "ls" (unix file list) on '.':''' + Colors.YELLOW + '''
ls random_frame.jpg | pyp "p.split('.')"
- ==> [''' + Colors.BLUE + '[0]' + Colors.YELLOW + 'random_frame' + Colors.BLUE + '[1]' + Colors.YELLOW + 'jpg] ''' + Colors.GREEN + '''
+ ==> [''' + Colors.BLUE + '[0]' + Colors.YELLOW + 'random_frame' + Colors.BLUE + '[1]' + Colors.YELLOW + 'jpg] ''' + Colors.OFF + '''
The variable "p" represents each line piped in from "ls". Notice the output has
index numbers, so it's trivial to pick a particular field or range of fields,