On Tue, Aug 25, 2009 at 1:43 AM, rhanna<[email protected]> wrote:
> On Aug 24, 5:23 pm, yoheeb <[email protected]> wrote:
>> On Aug 24, 2:54 am, rhanna <[email protected]> wrote:
>>
>> > Hi,
>>
>> > I have several trac environments running on the trac server
>> > some plugins are installing system wide, and some are installed per
>> > trac env.
>> > I need to list all enabled plugins without having to go to every trac
>> > and look at the admin screen
>>

Plugin status is managed by environment, so you'd definitely need a
script for that .

>> > can someone point me to a way/doc to do that with python?
>>
>> > Thanks
>> > --
>> > Ramez Hanna
>> > informatiq.org
>>
>> I think the easiest would to be to loop all your project directories,
>> open /config/trac.ini as a ConfigParser object, loop the [components]
>> dictionary for all values of "enabled"
>>
>> Assuming a multi-project parent directory setup here.  there is
>> probably a more trac-specific way, but that seems easy to me.
>
> Thanks for the reply
> I ended up doing this plus listing all egg files in all the /plugins
> dir to also find what is installed
>

That way you may be missing some components. My suggestion here is the
following :

- Iterate over all envs in your dir e.g.

{{{
from trac.env import Environment

for dirnm in os.listdir(rootdir) :
  env = Environment(os.path.join(rootdir, dirnm))
}}}

- Next use ComponentMeta.registry to find out all the plugins loaded so far
- Use `env.is_component_enabled` in order to determine which
  one is enabled or not in that specific env.

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to