Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: ppapi/generators/idl_log.py

Issue 98343005: Pepper: More IDL generator cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for json_schema_compiler Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/generators/idl_c_proto.py ('k') | ppapi/generators/idl_namespace.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/generators/idl_log.py
diff --git a/ppapi/generators/idl_log.py b/ppapi/generators/idl_log.py
index b7f2151a4d9489a14df9f18598279bb761dd2ff9..f5b103e751c4a08ce1575d782155c4ba10ac6e74 100644
--- a/ppapi/generators/idl_log.py
+++ b/ppapi/generators/idl_log.py
@@ -4,54 +4,49 @@
""" Error and information logging for IDL """
-#
-# IDL Log
-#
-# And IDLLog object provides a mechanism for capturing logging output
-# and/or sending out via a file handle (usually stdout or stderr).
-#
import sys
class IDLLog(object):
+ """Captures and routes logging output.
+
+ Caputres logging output and/or sends out via a file handle, typically
+ stdout or stderr.
+ """
def __init__(self, name, out):
if name:
- self.name = '%s : ' % name
+ self._name = '%s : ' % name
else:
- self.name = ''
+ self._name = ''
- self.out = out
- self.capture = False
- self.console = True
- self.log = []
+ self._out = out
+ self._capture = False
+ self._console = True
+ self._log = []
def Log(self, msg):
- line = "%s\n" % (msg)
- if self.console: self.out.write(line)
- if self.capture:
- self.log.append(msg)
-
- def LogTag(self, msg):
- line = "%s%s\n" % (self.name, msg)
- if self.console: self.out.write(line)
- if self.capture:
- self.log.append(msg)
+ if self._console:
+ line = "%s\n" % (msg)
+ self._out.write(line)
+ if self._capture:
+ self._log.append(msg)
def LogLine(self, filename, lineno, pos, msg):
- line = "%s(%d) : %s%s\n" % (filename, lineno, self.name, msg)
- if self.console: self.out.write(line)
- if self.capture: self.log.append(msg)
+ if self._console:
+ line = "%s(%d) : %s%s\n" % (filename, lineno, self._name, msg)
+ self._out.write(line)
+ if self._capture:
+ self._log.append(msg)
- def SetConsole(self, enable, out = None):
- self.console = enable
- if out: self.out = out
+ def SetConsole(self, enable):
+ self._console = enable
def SetCapture(self, enable):
- self.capture = enable
+ self._capture = enable
def DrainLog(self):
- out = self.log
- self.log = []
+ out = self._log
+ self._log = []
return out
ErrOut = IDLLog('Error', sys.stderr)
« no previous file with comments | « ppapi/generators/idl_c_proto.py ('k') | ppapi/generators/idl_namespace.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698