cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/3] git commit: printer: fix color printer rules to accommodate json output
Date Fri, 31 Oct 2014 09:34:13 GMT
Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master b20b59c16 -> 088001e7a


printer: fix color printer rules to accommodate json output

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/fd327460
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/fd327460
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/fd327460

Branch: refs/heads/master
Commit: fd327460343a375f9ddfc6e04d8aab5c107caabc
Parents: b20b59c
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Fri Oct 31 14:58:44 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Fri Oct 31 14:58:44 2014 +0530

----------------------------------------------------------------------
 cloudmonkey/printer.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/fd327460/cloudmonkey/printer.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/printer.py b/cloudmonkey/printer.py
index e548d2c..29d5903 100644
--- a/cloudmonkey/printer.py
+++ b/cloudmonkey/printer.py
@@ -50,12 +50,12 @@ def get_colorscheme():
 
 
 class MonkeyLexer(RegexLexer):
-    keywords = ['[a-z]*id', '^[a-z A-Z]*:']
+    keywords = ['[a-z]*id', '"[a-z]*id"', '^[a-z A-Z]*:']
     attributes = ['[Tt]rue', '[Ff]alse']
     params = ['[a-z]*[Nn]ame', 'type', '[Ss]tate']
 
     uuid_rgx = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
-    date_rgx = r'[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]{8}-[0-9]{4}'
+    date_rgx = r'[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9:]{8}[0-9+]{5}'
 
     def makelistre(lis):
         return r'(' + r'|'.join(lis) + r')'
@@ -64,7 +64,9 @@ class MonkeyLexer(RegexLexer):
         'root': [
             (r' ', Whitespace),
             (date_rgx, Number),
+            (r'"' + date_rgx + r'"', Number),
             (uuid_rgx, Literal),
+            (r'"' + uuid_rgx + r'"', Literal),
             (r'(?:\b\d+\b(?:-\b\d+|%)?)', Number),
             (r'^[-=]*\n', Operator.Word),
             (r'Error', Error),


Mime
View raw message