示例#1
0
def main(trac_env, examples_dir='.'):
    loaded = False
    for file in os.listdir(examples_dir):
        if 'GraphvizExamples' in file:
            admin.run([trac_env, 'wiki', 'import', file.replace('%2F', '/'), os.path.join(examples_dir, file)] )
            loaded = True

    if not loaded:
        print 'The %(examples_dir)s does not contain any GrapgvizExamples files.' % locals()
示例#2
0
def main(trac_env, examples_dir='.'):
    loaded = False
    for file in os.listdir(examples_dir):
        if 'GraphvizExamples' in file:
            admin.run([
                trac_env, 'wiki', 'import',
                file.replace('%2F', '/'),
                os.path.join(examples_dir, file)
            ])
            loaded = True

    if not loaded:
        print 'The %(examples_dir)s does not contain any GrapgvizExamples files.' % locals(
        )
示例#3
0
 def execute_setup_action(self, req, proj, action, args):
     repo_type = hasattr(proj, 'repo_type') and proj.repo_type or 'svn'
     repo_path = hasattr(proj, 'repo_path') and proj.repo_path or ''
 
     from trac.config import default_dir
     from trac.scripts.admin import run
     return run([proj.env_path, 
                 'initenv', 
                 req.args.get('fullname','').strip(), 
                 'sqlite:db/trac.db', 
                 repo_type.strip(), 
                 repo_path.strip(), 
                 default_dir('templates'),
                ]) == 0
示例#4
0
    def execute_setup_action(self, req, proj, action, args):
        repo_type = hasattr(proj, 'repo_type') and proj.repo_type or 'svn'
        repo_path = hasattr(proj, 'repo_path') and proj.repo_path or ''

        from trac.config import default_dir
        from trac.scripts.admin import run
        return run([
            proj.env_path,
            'initenv',
            req.args.get('fullname', '').strip(),
            'sqlite:db/trac.db',
            repo_type.strip(),
            repo_path.strip(),
            default_dir('templates'),
        ]) == 0