On 09/22/2010 03:58 AM, Russ Tyndall wrote: > Hello, > > The > TimingAndEstimationPlugin<http://trac-hacks.org/wiki/TimingAndEstimationPlugin>has > a user > manual<http://trac-hacks.org/browser/timingandestimationplugin/branches/trac0.12/timingandestimationplugin/usermanual.py>that > I upgrade > through the standard > IEnvironmentSetupParticipant<http://trac-hacks.org/browser/timingandestimationplugin/branches/trac0.12/timingandestimationplugin/api.py#L214>functions. > Its a bit kludgey but it has been working through a couple > versions of trac and thus I haven't needed to upgrade for anything better. > I also haven't needed to deal with i18n yet, so I'm not sure how that would > affect my strategy. I certainly like your package resouce stuff, better > than my giant python string :)
Thanks, but the package resource stuff comes from Trac itself. I just had a look in trac.wiki.admin. I would also like to set the wiki pages read-only, and I'm not sure if this is possible with that code. Maybe I introduce a manual version in the system table? But then would a manual upgrade would need to force a DB upgrade, which sometimes is quite annoying. If someone installs the new EGG file with only updated wiki pages using the webadmin panel the trac server will stop working and someone has to log into the server and run the `trac-admin upgrade` command there .. :-( Otherwise upgrading it the `environment_needs_upgrade` method - which seems to be called at every start-up - would not be nice as well. Best, Martin > > Cheers and hope this helps, > Russ > > On Tue, Sep 21, 2010 at 6:01 PM, Martin Scharrer > <[email protected]>wrote: > >> Hi fellow trac-hacks users, >> >> I'm finishing up a new version of the WatchlistPlugin which add several >> new features inclusive an updated UI and i18n support (i.e. multiple >> languages). Because some users need some helo getting starting with it I >> came to the idea to provide a help page / manual, of course as TracWiki. >> Because it supports i18n there should be different localised versions of >> this manual: e.g. WatchlistManual, WatchlistManual/de, >> WatchlistManual/fr, ... >> This manual page could be placed on TH, but following the manual pages >> of trac itself there should be installed on the users trac server. >> >> I already figured out how to do this: >> >> import pkg_resources >> from trac.wiki.admin import WikiAdmin >> >> def do_upgrade(env): >> env[WikiAdmin].load_pages( >> pkg_resources.resource_filename('tracwatchlist', 'manual'), >> ignore=[], create_only=[]) >> >> Here all manual wiki pages are in the `manual` directory of the plugin >> package. >> >> Now, what is the best way/position to trigger this? >> In the IEnvironmentSetupParticipant.upgrade_environment method ? >> It's not really a DB upgrade and new versions of the manual could be >> released independently from the source code. The best way would be to >> hook in the `trac-admin wiki upgrade` command, but there is no interface >> for this. >> >> Any ideas about this? >> Are there already any plugins which install their own wiki pages? >> >> Best Regards, >> Martin >> >> _______________________________________________ >> th-users mailing list >> [email protected] >> https://lists.trac-hacks.org/mailman/listinfo/th-users >> > > > > _______________________________________________ > th-users mailing list > [email protected] > https://lists.trac-hacks.org/mailman/listinfo/th-users _______________________________________________ th-users mailing list [email protected] https://lists.trac-hacks.org/mailman/listinfo/th-users
