# Inspired from GENI error codes
import time
+import pprint
class ResultValue(dict):
def ok_value(self):
return self['value']
+ @staticmethod
+ def to_html (raw_dict):
+ return pprint.pformat (raw_dict).replace("\\n","<br/>")
+
# 67 <code>
# 68 <value>9</value>
# 69 <label>DBERROR</label>
#from manifold.manifoldquery import ManifoldQuery
from manifold.core.query import Query
+from manifold.core.result_value import ResultValue
from manifold.manifoldapi import ManifoldAPI
from manifold.manifoldresult import ManifoldException
result = manifold_api.forward(manifold_query.to_dict())
# XXX TEMP HACK
- import pprint
- htmlLines = []
- for textLine in pprint.pformat(result['description']).splitlines():
- htmlLines.append('<br/>%s' % textLine) # or something even nicer
- result['description'] = ('\n'.join(htmlLines)).replace(' ', ' ')
+ result [ 'description' ] = [ ResultValue.to_html (x) for x in result['description'] ]
json_answer=json.dumps(result)
# if in debug mode we save this so we can use offline mode later
-.ui-notify { width:350px; position:fixed; top: 67px; right:10px; z-index: 999;}
+.ui-notify { width:500px; position:fixed; top: 67px; right:10px; z-index: 999;}
/* .ui-notify { width:350px; position:fixed; top:10px; right:10px; } */
.ui-notify-message { padding:10px; margin-bottom:15px; -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px; /* jordan */ max-height: 600px; }
.ui-notify-message h1 { font-size:14px; margin:0; padding:0 }
.ui-notify-message:last-child { margin-bottom:0 }
.ui-notify-message-style { background:#000; background:rgba(0,0,0,0.8); -moz-box-shadow: 0 0 6px #000; -webkit-box-shadow: 0 0 6px #000; box-shadow: 0 0 6px #000; }
.ui-notify-message-style h1 { color:#fff; font-weight:bold }
-.ui-notify-message-style p { color:#fff; /* jordan */ max-height: 500px; overflow: auto; }
.ui-notify-close { color:#fff; text-decoration:underline }
.ui-notify-click { cursor:pointer }
.ui-notify-cross { margin-top:-4px; float:right; cursor:pointer; text-decoration:none; font-size:12px; font-weight:bold; text-shadow:0 1px 1px #fff; padding:2px }
.ui-notify-cross:hover { color:#ffffab }
.ui-notify-cross:active { position:relative; top:1px }
+/* jordan */
+.ui-notify-message-style p,.ui-notify-message-style pre {
+ font: normal 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
+ background-color:#111;
+ color:#eee;
+ max-height: 500px;
+ overflow: auto; }