All Samples(298) | Call(239) | Derive(0) | Import(59)
Print up to 'limit' stack trace entries from the traceback 'tb'. If 'limit' is omitted or None, all entries are printed. If 'file' is omitted or None, the output goes to sys.stderr; otherwise 'file' should be an open file or file-like object with a write() method.
def print_tb(tb, limit=None, file=None):
"""Print up to 'limit' stack trace entries from the traceback 'tb'.
If 'limit' is omitted or None, all entries are printed. If 'file'
is omitted or None, the output goes to sys.stderr; otherwise
'file' should be an open file or file-like object with a write()
method.
"""
if file is None:
file = sys.stderr
if limit is None:
if hasattr(sys, 'tracebacklimit'):
limit = sys.tracebacklimit
n = 0
while tb is not None and (limit is None or n < limit):
f = tb.tb_frame
lineno = tb.tb_lineno
co = f.f_code
filename = co.co_filename
name = co.co_name
_print(file,
' File "%s", line %d, in %s' % (filename, lineno, name))
linecache.checkcache(filename)
line = linecache.getline(filename, lineno, f.f_globals)
if line: _print(file, ' ' + line.strip())
tb = tb.tb_next
n = n+1
def exc_info2log(self):
from traceback import print_tb;
exc_info = sys.exc_info();
if self.__flag:
fout = open(self.__logFile, 'at');
print >>fout, exc_info[0];
print >>fout, exc_info[1];
print_tb(exc_info[2], file=fout);
src/c/o/coyotemon-HEAD/releases/2005.04-coymon-vizn21-release/sandbox/oubiwann/dbapi/gadfly/gfserve.py coyotemon(Download)
info = "%s %s" % (sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
print "error in executing action: "+info
reply_exception(
ty = sys.exc_type
va = sys.exc_value
print "UNEXPECTED EXCEPTION ON MAINLOOP"
from traceback import print_tb
print_tb(tb)
print "exception:", ty, va
if not pending_connects:
exceptiondata = "%s\n%s" %(sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
self.reply_exception(ServerError,
"unexpected exception: "+exceptiondata, socket)
src/c/o/coyotemon-HEAD/releases/2005.02-coymon-vizn21-release/sandbox/oubiwann/dbapi/gadfly/gfserve.py coyotemon(Download)
info = "%s %s" % (sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
print "error in executing action: "+info
reply_exception(
ty = sys.exc_type
va = sys.exc_value
print "UNEXPECTED EXCEPTION ON MAINLOOP"
from traceback import print_tb
print_tb(tb)
print "exception:", ty, va
if not pending_connects:
exceptiondata = "%s\n%s" %(sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
self.reply_exception(ServerError,
"unexpected exception: "+exceptiondata, socket)
src/c/o/coyotemon-HEAD/releases/2004.11-coymon-dev/sandbox/oubiwann/dbapi/gadfly/gfserve.py coyotemon(Download)
info = "%s %s" % (sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
print "error in executing action: "+info
reply_exception(
ty = sys.exc_type
va = sys.exc_value
print "UNEXPECTED EXCEPTION ON MAINLOOP"
from traceback import print_tb
print_tb(tb)
print "exception:", ty, va
if not pending_connects:
exceptiondata = "%s\n%s" %(sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
self.reply_exception(ServerError,
"unexpected exception: "+exceptiondata, socket)
src/c/o/coyotemon-HEAD/trunk/sandbox/oubiwann/dbapi/gadfly/gfserve.py coyotemon(Download)
info = "%s %s" % (sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
print "error in executing action: "+info
reply_exception(
ty = sys.exc_type
va = sys.exc_value
print "UNEXPECTED EXCEPTION ON MAINLOOP"
from traceback import print_tb
print_tb(tb)
print "exception:", ty, va
if not pending_connects:
exceptiondata = "%s\n%s" %(sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
self.reply_exception(ServerError,
"unexpected exception: "+exceptiondata, socket)
src/c/o/coyotemon-HEAD/sandbox/oubiwann/dbapi/gadfly/gfserve.py coyotemon(Download)
info = "%s %s" % (sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
print "error in executing action: "+info
reply_exception(
ty = sys.exc_type
va = sys.exc_value
print "UNEXPECTED EXCEPTION ON MAINLOOP"
from traceback import print_tb
print_tb(tb)
print "exception:", ty, va
if not pending_connects:
exceptiondata = "%s\n%s" %(sys.exc_type,
str(sys.exc_value))
if verbose:
from traceback import print_tb
print_tb(tb)
self.reply_exception(ServerError,
"unexpected exception: "+exceptiondata, socket)
src/k/m/kmkey-HEAD/bundles/kmkey-08.01.02/KMKeyCore/trunk/utils/email_scan.py kmkey(Download)
from Acquisition import aq_acquire from DateTime.DateTime import DateTime from Products.CMFCore.utils import getToolByName from traceback import print_tb from Products.KMKeyCore.pattern import KMObjectCreationAdapter from Products.AdvancedQuery import In,Eq from email.Header import decode_header
create_file(container=added_object,ti=ti_file,portal_type='KMKey Document',Title=file_name,Description='',file_=file[1])
except Exception,n:
print " -- THERE WAS ERRORS WITH ONE DOCUMENT IN LAST MAIL %s (%s) -- "%(msg.get('Message-ID'),file_name)
print print_tb(sys.exc_info()[2])
# Save mail
get_transaction().commit()
if added:
if msg is not None:
txt = msg.get('Message-ID')
print " -- THERE WAS ERRORS WITH LAST MAIL %s -- "%txt
print print_tb(sys.exc_info()[2])
popserver.quit()
return 1
src/k/m/kmkey-HEAD/products/KMKeyCore/trunk/utils/email_scan.py kmkey(Download)
from Acquisition import aq_acquire from DateTime.DateTime import DateTime from Products.CMFCore.utils import getToolByName from traceback import print_tb from Products.KMKeyCore.pattern import KMObjectCreationAdapter from Products.KMKeyDefault.kmemail import NativeEmailParserAdapter from Products.AdvancedQuery import In,Eq
added_object.getContent().getDataModel()._commit()
except Exception,n:
print " -- THERE WAS ERRORS WITH ONE DOCUMENT IN LAST MAIL %s (%s) -- " % (msg.get('Message-ID'),file_name)
print print_tb(sys.exc_info()[2])
# save message
transaction.commit()
if msg is not None:
txt = msg.get('Message-ID')
print " -- THERE WAS ERRORS WITH LAST MAIL %s -- "%txt
print print_tb(sys.exc_info()[2])
popserver.quit()
return 1
src/k/m/kmkey-HEAD/bundles/kmkey-08.04.01/KMKeyCore/utils/email_scan.py kmkey(Download)
from Acquisition import aq_acquire from DateTime.DateTime import DateTime from Products.CMFCore.utils import getToolByName from traceback import print_tb from Products.KMKeyCore.pattern import KMObjectCreationAdapter from Products.KMKeyDefault.kmemail import NativeEmailParserAdapter from Products.AdvancedQuery import In,Eq
added_object.getContent().getDataModel()._commit()
except Exception,n:
print " -- THERE WAS ERRORS WITH ONE DOCUMENT IN LAST MAIL %s (%s) -- " % (msg.get('Message-ID'),file_name)
print print_tb(sys.exc_info()[2])
#save message
transaction.commit()
if msg is not None:
txt = msg.get('Message-ID')
print " -- THERE WAS ERRORS WITH LAST MAIL %s -- "%txt
print print_tb(sys.exc_info()[2])
popserver.quit()
return 1
src/k/m/kmkey-HEAD/bundles/kmkey-08.03.01/KMKeyCore/utils/email_scan.py kmkey(Download)
from Acquisition import aq_acquire from DateTime.DateTime import DateTime from Products.CMFCore.utils import getToolByName from traceback import print_tb from Products.KMKeyCore.pattern import KMObjectCreationAdapter from Products.KMKeyDefault.kmemail import NativeEmailParserAdapter from Products.AdvancedQuery import In,Eq
added_object.getContent().getDataModel()._commit()
except Exception,n:
print " -- THERE WAS ERRORS WITH ONE DOCUMENT IN LAST MAIL %s (%s) -- " % (msg.get('Message-ID'),file_name)
print print_tb(sys.exc_info()[2])
#save message
transaction.commit()
if msg is not None:
txt = msg.get('Message-ID')
print " -- THERE WAS ERRORS WITH LAST MAIL %s -- "%txt
print print_tb(sys.exc_info()[2])
popserver.quit()
return 1
1 | 2 | 3 | 4 | 5 Next