On 6/2/07, Deen Sethanandha <[EMAIL PROTECTED]> wrote: > 5) If there are many plugin under same package, how can I distinguish > between a plugin and normal .py file. I think anything that is considered a > plugin should be in the setup file. What about the api.py , model.py, and > notification?
This is sort of a false distinction. There is no such thing as a "normal .py file". In general, a plugin will contain one or more subclasses of Trac's Component class. And it will usually implement one or more interfaces, such as IRequestHandler. In addition to this you can include any other classes or functions you need to support whatever your plugin does. You can break your code up into separate .py files (modules) however you want, though there should be some logic to it. It's also good in general to maintain a Model-View-Controller approach. > 6) What would be your advice on how to design plugin? There are many > feature that I would like to create as plugin. I am not sure if I should do > it as one plugin or more. Currently, my rule of thumb is to let a plugin > have only one new menu. Menus have nothing to do with it. A plugin may or may not add anything to the navigation menu. But yes, distinct, unrelated features should definitely be implemented as separate plugins. As far as how to design a plugin, I think that question is a little too general to be answered here, but again I stress that you should keep your UI code separate from your backend code. > 5) Is it possible to modify the content of Trac's core using plugin? I > would like to enhance the results in milestone page for example. I would > like to add the capability to view progress by action. I think it is useful > to know how many ticket are new, assigned, fixed. You can do whatever's possible through the existing plugin interfaces, so get familiar with what they are and what they allow, and you'll get a better idea of what you can do. Modifying the Roadmap is still at this point a tricky business, and what you're describing could not be done with a simple plugin (if I understand what you're trying to do correctly). It is also possible to subclass an existing Trac component, disable the built-in component, and use your own instead. It may also be possible to modify the page with an IRequestFilter Component. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en -~----------~----~----~----~------~----~------~--~---
