On 03/29/2012 06:08 AM, osimons wrote:
On Tuesday, March 27, 2012 8:05:04 PM UTC+2, Chris Nelson wrote:

    In
    http://groups.google.com/group/trac-dev/msg/828db3da4963ed9a?hl=en
    <http://groups.google.com/group/trac-dev/msg/828db3da4963ed9a?hl=en>, I
    got a good pointer to FullBlogPlugin as a model of how to have
    conditional dependencies between plugins. I'm now trying to use that
    and running into problems understanding what it all means.


Basically I have extracted the optional Blog features for TagsPlugin and
SpamFilterPlugin into separate files, and added entry_point conditionals
to only present them to Trac if they have no requirements, or have
requirements that are met ('extras_require'). Your code looks to have
caught the general idea of it, but your intra-code dependency
explanation I cannot quite understand.

In TracJSGantt, I have three files:

 * tracjsgantt.py - The Python wrapper around jsGantt.js
 * pmapi.py - The interfaces for the Project Management adapters
 * tracpm.py - The implementation of the adapters

In Team Calendar, I have:

 * calendar.py - The existing calendar editor page
* resourcecalendar.py - Implements pmapi.IResourceCalendar and accesses the database edited by calendar.py

If TracPM 0.10 or later is installed, I expect to see two components under Team Calendar in web admin: TeamCalendar and TracPMConnector. If TracPMConnector is enabled, TracPM uses Team Calendar's IResourceCalendar. If not, another might be (e.g,. the one built in to TracPM).

If TracPM 0.10 isn't installed (e.g., 0.9 is installed or there's no TracPM at all), I want Team Calendar to work as it always has: when enabled, there is a "Team Calendar" item on the Trac ribbon. I expect that if that condition isn't met, there would not be a TracPMConnector item in web admin but perhaps I've got that wrong.

(Of course, there is the further issue that TracPMConnector depends on TeamCalendar so if the calendar isn't enabled, the connector should not.

...
Check out the setuptools documentation, it is likely the most relevant.
Note that extras_require can be a list of requirements, so it can be
'rescal': ['Trac-jsGantt>=0.10', 'Trac>=0.12'] (or whatever suits your
code structure).

http://peak.telecommunity.com/DevCenter/setuptools#declaring-extras-optional-features-with-their-own-dependencies

Thanks, I'll look there.  (And at the pointers Carsten provided.)

                                                Chris
--
Christopher Nelson, Software Engineering Manager
Sixnet, a Red Lion business | www.sixnet.com
+1 (518) 877-5173, x135

--
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-dev@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to