[Trac] Re: Trac site template
Its a day after I planned to reply, so I figured I'd update on the status of TracLegos. You can see what's going on here: http://trac-hacks.org/wiki/TracLegosScript Its at a state now where its semi-usable, though its still more of an alpha than a beta. Very much unimplemented but needed features include: * format for permissions, milestones, components, and other information settable by trac-admin Still not done. * DB creation for non-sqlite cases Likewise. * repository options; this is hinted at in the web view, but none of the radio buttons displayed at are currently functional Now new repositories can be created, but they aren't served anywhere (no apache.conf files are written and the paste web view does not serve them either) * installation of requirements for plugins via PoachEggs [2] This is semi-done. I've commented out the code, however, as at least on my system PoachEggs barfs if the same requirements file is installed twice. I'm in contact with the author and hope to get this fixed soon (that is, if either of us can figure out the problemhe doesn't seem to have it). * permission checking on TTW interface Not yet done. Advised to use the web view behind a firewall for the time being. * tools to turn existing trac projects into templates Yep, in simple form: run `paster create -t trac_project name_of_your_template` and answer some questions (an example is shown on the trac-hacks wiki page) I hesitate to give the source out, as its in such an early stage that it probably isn't useful yet, but if you are curious it is available at https://svn.openplans.org/svn/trac/install/TracLegos/ Moved; now at http://trac-hacks.org/svn/traclegosscript/anyrelease/ The README might be worthwhile, though it is bit dated (documentation never keeps up with coding). I'd be curious if this sort of thing would be useful to people. Also, not a bad time for feature requests and feedback. Still looking for feedback ;) Maybe this is partially redundant with tracforge, but I think the approach is a little different (or maybe not). If I get TracLegos a bit more mature then I'll let people know. I'm going to put it up locally for our developers, so then progress will largely be on an 'as-needed' basis for us unless someone else takes an interest in the idea. Jeff Hammel The Open Planning Project - http://topp.openplans.org [EMAIL PROTECTED] IRC: jhammel, k0s --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Trac Users group. To post to this group, send email to trac-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[Trac] Re: Trac site template
Fangman, Patricia M (Shelly) wrote: I'd love some advice on how to create a template of an entire Trac site. For example, I want to create a new Trac site, add my customizations (style, fields, etc) and use this as a template to create my new future Trac sites. The idea is not to have to customize each new Trac site, everything is in place from the beginning. Any ideas? For our modest needs, I - created a trac site to serve as the template. - Configure permissions, plugins, etc. - use trac-admin hotcopy to make backups of the template whenever a change is made (we're using sqlite, so that includes the database). - use a python script to copy the backup into our trac projects directory with a new name. - same script changes some config parameters using the trac config API. We make use of the inherits config section as well. [inherit] file = c:\Python25\share\trac\conf\trac.ini plugins_dir = c:\Python25\share\trac\plugins templates_dir = c:\Python25\share\trac\templates As you can tell it's on windows. HTH, Ted --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Trac Users group. To post to this group, send email to trac-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[Trac] Re: Trac site template
Would you be willing to share your python script? __ Shelly Fangman Scientist, Enabling Technologies EMSL: Environmental Molecular Sciences Laboratory -Original Message- From: trac-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ted Gifford Sent: Thursday, August 28, 2008 2:47 AM To: trac-users@googlegroups.com Subject: [Trac] Re: Trac site template Fangman, Patricia M (Shelly) wrote: I'd love some advice on how to create a template of an entire Trac site. For example, I want to create a new Trac site, add my customizations (style, fields, etc) and use this as a template to create my new future Trac sites. The idea is not to have to customize each new Trac site, everything is in place from the beginning. Any ideas? For our modest needs, I - created a trac site to serve as the template. - Configure permissions, plugins, etc. - use trac-admin hotcopy to make backups of the template whenever a change is made (we're using sqlite, so that includes the database). - use a python script to copy the backup into our trac projects directory with a new name. - same script changes some config parameters using the trac config API. We make use of the inherits config section as well. [inherit] file = c:\Python25\share\trac\conf\trac.ini plugins_dir = c:\Python25\share\trac\plugins templates_dir = c:\Python25\share\trac\templates As you can tell it's on windows. HTH, Ted --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Trac Users group. To post to this group, send email to trac-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[Trac] Re: Trac site template
Jeff, Would TracLegos work with Trac 10.4 or is this for Trac 11 only? __ Shelly Fangman Scientist, Enabling Technologies EMSL: Environmental Molecular Sciences Laboratory -Original Message- From: trac-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Hammel Sent: Wednesday, August 27, 2008 5:46 PM To: trac-users@googlegroups.com Subject: [Trac] Re: Trac site template On Wed, August 27, 2008 20:02, Fangman, Patricia M (Shelly) wrote: I'd love some advice on how to create a template of an entire Trac site. For example, I want to create a new Trac site, add my customizations (style, fields, etc) and use this as a template to create my new future Trac sites. The idea is not to have to customize each new Trac site, everything is in place from the beginning. Any ideas? __ Shelly Fangman Scientist, Enabling Technologies EMSL: Environmental Molecular Sciences Laboratory I was going to write to the list when this was a little more usable, but I have been working on a project called TracLegos whose primary goal is to enable the definition of a project template and using these templates to create a trac project. Essentially, I am using a subclass of PasteScript templates [1] that is called TracProject that is intended as a definition of what a site template is. Currently, this is almost an empty subclass (I've only been working on TracLegos a few days so its still not really ready, though I do intend to have a considerable amount done by Monday...I'll mail the thread then with an update). The idea is that each template defines a type of project -- whether a generic type like 'client-facing', 'live errors', 'FOSS project'; or a specific type like a template for a specific organization. Site-configuration can be used to provide needed variables and other policy issues (like what type of database to use, who is part of what groups, etc). The program is intended to be used either through pastescript invocation (which will only apply one template and may have limitations on how much it can do), command-line invocation (where you can use several templates and have the most flexibility), and through the web via a paste application that wraps trac in middleware and also may be used to create projects. Very much unimplemented but needed features include: * format for permissions, milestones, components, and other information settable by trac-admin * DB creation for non-sqlite cases * repository options; this is hinted at in the web view, but none of the radio buttons displayed at are currently functional * installation of requirements for plugins via PoachEggs [2] * permission checking on TTW interface * tools to turn existing trac projects into templates I hesitate to give the source out, as its in such an early stage that it probably isn't useful yet, but if you are curious it is available at https://svn.openplans.org/svn/trac/install/TracLegos/ The README might be worthwhile, though it is bit dated (documentation never keeps up with coding). I'd be curious if this sort of thing would be useful to people. Also, not a bad time for feature requests and feedback. Jeff [1] http://pythonpaste.org/script/developer.html [2] https://svn.openplans.org/svn/PoachEggs/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Trac Users group. To post to this group, send email to trac-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[Trac] Re: Trac site template
Here is the script. It's not a great example, but it works. It is actually an apache handleretc... Gotta go sleep. The formatting will get mangled...so here goes. from __future__ import with_statement options = {content_type: text/plain} import os from mod_python import apache import shutil try: from mod_python.util import parse_qsl except ImportError: from cgi import parse_qsl from trac.config import * from trac.perm import PermissionSystem from trac.env import open_environment from acct_mgr.api import AccountManager def handler(req): # try: req.content_type = 'text/plain' query = get_env(req) contractName = query['contractName'] contractNumber = query['contractNumber'] contractId = query['contractId'] officePhone = query['officePhone'] contractTeamTable = query['contractTeamTable'] contractTable = query['contractTable'] projectPath = 'C:/trac/%s-%s' % (contractName, contractNumber) if os.path.exists(projectPath): req.write(Project site already exists!) return apache.OK # copy project Template shutil.copytree('C:/TracDev/backups/projectTemplate', projectPath) # undo copy if necessary try: # edit trac.ini config = Configuration(os.path.join(projectPath, 'conf', 'trac.ini')) config.set('project', 'name', contractName) config.set('project', 'contractId', contractId) config.set('project', 'contractNumber', contractNumber) config.set('project', 'officePhone', officePhone) config.set('project', 'contractTeamTable', contractTeamTable) config.set('project', 'contractTable', contractTable) config.save() # Save user env = open_environment(projectPath, use_cache=False) try: mgr = AccountManager(env) user = password = '%s-%s' % (contractName.lower(), contractNumber) mgr.set_password(user , password) perm = PermissionSystem(env) perm.grant_permission(user, 'client') finally: env.shutdown() except Exception, e: shutil.rmtree(projectPath) raise e else: # respond return apache.OK #except : #return apache.INTERNAL_SERVER_ERROR def get_env(req): # grab GET variables req.add_common_vars() req.content_type= options['content_type'] query = req.subprocess_env['QUERY_STRING'] # grab POST variables if req.subprocess_env['REQUEST_METHOD'] == 'POST': query += '' + req.read() # break down the urlencoded query string query = parse_qsl(query) http_var= dict(query) return http_var --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Trac Users group. To post to this group, send email to trac-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[Trac] Re: Trac site template
That's a good question. Being basically a standalone package, I would guess it should work with Trac 10.4 (though of course, the templates may require features for 0.11 or any other version for that matter), but I haven't tried it. So my guess is yes, but I haven't tried. Jeff Hammel The Open Planning Project http://topp.openplans.org IRC: jhammel, k0s On Thu, Aug 28, 2008 at 12:32:24PM -0700, Fangman, Patricia M (Shelly) wrote: Jeff, Would TracLegos work with Trac 10.4 or is this for Trac 11 only? __ Shelly Fangman Scientist, Enabling Technologies EMSL: Environmental Molecular Sciences Laboratory -Original Message- From: trac-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Hammel Sent: Wednesday, August 27, 2008 5:46 PM To: trac-users@googlegroups.com Subject: [Trac] Re: Trac site template On Wed, August 27, 2008 20:02, Fangman, Patricia M (Shelly) wrote: I'd love some advice on how to create a template of an entire Trac site. For example, I want to create a new Trac site, add my customizations (style, fields, etc) and use this as a template to create my new future Trac sites. The idea is not to have to customize each new Trac site, everything is in place from the beginning. Any ideas? __ Shelly Fangman Scientist, Enabling Technologies EMSL: Environmental Molecular Sciences Laboratory I was going to write to the list when this was a little more usable, but I have been working on a project called TracLegos whose primary goal is to enable the definition of a project template and using these templates to create a trac project. Essentially, I am using a subclass of PasteScript templates [1] that is called TracProject that is intended as a definition of what a site template is. Currently, this is almost an empty subclass (I've only been working on TracLegos a few days so its still not really ready, though I do intend to have a considerable amount done by Monday...I'll mail the thread then with an update). The idea is that each template defines a type of project -- whether a generic type like 'client-facing', 'live errors', 'FOSS project'; or a specific type like a template for a specific organization. Site-configuration can be used to provide needed variables and other policy issues (like what type of database to use, who is part of what groups, etc). The program is intended to be used either through pastescript invocation (which will only apply one template and may have limitations on how much it can do), command-line invocation (where you can use several templates and have the most flexibility), and through the web via a paste application that wraps trac in middleware and also may be used to create projects. Very much unimplemented but needed features include: * format for permissions, milestones, components, and other information settable by trac-admin * DB creation for non-sqlite cases * repository options; this is hinted at in the web view, but none of the radio buttons displayed at are currently functional * installation of requirements for plugins via PoachEggs [2] * permission checking on TTW interface * tools to turn existing trac projects into templates I hesitate to give the source out, as its in such an early stage that it probably isn't useful yet, but if you are curious it is available at https://svn.openplans.org/svn/trac/install/TracLegos/ The README might be worthwhile, though it is bit dated (documentation never keeps up with coding). I'd be curious if this sort of thing would be useful to people. Also, not a bad time for feature requests and feedback. Jeff [1] http://pythonpaste.org/script/developer.html [2] https://svn.openplans.org/svn/PoachEggs/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Trac Users group. To post to this group, send email to trac-users@googlegroups.com 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 -~--~~~~--~~--~--~---
[Trac] Re: Trac site template
On Wed, August 27, 2008 20:02, Fangman, Patricia M (Shelly) wrote: I'd love some advice on how to create a template of an entire Trac site. For example, I want to create a new Trac site, add my customizations (style, fields, etc) and use this as a template to create my new future Trac sites. The idea is not to have to customize each new Trac site, everything is in place from the beginning. Any ideas? __ Shelly Fangman Scientist, Enabling Technologies EMSL: Environmental Molecular Sciences Laboratory I was going to write to the list when this was a little more usable, but I have been working on a project called TracLegos whose primary goal is to enable the definition of a project template and using these templates to create a trac project. Essentially, I am using a subclass of PasteScript templates [1] that is called TracProject that is intended as a definition of what a site template is. Currently, this is almost an empty subclass (I've only been working on TracLegos a few days so its still not really ready, though I do intend to have a considerable amount done by Monday...I'll mail the thread then with an update). The idea is that each template defines a type of project -- whether a generic type like 'client-facing', 'live errors', 'FOSS project'; or a specific type like a template for a specific organization. Site-configuration can be used to provide needed variables and other policy issues (like what type of database to use, who is part of what groups, etc). The program is intended to be used either through pastescript invocation (which will only apply one template and may have limitations on how much it can do), command-line invocation (where you can use several templates and have the most flexibility), and through the web via a paste application that wraps trac in middleware and also may be used to create projects. Very much unimplemented but needed features include: * format for permissions, milestones, components, and other information settable by trac-admin * DB creation for non-sqlite cases * repository options; this is hinted at in the web view, but none of the radio buttons displayed at are currently functional * installation of requirements for plugins via PoachEggs [2] * permission checking on TTW interface * tools to turn existing trac projects into templates I hesitate to give the source out, as its in such an early stage that it probably isn't useful yet, but if you are curious it is available at https://svn.openplans.org/svn/trac/install/TracLegos/ The README might be worthwhile, though it is bit dated (documentation never keeps up with coding). I'd be curious if this sort of thing would be useful to people. Also, not a bad time for feature requests and feedback. Jeff [1] http://pythonpaste.org/script/developer.html [2] https://svn.openplans.org/svn/PoachEggs/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Trac Users group. To post to this group, send email to trac-users@googlegroups.com 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 -~--~~~~--~~--~--~---