Giter Club home page Giter Club logo

Comments (25)

twisted-trac avatar twisted-trac commented on May 10, 2024
exarkun's avatar @exarkun set owner to @mwhudson

I think docextractor has a plan to deal with this?

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
Automation's avatar Automation removed owner

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
glyph's avatar @glyph set status to closed

See #3139 for the remaining issue originally referred to. I believe the tools now do what we need, which is what this issue was really about.

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
spiv's avatar spiv commented
#!html
<pre>
Yeah, something like that sounds good.  

I'm assigning this to me... I'll try find some time to see
how easy/hard this is to do sometime in the next few days.

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
radix's avatar @radix commented
#!html
<pre>
Some of the links to API documentation from
http://twistedmatrix.com/documents/howto/pb-usage link
to pages that return 404.

For example, the section that reads "First we look at
the server. This defines an Echoer class (derived from
pb.Root), with a method called remote_echo() ..." links
to
http://twistedmatrix.com/documents/TwistedDocs/current/api/public/twisted.spread.pb.Root.html
which is a 404.

WebCVS says that the source doc for this looks like:

&lt;p>First we look at the server. This defines an Echoer
class (derived from
&lt;code class="API"
base="twisted.spread">pb.Root&lt;/code>), with a method called
&lt;code>remote_echo()&lt;/code>.

Don't know enough Twisted to say whether this is a bug
in the docs or in Lore or whether the docs are out of date.

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
spiv's avatar spiv commented
#!html
<pre>
The pb.Root link is broken because Root is actually defined
in twisted/spread/flavors.py, and is merely imported by
pb.py, so epydoc doesn't document it.  Unfortunately,
typical use is to import it from pb, so the HOWTO is
correct.  I'm not sure what the right fix for this is.

(This is probably a good reason to avoid nasty "promotion"
hacks where a class is defined in one module, but only
documented publicly as available from another.  Yes, I'm
thinking about flow here ;)

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
radix's avatar @radix commented
#!html
<pre>
so, you fixed the function thing already, right? then all
that's left is this "alias" thing.

Here are the ways I can think of fixing it.

 * Similar to my idea (that you didn't like) about the
function problem, we could have lore do a o =
namedObject(aliasname), then *actually* like to qual(o). I
know you don't like this.  :-)

 * Manually maintain a list of aliases for lore to look up
all api links in and replace.

 * Add more markup to allow the text of the link to be
different from the actual api link.

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
spiv's avatar spiv commented
#!html
<pre>
Yep, functions links are fixed (in CVS, anyway).

 * Yep, still don't like it, especially for such a minor bug.

 * Keeping an explicit list of aliases is pretty sucky, but
not as bad as your first suggestion :)

 * Yuck, I don't like the idea of markup for that.  What
about the print form -- epydoc can produce latex, so it
would be possible to make Lore link to API docs in print. 
But if the reader sees "pb.Root (page 434)" and then turns
to 434 and finds the documentation for the flavors module,
they'll be confused.

I think what the best solution would be is to mark the alias
in the *source*.  We should do this anyway; what if some
later maintainer deleted the "from flavors import Root" line
in pb.py because it wasn't needed by the code in pb.py
anymore?  There should be some sign in the source that a
variable is part of the public API of a module, even if it
is just an import from elsewhere.

If we did that, then we could fix epydoc, not Lore :)

This makes sense to me, because "pb.Root" is an API, and it
should appear in the API docs...

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
radix's avatar @radix commented
#!html
<pre>
Soo... something like, in pb.py

from twisted.python.epysupport import alias
alias('twisted.spread.flavors.Root', 'twisted.spread.pb.Root')

or maybe 
alias(flavors.Root, 'twisted.spread.pb.Root')

or just
alias(flavors.Root) with a hack to look in the caller's
namespace to see which module he's coming from ;)

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
itamarst's avatar @itamarst commented
#!html
<pre>
How's this going?

</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
radix's avatar @radix commented
#!html
<pre>
Itamar Shtull-Trauring &lt;itamar@...> added the comment:
> How's this going?

Still no progress, still haven't figured out how to continue.
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
spiv's avatar spiv commented
#!html
<pre>
So, we could just "fix" this with a nasty hack: just define a trivial subclass
in pb.py, e.g.:

    class Root(flavors.Root):
        pass

Actually, I guess the proposed alias function could do this... but working with
epydoc rather than hacking around it is probably a better idea.
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
moshez's avatar @moshez commented
#!html
<pre>
I thought of this.
It bothered me because of persistence constraints.
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
teratorn's avatar @teratorn commented
#!html
<pre>
At #38 this issue wins the prize for oldest unresolved bug ;)

If it's not gonna be fixed, can we just mark it done-cbb and move along?
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
radix's avatar @radix commented
#!html
<pre>
It's not done at all, and it stil has to be fixed. :-(
</pre>

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
mwhudson's avatar @mwhudson commented

Well, um, given that we control all the software involved, we could certainly come up with a plan. I don't really have one yet, though. It ought to be easy to recognise this "alias" function.

(wasn't there another bug almost exactly like this? ah, yes #10752)

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
exarkun's avatar @exarkun commented

FWIW, for some reason, I don't really like the alias() plan. We are already annotating the module with its public API, by way of all. Would it be much harder to detect that instead (assuming it is all static and non-magical, of course)? I'd be happy to do some work on this, if we can get everyone to agree it's the right thing.

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
mwhudson's avatar @mwhudson commented

twisted/spread/pb.py doesn't define __all__, although it could. I guess you could say I really don't like __all__ for some reason :)

It shouldn't be at all hard to detect, though.

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
jyknight's avatar @jyknight commented

(Reposting comment from #11370, which was a duplicate of this):

This is an issue for e.g. twisted.internet.stdio. It imports one of _win32stdio or _posixstdio. But those are implementation details. Docs should show up under the t.i.stdio module, somehow. (Let's leave aside that the StandardIO class doesn't currently have documentation: at least the class definition should show up.)

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
mwhudson's avatar @mwhudson commented

Well, I have the opposite of a fix at

http://starship.python.net/crew/mwh/apidocs-38notfix/twisted.manhole.ui.gtk2manhole.ManholeClient.html

(look where the pb.Referenceable link goes).

Sadly, I'm not sure this gets us any closer to a proper fix to the problem.

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
mwhudson's avatar @mwhudson commented

Is there anything even approaching a consensus on how to proceed here? I'm now at a point where I think there are no real technical obstacles. The most likely approach seems to be to be defining an {{all}} in spread/pb.py, having pydoctor notice when a name from {{all}} is imported into a module and doing the appropriate magic.

Who knows what should go in pb.all ? Here's an automatically derived guess:

set(['Cacheable', 'portno', 'Copyable', 'RemoteReference', 'Viewable', 
'RemoteCache', 'authIdentity', 'ProtocolError', 'getObjectAt', 'ViewPoint',
'PBServerFactory', 'setUnjellyableForClass', 'Broker', 'Referenceable', 
'setCopierForClassTree', 'setCopierForClass', 'RemoteCopy', 'PBClientFactory', 
'Avatar', 'IPerspective', 'Root', 'failure2Copyable', 'DeadReferenceError', 
'BrokerFactory'])

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
mwhudson's avatar @mwhudson commented

OK, the pydoctor part of this is done. Has some slightly surprising consequences, like SelectReactor becoming part of twisted.internet.default:

http://starship.python.net/crew/mwh/apidocs/twisted.internet.default.html

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
exarkun's avatar @exarkun commented

+1 on !all!

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
glyph's avatar @glyph commented

So, the URL that mwh points to here actually doesn't show SelectReactor as part of twisted.internet.default. Maybe it did at one point? Or maybe it's an option or something? We should generate the API docs with a recent version of pydoctor and see what they look like, because this sounds like it might already be done to me.

from twisted.

twisted-trac avatar twisted-trac commented on May 10, 2024
glyph's avatar @glyph commented

The URL that MWH points to here now does show SelectReactor. Hooray! I think the thing to do now is to close this ticket - our oldest open ticket! - and open a new one that deals with the specific PB documentation links issue.

from twisted.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.