Changeset 4403
- Timestamp:
- 10/06/08 12:37:01 (2 months ago)
- Files:
-
- graphvizplugin/0.11/graphviz/graphviz.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
graphvizplugin/0.11/graphviz/graphviz.py
r4402 r4403 523 523 arg = arg.encode(self.encoding, 'replace') 524 524 encoded_cmd.append(arg) 525 p = subprocess.Popen(encoded_cmd, 526 stdin=subprocess.PIPE, 527 stdout=subprocess.PIPE, 528 stderr=subprocess.PIPE) 525 p = subprocess.Popen(encoded_cmd, stdin=subprocess.PIPE, 526 stdout=subprocess.PIPE, stderr=subprocess.PIPE) 529 527 if input: 530 528 p.stdin.write(encoded_input) … … 532 530 out = p.stdout.read() 533 531 err = p.stderr.read() 534 if out or err: 535 return _("The command\n %(cmd)s\n" 536 "failed with the the following output:\n" 537 "%(out)s\n%(err)s", cmd=unicode(args), out=out, err=err) 532 reason = None 533 if p.wait() != 0: 534 reason = _("failed with the following output:") 535 if err or out: 536 reason = _("succeeded but emitted the following output:") 537 if reason: 538 return tag.p(tag.br(), _("The command:"), 539 tag.pre(repr(' '.join(encoded_cmd))), reason, 540 out and tag.pre(repr(out)), err and tag.pre(repr(err))) 538 541 539 542 def _error_div(self, msg): 540 543 """Display msg in an error box, using Trac style.""" 541 self.log.error(unicode(msg)) 544 if isinstance(msg, str): 545 msg = to_unicode(msg) 546 self.log.error(msg) 547 if isinstance(msg, unicode): 548 msg = tag.pre(escape(msg)) 542 549 return tag.div( 543 tag.strong("Graphviz macro processor has detected an error. " 544 "Please fix the problem before continuing."), 545 tag.pre(escape(to_unicode(msg))), 546 class_="system-message") 550 tag.strong(_("Graphviz macro processor has detected an error. " 551 "Please fix the problem before continuing.")), 552 msg, class_="system-message") 547 553 548 554 def _clean_cache(self):
