On Sun, Apr 1, 2012 at 9:28 PM, Peter Bittner <[email protected]> wrote:
> Third try to ask almost the same question:
>
>>> 1.) What happens on the import line in library/pyjamas/logging? Does
>>> it import the Pyjamas logging module ported by Kees?
>>>
>>> # blatantly copy everything from CPython's logging
>>> from logging import *
>>>
>>> 2.) Can you compare the two attempts of implementation?
>>> (/library/pyjamas/logging/__init__.py, and
>>> pyjs/src/pyjs/lib/logging/__init__.py)
>>> Is the one in the library path a possible replacement of the one in 
>>> pyjs/lib?
>
> As Pyjamas' logging module in pyjs/src/pyjs/lib/logging/ seems to be a
> (more or less) simple copy of Python's (version 2.5?) logging module:
> Is copying the code verbatim necessary? Can't we do a "from logging
> import *" instead?
>
>>  it shouldn't be there.  at all.  and needs removing, immediately.
>> anything in library/pyjamas/ which has the same names as standard
>> http://python.org libraries risks OVERRIDING the standard
>> http://python.org libraries.
>
> I can try to delete the ./library/pyjamas/logging module alltogether,

 or whatever - move them, delete them, i don't care as long as the
clash with standard http://python.org is resolved.

> and come up with logging _handlers_ only (e.g. AlertHandler,
> AppendHandler, ConsoleHandler) that can be used with the logging
> module in pyjs/src/pyjs/lib/logging. If so, where should I put them?

 absolutely anywhere.

> If I understand correctly, pyjd uses the Python logging module.
> Therefore, the Pyjamas logging handlers should go somewhere in
> ./library/pyjamas/, correct?

 that appears to be incorrect, but... hang on, let me think it through.

 anything that provides the same functionality as a standard
http://python.org module MUST go in pyjs/src/pyjs/lib, MUST have the
exact same import layout, MUST have the exact same functionality, MUST
have the same function names, MUST have the same class names, MUST
have the same constants etc. etc.  the only thing that any such module
can be is a SUBSET of the equivalent http://python.org functionality.

 anything that does NOT provide the same functionality MUST NOT have
the same name as a standard http://python.org module.

 so... how is this functionality that is in library/pyjamas/logging
get imported?

 it MUST NOT be imported as "import logging".

 if it is "from pyjamas import logging" or "from pyjamas.logging
import ConsoleHandler" then it is absolutely fine.

l.

Reply via email to