source: coopr.data.samples/trunk/coopr/data/samples/update.py @ 3940

Revision 3940, 2.1 KB checked in by wehart, 3 years ago (diff)

Doc update

Line 
1#!/usr/bin/env python
2#
3# This is a Python script that regenerates the top-level TRAC.txt file, which
4# is loaded by the Coopr Trac wiki
5#
6
7import glob
8import os.path
9
10
11OUTPUT = open('TRAC.txt', 'w')
12print >>OUTPUT, """{{{
13#!comment
14;
15; Trac examples generated automatically by the update.py script
16;
17}}}
18
19= Coopr Gallery =
20
21Click on a link below for case studies, Coopr script examples, and comparisons between Pyomo and other modeling languages.
22
23
24"""
25
26print >>OUTPUT, '== Case Studies =='
27print >>OUTPUT, ''
28
29for Dir in glob.glob('case_studies/*'):
30    dir = os.path.basename(Dir)
31    if os.path.exists('case_studies/%s/README.txt' % dir):   
32        print >>OUTPUT, " * [wiki:Documentation/CooprGallery/CaseStudies/%s %s]" % (dir, dir)
33        print >>OUTPUT, "{{{\n#!comment\n[[Include(source:coopr.data.samples/trunk/coopr/data/samples/case_studies/%s/README.txt, text/x-trac-wiki)]]\n}}}" % dir
34
35
36print >>OUTPUT, '== Coopr Scripts =='
37print >>OUTPUT, ''
38
39for Dir in glob.glob('scripts/*'):
40    dir = os.path.basename(Dir)
41    if os.path.exists('scripts/%s/README.txt' % dir):   
42        print >>OUTPUT, " * [wiki:Documentation/CooprGallery/Scripts/%s %s]" % (dir, dir)
43        print >>OUTPUT, "{{{\n#!comment\n[[Include(source:coopr.data.samples/trunk/coopr/data/samples/scripts/%s/README.txt, text/x-trac-wiki)]]\n}}}" % dir
44
45print >>OUTPUT, '== Modeling Comparisons =='
46print >>OUTPUT, ''
47print >>OUTPUT, """The following links provide documentation of optimization models that can be used to compare and contrast Pyomo with other optimization modeling tools. Note that the list of [wiki:Documentation/RelatedProjects related projects] summarizes Python software frameworks that provide optimization functionality that is similar to Coopr."""
48print >>OUTPUT, ''
49
50for Dir in glob.glob('comparisons/*'):
51    dir = os.path.basename(Dir)
52    print dir
53    if os.path.exists('comparisons/%s/README.txt' % dir):   
54        print >>OUTPUT, " * [wiki:Documentation/CooprGallery/ModelingComparisons/%s %s]" % (dir, dir)
55        print >>OUTPUT, "{{{\n#!comment\n[[Include(source:coopr.data.samples/trunk/coopr/data/samples/comparisons/%s/README.txt, text/x-trac-wiki)]]\n}}}" % dir
56
57
58
Note: See TracBrowser for help on using the repository browser.