On Fri, Mar 16, 2012 at 4:09 PM, Phil Charlesworth
<[email protected]> wrote:
> On 16/03/12 15:36, lkcl luke wrote:
>> On Fri, Mar 16, 2012 at 3:24 PM, Phil Charlesworth
>> <[email protected]>  wrote:
>>
>>> I have just tried running an app in pyjd (MSHTML on Windows 7) using
>>> what I think is the most recent commit b7cbeb10.....
>>>
>>> After import pyjd it fails on the next import statement. I tried the
>>> KitchenSink example instead. Exactly the same result. Here is the
>>> traceback from that:
>>>
>>
>>>      return getLoggerForHandler(AppendHandler(name), name, level, fmt)
>>>    File "C:\pyjamas\library\pyjamas\logging\handlers.py", line 26, in
>>> __init__
>>>      super(AppendHandler, self).__init__()
>>> TypeError: super() argument 1 must be type, not classobj
>>>
>>> I think this is a generic pyjd issue, not MSHTML. I don't want to be
>>> censorious but please, guys, get a working pyjd implementation and use
>>> it to test before you commit.
>>>
>>   hmmm.... hint, hint, peter.
>>
>>   hmmm... i'm using pyjd, and python 2.7 - i don't see this problem, phil.
>>
>>   you wouldn't happen to be using python 2.6 would you?
>>
>>   phil could you do a binary search, find which commit break things,
>> i'll revert stuff within say... 18 hours unless peter comes up with a
>> solution before then.
>>
>>   l.
> L, Yes I'm running Python 2.6.4 in this instance.
>
> The code which is causing the exception appears to have been added in
> commit e47769.... labelled "#Issue #701:added ID to AlertHandler div,
> made logging work on Pyjamas Desktop"
>
> I haven't yet tried reverting that  but will do so shortly.
> P.


notice the extra parameter "name".  anyway, try just replacing line 26 with:

     Handler.__init__(self)

that should do the trick.

l.


     logger = getLogger(name)
@@ -23,17 +25,17 @@ def __getLoggerForHandler(handler, name, level, fmt):

 def getAlertLogger(name=PYJS_NAME, level=DEBUG, fmt=BASIC_FORMAT):
     """A logger that shows any log message in a browser's alert popup dialog.""
-    return __getLoggerForHandler(AlertHandler(), name, level, fmt)
+    return getLoggerForHandler(AlertHandler(), name, level, fmt)

 def getAppendLogger(name=PYJS_NAME, level=DEBUG, fmt=BASIC_FORMAT):
     """A logger that appends text to the end of the HTML document body."""
-    return __getLoggerForHandler(AppendHandler(), name, level, fmt)
+    return getLoggerForHandler(AppendHandler(name), name, level, fmt)

 def getConsoleLogger(name=PYJS_NAME, level=DEBUG, fmt=BASIC_FORMAT):
     """A logger that uses Firebug's console.log() function."""
-    return __getLoggerForHandler(ConsoleHandler(), name, level, fmt)
+    return getLoggerForHandler(ConsoleHandler(), name, level, fmt)

 def getPrintLogger(name=PYJS_NAME, level=DEBUG, fmt=BASIC_FORMAT):
     """A logger that prints text to cerr, the default error output stream."""
-    return __getLoggerForHandler(StreamHandler(), name, level, fmt)
+    return getLoggerForHandler(StreamHandler(), name, level, fmt)

Reply via email to