I've been poking through the source code trying to find the answer to
this, and failing.
I want to write a script that will let me export trac groups/
permission information to other applications. Here's my first
attempt, and it works, except that it spews plugin loading
information:
#!/opt/local/bin/python
import sys
import trac
from trac import perm
from trac.env import Environment
from trac.perm import PermissionSystem
envname = sys.argv[1]
user = sys.argv[2]
permission = sys.argv[3]
env = Environment(envname, options=[('logging', 'log_type', 'none')])
permissionSystem = PermissionSystem(env)
allperms = permissionSystem.get_user_permissions(user)
print permission in allperms and allperms[permission]
I went and looked hard at trac-admin, admin.py, env.py, and log.py,
but I cannot figure out why my script spews, and trac-admin does not.
Any clues/hints/suggestions? (I am a bit of a python novice, but also
a quick study.)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---