On Jun 23, 2008, at 3:41 PM, Eirik Schwenke wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Noah Kantrowitz skrev 23-06-2008 16:54:
> | On Jun 23, 2008, at 5:28 AM, Jani Tiainen wrote:
> |> So I need to do it by hand to all about 60 of my trac configs.. :D
> |>
> |> I wouldn't say it more "flexible" while upgrading, when creating  
> new
> |> instances it might be more flexible.
> |
> | for f in `ls /var/trac`
> | do
> |      echo -e '\n[inherit]\nfile = /usr/share/trac/conf/trac.ini\n'  
> >>"/
> | var/trac/$f"
> | done
>
> Indeed. And I imagine most people running 60 parallel instances of  
> trac would
> have a posix shell available.
>
> However, does anyone know of a "reasonable" package that would allow a
> similarly short example in python, that remained somewhat portable ?
>
> I'm not looking for something like ipython, the defunct pysh or  
> pythonShell --
> just some helpful filesystem iterators that aren't quite as verbose  
> as os.path.*
>
> Maybe a utility package that would the above be done in some  
> reasonably
> intuitive 5-6 lines of python.
>
> Any ideas?
>

Using IPython:

   for file in iglob('/var/trac/*/conf/trac.ini'):
       open(file, 'a').write('\n[inherit].....')

If you don't have the IPipe__ extension loaded by default you also need:

     from IPython import ipapi
     ipapi.get().ex("from ipipe import *")

__ http://ipython.scipy.org/moin/UsingIPipe

--Noah

--~--~---------~--~----~------------~-------~--~----~
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