You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by "Adam R. B. Jack" <aj...@trysybase.com> on 2004/04/12 19:37:01 UTC

Need help with : pydoc & pychecker

PyChecker (http://pychecker.sourceforge.net ) ought save us from some
runtime errors. It is like lint.

Also, to promote team development successes we need to share information
(especially on classes and such).  I've been thinking about Javadoc-style
docs and tried getting a site like that out of pydoc, but failed. I
incorrectly assumed how it ought work, and as such missed the point.

[I think that is common with Python, it just isn't Java (however similar
much of it looks.) I just need to keep a fresh/open mind with this stuff.]

Anyway, I am having problems but I don't want to give up. I think this is
important. I think we need both pychecker (or similar) and pydoc working to
help Gump fly as a python project. If anybody can help (through looking at
docs/tinkering along with me, or from experience) please do.

PYCHECKER:

I can manually run pychecker (once installed) on our code. I can't (however)
seem to pass it 'gump' and have it read all modules/packages below gump.
Maybe it is just not used that way, but maybe that is 'cos we have problems
with __all__ in our packages. [Run pydoc to see the __all__ issue.]

I am trying to create (another) commitCheck.py to run before doing a commit.
I want that to run pychecker. I could fork the thing (and am about to try)
but I tried using the import solution. Python is quite wacky at times, and I
think (from best I can tell from docs/code) that the import runs the code, I
don't need to call some check() method.  [This is a shame, 'cos I don't
think I can test for problems or not. I've tried this, but it doesn't seem
to work. Any thoughts?

    try:
        # :TODO: PyChecker
        check=''
        for m in ['gump','gump/document','gump/model']:
            if check: check += ' '
            mPath=os.path.join(absGumpPython,m)
            check += str(mPath)
        print "Python Checker : [" + check + "]"
        os.environ['PYCHECKER'] = check
        import pychecker.checker
    except:
        print 'Failed to PyChecker code...'
        pass


PYDOC:

I've not managed to get a site built by pydoc, it seems to like to run
interactively or as it's own WWW server. This is cool. Go into the
gump/python directory, set PYTHONPATH=`pwd`, then run:

    python C:\Python23\lib\pydoc.py -p 1234 gump

and browsed:

    http://localhost:1234/

I wonder if we ought run an instance of this on one of the Apache servers
and point it at a version of Gump that we checkout from CVS each night.

BTW: If you do both you'll see a problem we seem to have with our source
code, that is stopping it from working correctly/fully. Help appreciated.

regards,

Adam
--
Experience the Unwired Enterprise:
http://www.sybase.com/unwiredenterprise
Try Sybase: http://www.try.sybase.com


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Need help with : pydoc & pychecker

Posted by Michael Davey <Mi...@coderage.org>.
Adam R. B. Jack wrote:

>
>Would you mind submitting this request to JIRA?
>
logged as GUMP-63:

http://nagoya.apache.org/jira/browse/GUMP-63

-- 
Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Need help with : pydoc & pychecker

Posted by "Adam R. B. Jack" <aj...@trysybase.com>.
> >Ought we just expect developers to do
> >the above?
> >
> Nope.  That would be like expecting developers to run "ant javadoc" for
> themselves rather than pointing them to a website hosting the javadoc.
> It is just a good form of communication - provide documentation up front
> for all to see.  Perhaps another proxypass config from gump.apache.org?

Would you mind submitting this request to JIRA? Then folks like
Leo/Scott/others could consider it. What would be cool would be to automate
checking out the Gump code into the place where pydoc looks, so we are
always fresh.

BTW: I don't know the security concerns associated with pydoc...

regards

Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Need help with : pydoc & pychecker

Posted by Michael Davey <Mi...@coderage.org>.
Adam R. B. Jack wrote:

>>PYDOC:
>>    
>>
[snip suggestion for pydoc server on Apache]

>Any thoughts on this? Is it overkill?
>
No, it is not overkill.

>Ought we just expect developers to do
>the above?
>
Nope.  That would be like expecting developers to run "ant javadoc" for 
themselves rather than pointing them to a website hosting the javadoc.  
It is just a good form of communication - provide documentation up front 
for all to see.  Perhaps another proxypass config from gump.apache.org?

-- 
Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: Need help with : pydoc & pychecker

Posted by "Adam R. B. Jack" <aj...@trysybase.com>.
> PYDOC:
>
> I've not managed to get a site built by pydoc, it seems to like to run
> interactively or as it's own WWW server. This is cool. Go into the
> gump/python directory, set PYTHONPATH=`pwd`, then run:
>
>     python C:\Python23\lib\pydoc.py -p 1234 gump
>
> and browsed:

Yahoo, we can run it! This is really useful output. Incentive to document
classes better.

I change gump/__init__.py to not include gump.config (to set logging to
default) and move all that initialization code into a gumpinit() method. It
is a bit of a pain to have to explicitly call this, but I think it worth the
fact that we can now run pydoc!

Anybody who is tinkering with Gumpy ought run this!

>     http://localhost:1234/
>
> I wonder if we ought run an instance of this on one of the Apache servers
> and point it at a version of Gump that we checkout from CVS each night.

Any thoughts on this? Is it overkill? Ought we just expect developers to do
the above? [I could see us providing the object documentation (online) as
helping us focus on improving it & attracting new devs.]

regards

Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org