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()
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( )
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
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