#2886 closed defect (wontfix)
Definitive list of all interfaces
Reported by: | Alec Thomas | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | general | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
With the number of new plugins implementing interfaces, it would be nice to be able to inspect what is available. This patch adds the list trac.core.InterfaceMeta._interfaces
. I envisage an about/interfaces
page similar to the existing about/plugins
.
-
trac/core.py
30 30 self.show_traceback = show_traceback 31 31 32 32 33 class InterfaceMeta(type): 34 _interfaces = [] 35 36 def __new__(cls, name, bases, d): 37 new_class = type.__new__(cls, name, bases, d) 38 if name != 'Interface': 39 InterfaceMeta._interfaces.append(new_class) 40 return new_class 41 42 33 43 class Interface(object): 34 44 """Marker base class for extension point interfaces.""" 35 45 46 __metaclass__ = InterfaceMeta 36 47 48 37 49 class ExtensionPoint(property): 38 50 """Marker class for extension points in components.""" 39 51
Attachments (1)
Change History (7)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Perhaps a better place to track this would be in the ExtensionPoint
classes, as you say.
And yes, it is available in the about/plugins page, but scouring through that page to find interfaces is not that fun, and it doesn't contain any information about the interface methods.
Perhaps the information collected could be used to generate a list of available extension points at the end of that page. Remove the description of the interfaces that's already there, leaving the list for each plugin though.
I envisaged something like the following:
trac.wiki.api.IWikiChangeListener
Extension point interface for components that should get notified about the creation, deletion and modification of wiki pages.
Interface
wiki_page_added(page)
Called whenever a new Wiki page is added.
wiki_page_changed(page, version, t, comment, author, ipnr)
Called when a page has been modified.
wiki_page_deleted(page)
Called when a page has been deleted.
wiki_page_version_deleted(page)
Called when a version of a page has been deleted.
by , 19 years ago
Attachment: | about-interfaces.diff added |
---|
Add an section on interfaces to about/plugins
comment:3 by , 19 years ago
The attached patch is just a modification of about/plugins. It adds a second section below the plugin list (with appropriate anchor links from the plugins themselves) for interfaces. Each interface encountered is listed, along with full method listing and documentation. There are anchors for each interface and method.
Doesn't require any changes to trac.core, which is good :)
comment:4 by , 19 years ago
It does make the page quite huge though. I guess I could add an about/interfaces page, and link between the two?
comment:5 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:6 by , 19 years ago
Milestone: | 0.10 |
---|
An interface is useless as long as it isn't bound to an
ExtensionPoint
. That information, however, should already be available from the component registry (although retrieving it isn't trivial).In fact, the extension points offered by components are already displayed on the
about/plugins
page, no?