Update of /cvsroot/mailman/mailman/Mailman/Logging
In directory usw-pr-cvs1:/tmp/cvs-serv7408
Modified Files:
Logger.py
Log Message:
Untabification.
Index: Logger.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Logging/Logger.py,v
retrieving revision 2.1
retrieving revision 2.2
diff -C2 -r2.1 -r2.2
*** Logger.py 2001/06/02 05:14:47 2.1
--- Logger.py 2001/06/02 05:18:07 2.2
***************
*** 24,30 ****
class Logger:
def __init__(self, category, nofail=1, immediate=0):
! """Nofail says to fallback to sys.__stderr__ if write fails to
category file - a complaint message is emitted, but no exception is
raised. Set nofail=0 if you want to handle the error in your code,
--- 24,31 ----
+
class Logger:
def __init__(self, category, nofail=1, immediate=0):
! """nofail says to fallback to sys.__stderr__ if write fails to
category file - a complaint message is emitted, but no exception is
raised. Set nofail=0 if you want to handle the error in your code,
***************
*** 32,39 ****
immediate=1 says to create the log file on instantiation.
! Otherwise, the file is created only when there are writes pending."""
!
self.__filename = os.path.join(mm_cfg.LOG_DIR, category)
! self.__fp = None
self.__nofail = nofail
if immediate:
--- 33,40 ----
immediate=1 says to create the log file on instantiation.
! Otherwise, the file is created only when there are writes pending.
! """
self.__filename = os.path.join(mm_cfg.LOG_DIR, category)
! self.__fp = None
self.__nofail = nofail
if immediate:
***************
*** 47,60 ****
def __get_f(self):
! if self.__fp:
! return self.__fp
! else:
! try:
! ou = os.umask(002)
! try:
! f = self.__fp = open(self.__filename, 'a+', 1)
! finally:
! os.umask(ou)
! except IOError, e:
if self.__nofail:
_logexc(self, e)
--- 48,61 ----
def __get_f(self):
! if self.__fp:
! return self.__fp
! else:
! try:
! ou = os.umask(002)
! try:
! f = self.__fp = open(self.__filename, 'a+', 1)
! finally:
! os.umask(ou)
! except IOError, e:
if self.__nofail:
_logexc(self, e)
***************
*** 65,86 ****
def flush(self):
! f = self.__get_f()
! if hasattr(f, 'flush'):
! f.flush()
def write(self, msg):
! f = self.__get_f()
! try:
! f.write(msg)
! except IOError, msg:
_logexc(self, msg)
def writelines(self, lines):
! for l in lines:
! self.write(l)
def close(self):
! if not self.__fp:
! return
! self.__get_f().close()
self.__fp = None
--- 66,87 ----
def flush(self):
! f = self.__get_f()
! if hasattr(f, 'flush'):
! f.flush()
def write(self, msg):
! f = self.__get_f()
! try:
! f.write(msg)
! except IOError, msg:
_logexc(self, msg)
def writelines(self, lines):
! for l in lines:
! self.write(l)
def close(self):
! if not self.__fp:
! return
! self.__get_f().close()
self.__fp = None
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins