[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] navidoc ./Makefile ./config.py ./rst2any.py nav...
From: |
Asko Soukka |
Subject: |
[Gzz-commits] navidoc ./Makefile ./config.py ./rst2any.py nav... |
Date: |
Tue, 18 Mar 2003 11:28:37 -0500 |
CVSROOT: /cvsroot/navidoc
Module name: navidoc
Changes by: Asko Soukka <address@hidden> 03/03/18 11:28:36
Modified files:
. : Makefile config.py rst2any.py
navidoc/directives: pegboard.py
Log message:
minor
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/Makefile.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/config.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/rst2any.py.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/directives/pegboard.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: navidoc/Makefile
diff -u navidoc/Makefile:1.3 navidoc/Makefile:1.4
--- navidoc/Makefile:1.3 Tue Mar 18 11:02:27 2003
+++ navidoc/Makefile Tue Mar 18 11:28:36 2003
@@ -33,7 +33,7 @@
find . -name "*.class" | xargs rm -f
html:
- $(JYTHON) rst2any.py --html $(RST) $(DBG) -d navidoc
+ $(JYTHON) rst2any.py --html -d navidoc $(DBG) $(RST)
html-loop:
- $(JYTHON) rst2any.py --loop --html $(RST) $(DBG) -d navidoc
+ $(JYTHON) rst2any.py --loop --html -d navidoc $(DBG) $(RST)
Index: navidoc/config.py
diff -u navidoc/config.py:1.2 navidoc/config.py:1.3
--- navidoc/config.py:1.2 Tue Mar 18 09:40:59 2003
+++ navidoc/config.py Tue Mar 18 11:28:36 2003
@@ -33,11 +33,11 @@
docutils = "./docutils.conf"
else: docutils = ""
-# global settings needed all around
-globals = {'working_directory': './',
- 'input_filename': './',
- 'output_filename': './',
- }
+# global settings needed all around, these
+# should be automaticly re-set before compiling reST
+working_directory = './'
+input_filename = './'
+output_filename = './'
# pegs will be sorted after their priority
pegboard_priorities = {'Current': 1,
Index: navidoc/navidoc/directives/pegboard.py
diff -u navidoc/navidoc/directives/pegboard.py:1.1
navidoc/navidoc/directives/pegboard.py:1.2
--- navidoc/navidoc/directives/pegboard.py:1.1 Tue Mar 18 09:34:29 2003
+++ navidoc/navidoc/directives/pegboard.py Tue Mar 18 11:28:36 2003
@@ -23,6 +23,8 @@
# Written by Benja Fallensten, Vesa Kaihlavirta, Asko Soukka
#
+__docformat__ = 'reStructuredText'
+
def pegboard_directive(*args):
pegtable.sort(pegcmp)
Index: navidoc/rst2any.py
diff -u navidoc/rst2any.py:1.5 navidoc/rst2any.py:1.6
--- navidoc/rst2any.py:1.5 Tue Mar 18 11:02:27 2003
+++ navidoc/rst2any.py Tue Mar 18 11:28:36 2003
@@ -40,6 +40,7 @@
"""
dbg = config.dbg.shorthand('navidoc')
+dbg_path = config.dbg.shorthand('path')
# XXX: figure out, why docutils want locals to be cleaned
import locale
@@ -54,47 +55,65 @@
specified by ``path``) and forwards them to conversion method.
"""
if os.path.isdir(path):
+ config.working_directory = os.path.normpath(path)
rstfiles = _rstFiles(path)
if os.path.isfile(_slashify(path) + 'docutils.conf'):
config.docutils = _slashify(path) + 'docutils.conf'
for rstfile in rstfiles:
rst2any(_slashify(path)+rstfile)
elif os.path.isfile(path):
+ config.working_directory = os.path.normpath(os.path.dirname(path))
+ config.input_filename = os.path.basename(path)
rst2any(path)
elif os.path.isfile(path+'.rst'):
+ config.working_directory = os.path.normpath(os.path.dirname(path))
+ config.input_filename = os.path.basename(path+'.rst')
rst2any(path+'.rst')
def rst2any(input):
"""
Runs docutils for a single file.
"""
- if input.endswith('.rst'): output = input[0:len(input)-4]+'.gen.html'
- else: output = input+'.gen.html'
- args = "--config "+config.docutils+" "+input+' '+output
+ if input.endswith('.rst'): output = input[0:len(input)-4]
+ else: output = input
+
+ dbg_path("working directory: "+config.working_directory)
+ dbg_path("input file: "+config.input_filename)
+
if html:
- dbg("Compiling: "+input)
+ dbg('Compiling: '+input)
+ output = output+".gen.html"
+ config.output_filename = os.path.basename(output)
+ dbg_path("output file: "+config.output_filename)
+ args = "--config "+config.docutils+" "+input+' '+output
docutils.core.publish_cmdline(writer_name='html', argv=args.split())
+
if latex:
- dbg("Compiling: "+input)
+ dbg('Compiling: '+input)
+ output = output+".gen.latex"
+ config.output_filename = os.path.basename(output)
+ dbg_path("output file: "+config.output_filename)
+ args = "--config "+config.docutils+" "+input+' '+output
docutils.core.publish_cmdline(writer_name='latex', argv=args.split())
+
# catching loop parameters from the command line
-try: sys.argv.remove("--loop"); loop = 1
+try: sys.argv.remove('--loop'); loop = 1
except ValueError: loop = 0
# catching writer parameters from the command line
-try: sys.argv.remove("--latex"); latex = 1
+try: sys.argv.remove('--latex'); latex = 1
except ValueError: latex = 0
# catching writer parameters from the command line
-try: sys.argv.remove("--html"); html = 1
+try: sys.argv.remove('--html'); html = 1
except ValueError: html = 0
# catching debug parameters
dbg_names, sys.argv = getopt.getopt(sys.argv[1:], config.dbg.short,
config.dbg.long)
for dbg_name in dbg_names:
config.dbg.enable(dbg_name[1])
- print "Enabling debug output for:", dbg_name[1]
+ print 'Enabling debug output for:', dbg_name[1]
# conversion loop
while 1:
@@ -120,8 +139,8 @@
# break
if not loop: break
- print "\n\nNavidoc finished. Press Enter to recompile.\n"+ \
- "Enter any other key to exit loop and quit."
+ print "\n\n"+'Navidoc finished. Press Enter to recompile.'+"\n"+ \
+ 'Enter any other key to exit loop and quit.'
if raw_input().lower() != '':
break
- print "Rerunning Navidoc..."
+ print 'Rerunning Navidoc...'
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] navidoc ./Makefile ./config.py ./rst2any.py nav...,
Asko Soukka <=