[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:51:42 UTC 2009
The following commit has been merged in the upstream branch:
commit 2f873bdd74a048196de45bf4b5a43265955a3f66
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Thu Mar 17 11:33:30 2005 +1100
Automatic distribution of examples + improved gfs2tex code
darcs-hash:20050317003330-fbd8f-1d7785c58fa771afdd21700b417b7dd058e67dee.gz
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 7d04d67..73205fc 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = tutorial
+SUBDIRS = tutorial examples
# The name of the module.
DOC_MODULE=gfs
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 66348b5..1fa6897 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -4,10 +4,10 @@ EXAMPLES = \
cylinder
EXTRA_DIST = \
- $(EXAMPLES) \
template.tex \
gfs2tex.py \
- gfs2tex
+ gfs2tex \
+ depend
bin_SCRIPTS = \
gfs2doc
@@ -43,5 +43,10 @@ examples.pdf: examples.dvi
examples.tex: template.tex
rm -r -f examples
- ./gfs2tex
+ python gfs2tex $(EXAMPLES)
sed "s/GFS_VERSION/`$(top_srcdir)/src/gerris2D -V 2>&1 | awk '{ if ($$5 == "version") print $$6}'`/g" < template.tex > examples.tex
+
+Makefile.deps: $(EXAMPLES)
+ python depend $(EXAMPLES) > Makefile.deps
+
+-include Makefile.deps
diff --git a/doc/examples/depend b/doc/examples/depend
new file mode 100755
index 0000000..17afd7d
--- /dev/null
+++ b/doc/examples/depend
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+
+import sys
+import os
+import os.path
+import gfs2tex
+
+print "EXTRA_DIST +=",
+for start in sys.argv[1:]:
+ for root, dirs, files in os.walk(start,topdown=True):
+ if not ".xvpics" in root:
+ example = gfs2tex.Example(root)
+ print example.path + "/" + example.name + ".gfs",
+ for f in example.required:
+ print example.path + "/" + f,
+print ""
diff --git a/doc/examples/gfs2doc.in b/doc/examples/gfs2doc.in
index ee244ae..47fe9de 100755
--- a/doc/examples/gfs2doc.in
+++ b/doc/examples/gfs2doc.in
@@ -22,7 +22,7 @@ def myexit(s):
sys.exit(s)
for d in sys.argv[1:]:
- example = gfs2tex.Example("./" + d)
+ example = gfs2tex.Example(d)
example.write(dico)
wdname = tempfile.mkdtemp()
tex = open(wdname + "/" + example.name + ".tex", "w")
diff --git a/doc/examples/gfs2tex b/doc/examples/gfs2tex
index e0f4d81..cec2513 100755
--- a/doc/examples/gfs2tex
+++ b/doc/examples/gfs2tex
@@ -13,10 +13,10 @@ dico = {}
for f in glob.glob("../reference/*.html"):
gfs2tex.dictionary(dico,open(f))
-for root, dirs, files in os.walk("."):
- for d in dirs:
- if (root + "/" + d)[0:10] != "./examples" and d != ".xvpics":
- example = gfs2tex.Example(root + "/" + d)
+for start in sys.argv[1:]:
+ for root, dirs, files in os.walk(start,topdown=True):
+ if not ".xvpics" in root:
+ example = gfs2tex.Example(root)
if not os.access("examples/" + example.path,os.F_OK):
- os.symlink("." + example.path, "examples/" + example.path)
+ os.symlink("../" + example.path, "examples/" + example.path)
example.write(dico)
diff --git a/doc/examples/gfs2tex.py b/doc/examples/gfs2tex.py
index fab0ada..0e5aeba 100644
--- a/doc/examples/gfs2tex.py
+++ b/doc/examples/gfs2tex.py
@@ -44,9 +44,16 @@ def dictionary(d,file):
class Example:
def __init__(self,path):
+ if path[0:2] == "./":
+ path = path[2:]
self.path, self.name = os.path.split(path)
- self.path += "/" + self.name
- self.section = ["\\subsection","\\subsubsection"][self.path.count("/")-1]
+ if self.name == "":
+ self.name = self.path
+ elif self.path == "":
+ self.path = self.name
+ else:
+ self.path += "/" + self.name
+ self.section = ["\\subsection","\\subsubsection"][self.path.count("/")]
name = self.path + "/" + self.name + ".gfs"
file = open(name)
lines = file.readlines()
@@ -124,7 +131,7 @@ class Example:
def colorize(self,dico):
file = open(self.path + "/" + self.name + ".gfs")
out = open(self.path + "/" + self.name + ".gfs.html", 'w')
- path = "../" * (self.path.count("/") + 2) + "reference/"
+ path = "../" * (self.path.count("/") + 3) + "reference/"
out.write("<html><head><title>\n" + self.name + ".gfs")
out.write("</title></head><body><tt>\n")
infile = insthg = 0
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list