Merge extensions/python/xpcom changes from DOM_AGNOSTIC2_BRANCH into the

trunk.


git-svn-id: svn://10.0.0.236/trunk@187878 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2006-01-20 05:50:28 +00:00
parent 28dfbf4814
commit d394dc834d
56 changed files with 1710 additions and 958 deletions

View File

@@ -39,8 +39,7 @@
#
# Hardly worth its own source file!
import xpcom
from xpcom import components, nsError, _xpcom
from xpcom import components, nsError, _xpcom, logger
class Factory:
_com_interfaces_ = components.interfaces.nsIFactory
@@ -53,18 +52,17 @@ class Factory:
if outer is not None:
raise xpcom.ServerException(nsError.NS_ERROR_NO_AGGREGATION)
if xpcom.verbose:
print "Python Factory creating", self.klass.__name__
logger.debug("Python Factory creating %s", self.klass.__name__)
try:
return self.klass()
except:
# An exception here may not be obvious to the user - none
# of their code has been called yet. It can be handy on
# failure to tell the user what class failed!
_xpcom.LogWarning("Creation of class '%r' failed!\nException details follow\n" % (self.klass,))
logger.error("Creation of class '%r' failed!\nException details follow\n",
self.klass)
# The framework itself will also report the error.
raise
def lockServer(self, lock):
if xpcom.verbose:
print "Python Factory LockServer called -", lock
logger.debug("Python Factory LockServer called '%s'", lock)