dabodoc Commit
Revision 61
Date: 2011-02-26 06:14:56 -0800 (Sat, 26 Feb 2011)
Author: Werner
Trac: http://trac.dabodev.com/changeset/61

Changed:
_U  trunk/api/sphinx/
D   trunk/api/sphinx/_rst_basefiles/index_latex no.rst
A   trunk/api/sphinx/_rst_basefiles/index_latex.rst
_U  trunk/api/sphinx/build/
U   trunk/api/sphinx/config.py
U   trunk/api/sphinx/makeRST.py
U   trunk/api/sphinx/makeSphinx.py
_U  trunk/api/sphinx/source/
U   trunk/api/sphinx/source/conf.py
_U  trunk/api/sphinx/tempsource/

Log:
- enable the htmlhelp builder to generate hhc/hhk/hhp and Windows chm help files
- clean up

Diff:

Property changes on: trunk/api/sphinx
___________________________________________________________________
Name: svn:ignore
   + galleryToClassIndex.py
sphinxstderr.txt


Deleted: trunk/api/sphinx/_rst_basefiles/index_latex no.rst

Copied: trunk/api/sphinx/_rst_basefiles/index_latex.rst (from rev 60, 
trunk/api/sphinx/_rst_basefiles/index_latex no.rst)
===================================================================
--- trunk/api/sphinx/_rst_basefiles/index_latex.rst                             
(rev 0)
+++ trunk/api/sphinx/_rst_basefiles/index_latex.rst     2011-02-26 14:14:56 UTC 
(rev 61)
@@ -0,0 +1,183 @@
+.. include:: _static/headings.txt
+
+========================================================
+|doc_title| **Dabo - The desktop application framework**
+========================================================
+
+Desktop applications. That's what Dabo does. It's not YAWF (yet another web 
framework).
+There are plenty of excellent web frameworks out there, so if that's what you 
are looking
+for, Dabo isn't for you. But there are almost no desktop application 
frameworks out there,
+and if you want to create applications that run on Windows, OS X or Linux, 
Dabo is for you!
+
+|
+
+.. figure:: _static/dabo_horizontal_sidebar.png
+   :alt: dabo screenshots
+   :figclass: floatcenter
+   :align: center
+   :target: gallery.html
+
+   **Dabo** sample screenshots
+
+|
+
+:Version: |version|
+:Date: |today|
+
+
+=========================
+|description| Description
+=========================
+
+Dabo is a 3-tier, cross-platform application development framework, written in 
Python atop the wxPython GUI toolkit. And while Dabo is designed to create 
database-centric apps, that is not a requirement. Lots of people are using Dabo 
for the GUI tools to create apps that have no need to connect to a database at 
all.
+
+
+========================
+|description| Background
+========================
+
+Dabo's authors, Ed Leafe and Paul McNett, have strong backgrounds in database 
application development using the awesome and underrated Microsoft Visual 
FoxPro development environment.
+
+While Visual FoxPro shines at developing data-centric applications, it has one 
limitation that cannot be ignored: it only runs on Microsoft Windows, and Ed 
and Paul both have clients that want their applications to run on Linux and 
Macintosh. We are sure we are not alone in this regard: it is a multi-platform 
world with more diverse needs than one vendor can fulfill.
+
+Ed and Paul got to talking one day: Paul had been researching various 
multiplatform GUI toolkits for about 18 months, and Ed has lots of experience 
developing the Visual FoxPro Codebook framework. We decided to work together to 
make a framework for developing robust data-centric applications for 
multi-platform deployment. We've come up with a design that is simple, 
flexible, and robust, and we've begun developing our own client applications 
using the Dabo framework.
+
+===========================
+|description| 3-Tier Design
+===========================
+
+We have taken what we've learned from 25 combined years of FoxPro database 
application development, and built an easy-to-use runtime framework that runs 
on all three major platforms. Dabo consists of 3 logical tiers plus an umbrella 
application object. The three tiers are:
+
+======================
+|description| Database
+======================
+
+Currently, Dabo supports MySQL, PostgreSQL, Firebird, Microsoft SQL Server and 
SQLite backends, but in the near future it will support all databases that have 
drivers that conform to the Python dbapi. These databases include:
+
+    * MySQL (already supported)
+    * PostgreSQL(already supported)
+    * Firebird (already supported)
+    * MS-SQL and MSDE (already supported)
+    * SQLite (already supported)
+    * Oracle
+    * DB2
+    * Sybase
+    * Berkeley DB
+
+============================
+|description| Business Rules
+============================
+
+This tier is where all the business logic resides. You simply subclass 
dBizobj, set a few properties, and override a few methods. The dBizobj 
communicates with the database tier and the user interface tier, and enforces 
your business rules to your specifications.
+
+============================
+|description| User Interface
+============================
+
+You create your forms by laying out various controls or widgets, and setting 
properties to tell Dabo what bizobj and what field in the dataset the control 
represents. There is no business logic at this level, and only minimal code 
will be entered here: it is mostly laying out your UI design and setting 
properties to tell Dabo how to connect to the business rules.
+
+Currently, the only supported UI is wxPython, but we've left it open for 
possible future additions of other UI libraries, such as:
+
+    * wxPython (already supported)
+    * PyQt
+    * TkInter
+    * Curses (text only - perhaps the computer isn't running a GUI)
+    * HTTP (web server providing a browser interface)
+
+However, wrapping a UI toolkit is a major effort, so don't hold your breath 
waiting for any of the other UIs - unless, of course, you want to volunteer to 
work with us to get it working!
+
+============================
+|description| Multi-Platform
+============================
+
+Dabo applications are known to run on all flavors of Windows, all recent 
flavors of Linux, and Macintosh OS X 10.2 or higher. Because Dabo is currently 
built on top of wxPython, which is built on top of wxWidgets, it probably runs 
elsewhere, too. It also suffers from the same display limitations on some 
platforms (most notably OS X), but these should improve as the underlying 
toolkits improve.
+
+You can develop Dabo applications on all three supported platforms, and you 
can run your Dabo applications on all three supported platforms. Flexibility is 
a really good thing.
+
+=======================
+|description| Community
+=======================
+
+Visual FoxPro has a vibrant, vocal, energetic community that knows how to have 
a good time. From what we've seen of the Python community so far, the same goes 
there. We hope to provide the structure for forming a new community, a Dabo 
community that shares ideas and code, supports one-another, and hopefully even 
gets together once a year to socialize. There are mailing lists for users of 
Dabo and developers of Dabo, and a world-editable Dabo Wiki. We are friendly 
and look forward to meeting you.
+
+Oh, and if you are a disenchanted Visual Basic developer, you've found the 
right place, too. 
+
+==============================
+|other_info| Other Information
+==============================
+
+Bugs and Limitations: many, patches and fixes welcome :-D
+
+See the demo for an example of what **Dabo** can do, and on how to use it.
+
+---------------
+
+Copyright: Ed Leafe and Paul McNett
+
+License: As of 11/4/2004, Dabo is licensed under the very liberal MIT License, 
which allows you to do whatever you want with our code, as long as the 
copyright notice and license terms remain intact. See 
http://www.dabodev.com/licensing.
+
+---------------
+
+SVN for latest code:
+http://svn.dabodev.com/dabo/trunk/dabo
+
+Mailing List:
[email protected]
+
+---------------
+
+Please let us know if you are using **Dabo**!
+
+---------------
+
+**Dabo** version: |version|
+
+Last updated: |today|, 10.00 GMT
+
+---------------
+
+
+|table_contents| Table of Contents
+==================================
+
+|
+
++-----------------------------------+-----------------------------------+
+| Dabo                              | Databases supported               |
++===================================+===================================+
+| * :ref:`dabo.dApp`                | * :ref:`dabo.db.dbFirebird`       |
+| * :ref:`dabo.dObject`             | * :ref:`dabo.db.dbMSSQL`          |
+| * :ref:`dabo.dReportWriter`       | * :ref:`dabo.db.dbMySQL`          |
+| * :ref:`dabo.dSecurityManager`    | * :ref:`dabo.db.dbPostgreSQL`     |
+| * :ref:`dabo.dUserSettingProvider`| * :ref:`dabo.db.dbSQLite`         |
++-----------------------------------+-----------------------------------+
+| db module                         | biz module                        |
++-----------------------------------+-----------------------------------+
+| * :ref:`dabo.db.dBackend`         | * :ref:`dabo.biz.dBizobj`         |
+| * :ref:`dabo.db.dConnectInfo`     | * :ref:`dabo.biz.dAutoBizobj`     |
+| * :ref:`dabo.db.dConnection`      | * :ref:`dabo.biz.RemoteBizObj`    |
+| * :ref:`dabo.db.dCursorMixin`     |                                   |
+| * :ref:`dabo.db.dNoEscQuoteStr`   |                                   |
+| * :ref:`dabo.db.dTable`           |                                   |
+|                                   |                                   |
++-----------------------------------+-----------------------------------+
+| ui module                         |                                   |
++-----------------------------------+-----------------------------------+
+| * :ref:`dabo.ui`                  |                                   |
++-----------------------------------+-----------------------------------+
+
+
+
+|indices| Indices and tables
+============================
+
+* :ref:`daboindex`
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+.. toctree::
+   :hidden:
+
+   general_index
+


Property changes on: trunk/api/sphinx/build
___________________________________________________________________
Name: svn:ignore
   + htmlhelp
pdf


Modified: trunk/api/sphinx/config.py
===================================================================
--- trunk/api/sphinx/config.py  2011-02-26 09:59:47 UTC (rev 60)
+++ trunk/api/sphinx/config.py  2011-02-26 14:14:56 UTC (rev 61)
@@ -1,7 +1,6 @@
 # -*- coding: utf-8 -*-#
 
 import os
-import sys
 import platform
 
 # review and update as needed
@@ -9,7 +8,7 @@
 # folder where .rst files will be stored
 baseFolder = os.getcwd()
 docFolder = os.path.join(baseFolder, "source")
-# used to generate files, only changed ones will be copied to docFolder
+# used to generate files, only changed and new ones will be copied to docFolder
 # this speeds up the Sphinx build
 rstTempFolder = os.path.join(baseFolder, "tempsource")
 folderToDoc = os.path.join(baseFolder, "../dabo")
@@ -27,13 +26,19 @@
        graphVizDot = ' -D graphviz_dot="C:\\Program Files 
(x86)\\Graphviz2.26.3\\bin\\dot.exe" '
        hhcExe = "C:\Program Files (x86)\HTML Help Workshop\hhc.exe "
 
-sErr = os.path.join(baseFolder, "sphinxerr.txt")
-sphinxErrFile = " -w %s " % sErr
 
-# only html is tested/done yet
+sStdErr = os.path.join(baseFolder, "sphinxstderr.txt")
+sphinxStdErrStr = " -w %s " % sStdErr
+sphinxStdErrFile = open(sStdErr, 'w')
+
+# supported builders
 normalHtml = "html"
 helpHtml = "htmlhelp"
-singleHtml = "singlehtml"
+pdfDoc = "pdf" # doesn't work yet
 
-hhcName = "daboDoc.hhp"
-chmName = "daboDoc.chm"
+validBuilders = [normalHtml, helpHtml]
+
+# match entry in conf.py for htmlhelp_basename
+hhpName = "dabo.hhp"
+
+

Modified: trunk/api/sphinx/makeRST.py
===================================================================
--- trunk/api/sphinx/makeRST.py 2011-02-26 09:59:47 UTC (rev 60)
+++ trunk/api/sphinx/makeRST.py 2011-02-26 14:14:56 UTC (rev 61)
@@ -8,14 +8,10 @@
 sys.setdefaultencoding('utf-8')
 del sys.setdefaultencoding
 
-#import traceback
-import subprocess
-
 import glob
 import inspect
 import operator
 
-#import wx
 import datetime
 import shutil
 import re
@@ -36,7 +32,7 @@
 BACKCOLOUR = (255, 255, 255, 255)
 
 # get config stuff
-from config import *
+import config as sc
 
 # needed for issubclass check
 import dabo
@@ -85,7 +81,7 @@
                                          "dabo.ui.uiwx.uiApp",
                                          ]
 
-# TODO: to be reviewed if there is no cleaner way of doing this
+# needed to make some links work
 daboHackForLinks = {"EventMixin": ".lib.eventMixin.",
                                        "dPemMixin": ".ui.uiwx.",
                                        "dPemMixinBase": ".ui.",
@@ -212,8 +208,8 @@
                                   "__builtin__",
                                        ]
 
-# TODO: the Dabo ones cause import errors, i.e. probably something to do with 
namespace, just exclude them for now
-# TODO: should this be full names, e.g. dabo.ui.uiwx.dPageFrame.onPageChanged?
+# Dabo ones cause import errors, i.e. probably something to do with namespace, 
just exclude them for now
+# TODO: should this be full names, e.g. dabo.ui.uiwx.dPageFrame.onPageChanged 
to be make sure to exclude the right thing?
 excludedFunctions = ["PageFrame", "onPageChanged", "readonly", "main", 
                                         "autoCreateTables", "setupAutoBiz", 
"resetHTML",
                                         "textChangeHandler",
@@ -478,12 +474,12 @@
 
 """
 
-os.chdir(os.path.join(docFolder, "_static"))
+os.chdir(os.path.join(sc.docFolder, "_static"))
 
 fullImages = glob.glob("*.png")# + glob.glob("*.jpg")
 kImages = [os.path.splitext(img)[0] for img in fullImages]
 
-os.chdir(baseFolder)
+os.chdir(sc.baseFolder)
 
 moduleauthor = "\n\n.. moduleauthor:: Dabo community 
<[email protected]>\n\n\n\n"
 
@@ -495,45 +491,6 @@
        return len(word2) - len(word1)
 
 
-def replace_epydoc_links(name, obj, line):
-
-       matches = pattern.findall(line)
-       matches.sort(cmp=bylength)
-
-       classes = lastMethods["class"]
-       newMatches = matches[:]
-
-       for m in matches:
-               newM = "L{%s}"%m
-               for kls, dummy in classes:
-                       if kls.endswith(m):
-                               line = line.replace(newM, ":class:`~%s`"%kls)
-                               newMatches.remove(m)
-                               break
-
-       matches = newMatches[:]
-       methods = lastMethods["method"]
-
-       for m in matches:
-               newM = "L{%s}"%m
-               for kls, method in methods:
-                       if method.endswith(m):
-                               line = line.replace(newM, ":meth:`~%s`"%method)
-                               newMatches.remove(m)
-                               break
-
-       if newMatches:
-               print "\n==================================================="
-               print "UNCONVERTED LINKS IN %s:"%name
-               print "===================================================", 
"\n"
-               for m in newMatches:
-                       print " "*4, m
-
-               print "\n\n"
-
-       return line
-
-
 def MangleDocs(myname, docs, strip=True, replacetabs=True):
 
        if docs:
@@ -568,10 +525,6 @@
                if ":note:" in line:
                        addspace = 1
 
-       for i, line in enumerate(lines):
-               if "L{" in line:
-                       lines[i] = replace_epydoc_links(myname, None, line)
-
        stylesDone, extraDone = False, False
 
        for i, line in enumerate(lines):
@@ -667,7 +620,7 @@
 
 def WriteSphinxFile(name, docs, hasCross=None, moduleData=None, raw=""):
 
-       # TODO: is this to agressive
+       # ignore privat stuff, except __init__
        if "_" in name and not "__init__" in name:
                return
 
@@ -790,7 +743,6 @@
 
                icon = "|doc_title| "
 
-               # TODO: just use tail for title of doc?
                fixName = obj.__module__.split(".")[-1:][0]
                leno = len(fixName) + 15 + len(icon)
                text += "="*leno + "\n**" + fixName + "** functions\n" + 
"="*leno + "\n\n"
@@ -824,7 +776,7 @@
 
 
 def MakeInitDocs(name, raw):
-       os.chdir(rstTempFolder)
+       os.chdir(sc.rstTempFolder)
 
        # prefix topLayer
        tag = topLayer + "." + name
@@ -853,7 +805,7 @@
        """Get the .py files from the folder and generate a .rst file for each 
one found,
        except for the ones defined in "toRemove"
        """
-       os.chdir(folderToDoc)
+       os.chdir(sc.folderToDoc)
        if folder is None:
                otherPython = glob.glob("*.py")
        else:
@@ -870,7 +822,7 @@
                if cItem in otherPython:
                        otherPython.remove(cItem)
 
-       os.chdir(rstTempFolder)
+       os.chdir(sc.rstTempFolder)
 
        for item in otherPython:
                moduleName = topLayer + os.path.sep + os.path.splitext(item)[0]
@@ -1304,7 +1256,6 @@
                        strs += "\n   :noindex:"
                strs += "\n\n"
 
-       # TODO: is this really only getting "__init__"
        for name, item in methodNames:
                strs += describe_func(item, True, modName + "." + kls.__name__)
 
@@ -1528,116 +1479,6 @@
        return "\n".join(newText)
 
 
-def PostProcess(builder):
-
-       os.chdir(baseFolder)
-       folder = os.path.join(os.path.join(baseFolder, "build"), builder + 
'/%s')
-
-       fileNames = glob.glob(folder % "*.html")
-
-       for files in fileNames:
-
-               if "2to3" in files:
-                       continue
-               if "genindex" in files or "modindex" in files:
-                       continue
-
-               fid = open(files, "rt")
-               text = fid.read()
-               fid.close()
-
-               text = text.replace("doc-title-", "")
-               text = text.replace("doc_title  ", "")
-               text = text.replace("<em>doc_title ", "<em>")
-
-               isModule = "_module" in files
-               text = AddPrettyTable(text, isModule, files)
-
-               if folder == helpHtml:
-                       text = AddJS(text)
-
-               text = text.replace('&#8211; <p>', '&#8211; ')
-               text = text.replace('<dl class="method">', '<br><hr />\n<dl 
class="method">')
-               text = text.replace('<dl class="function">', '<br><hr />\n<dl 
class="function">')
-               text = text.replace('<dl class="classmethod">', '<br><hr 
/>\n<dl class="classmethod">')
-               text = text.replace('<dl class="attribute">', '<br><hr />\n<dl 
class="attribute">')
-
-               text = RemoveInheritanceTag(text)
-               text = DeleteSummaryHierarchy(text)
-
-               fid = open(files, "wt")
-               fid.write(text)
-               fid.close()
-
-       fid = open(folder%"index.html", "rt")
-       text = fid.read()
-       fid.close()
-
-       text = text.replace("module ", "")
-       text = text.replace(" library", "")
-
-       lines = text.split("\n")
-       keys = replaces.keys()
-
-       for indx, line in enumerate(lines):
-               for key in keys:
-                       thekey = '<em>%s</em>' % key
-                       repl = '<em>%s</em>'
-                       if thekey in line:
-                               lines[indx] = lines[indx].replace(thekey, repl 
% replaces[key])
-                               break
-
-               if 'src="_images/Stats.png"' in line:
-                       break
-
-       text = "\n".join(lines)
-       fid = open(folder % "index.html", "wt")
-       fid.write(text)
-       fid.close()
-
-       topM = ["general_index", ] + subPackagesMods
-       for f in topM:
-               fileName = folder % f + ".html"
-               if not os.path.isfile(fileName):
-                       continue
-
-               fid = open(fileName, "rt")
-               text = fid.read()
-               fid.close()
-
-               text = text.replace("<em>module ", "<em>")
-               if "general_index" in f:
-                       text = text.replace(" library", "")
-
-               fid = open(folder % f + ".html", "wt")
-               fid.write(text)
-               fid.close()
-
-
-def MakeHTMLHelp(folder):
-
-       print "\nGenerating CHM Help File..."
-       htmlProject = folder % hhcName
-       os.system("%s %s"%(hhcExe, htmlProject))
-       print "CHM help file generated."
-
-       source = folder % chmName
-       dest = normalHtml % chmName
-       shutil.copyfile(source, dest)
-
-
-def MakeBackups():
-
-       fileNames = glob.glob("_build/html/*.html")
-       htmlFiles = glob.glob("_dummyHtml/*.html")
-
-       for files in htmlFiles:
-               os.remove(files)
-
-       for files in fileNames:
-               shutil.copyfile(files, "_dummyHtml/"+os.path.split(files)[1])
-
-
 def WriteGeneralIndex():
 
        fid = open("general_index.rst", "wt")
@@ -1660,7 +1501,7 @@
        fid.write("\n\n")
        
        # now do all the items within each package
-       all = glob.glob(rstTempFolder + "\*.rst")
+       all = glob.glob(sc.rstTempFolder + "\*.rst")
        
        dTop = []
        dBiz = []
@@ -1827,7 +1668,7 @@
 
 def WriteLayout(folder):
 
-       if folder in [normalHtml, singleHtml]:
+       if folder in [sc.normalHtml]:
                layout = htmlLayout
        else:
                layout = otherLayout
@@ -1839,9 +1680,9 @@
 
 def WriteIndex(folder):
 
-       if folder in [normalHtml, singleHtml]:
+       if folder in [sc.normalHtml]:
                fileName = "index_normal.rst"
-       elif folder == helpHtml:
+       elif folder == sc.helpHtml:
                fileName = "index_htmlhelp.rst"
        else:
                fileName = "index_latex.rst"
@@ -1850,14 +1691,19 @@
        text = fid.read()
        fid.close()
 
+       # create the index.rst with the approriate data
        fid = open("source/index.rst", "wt")
        fid.write(text)
        fid.close()
 
-       raw = FindRawModules()
+       # do the magic for the "Tree" button
+       if folder in [sc.normalHtml]:
+               raw = FindRawModules()
+       else:
+               # need the | otherwise we might have transitions "--------" at 
the end of a file, which is not allowed
+               raw = "\n|\n"
        return raw
 
-
 def FindRawModules():
 
        fid = open("_rst_basefiles/tree_module_list.rst", "rt")
@@ -1878,65 +1724,74 @@
        WriteLayout(builder)
        raw = WriteIndex(builder)
 
-       if builder == normalHtml:
+       # create the *_module.rst for top layer and packages
+       MakeInitDocs(topLayer, raw)
+       # create the module docs for the top level
+       MakeModuleDocs(None, raw)
+       # now process all packages defined in subPackages
+       for pkg in subPackages:
+               MakeModuleDocs(pkg, raw)
+               # now the ones for packages in packages
+               if subSubPackages.has_key(pkg):
+                       for sPkg in subSubPackages[pkg]:
+                               MakeModuleDocs(pkg + '.' + sPkg, raw)
 
-               # create the *_module.rst for top layer and packages
-               MakeInitDocs(topLayer, raw)
-               # create the module docs for the top level
-               MakeModuleDocs(None, raw)
-               # now process all packages defined in subPackages
-               for pkg in subPackages:
-                       MakeModuleDocs(pkg, raw)
-                       # now the ones for packages in packages
-                       if subSubPackages.has_key(pkg):
-                               for sPkg in subSubPackages[pkg]:
-                                       MakeModuleDocs(pkg + '.' + sPkg, raw)
+       WriteGeneralIndex()
 
-               WriteGeneralIndex()
-
-
 def FractSec(s):
 
        min, s = divmod(s, 60)
        h, min = divmod(min, 60)
        return h, min, s
 
-
 start = time.time()
 
 args = sys.argv[1:]
 
 if not args:
-       clearOldRst = False
+       builder = 'html'
+       rebuildall = False
 else:
-       # we just assume that is what was wanted
-       clearOldRst = True
+       if len(args) != 2:
+               print "you have to supply two args"
+               print "e.g. 'html True' to use the html builder and force a 
full rebuild"
+               sys.exit(2)
+       else:
+               if args[0] in sc.validBuilders:
+                       builder = args[0]
+               else:
+                       print "builder %s is not valid" % args[0]
+                       sys.exit(2)
+               if args[1].lower() == 'true':
+                       rebuildall = True
+               else:
+                       rebuildall = False
                
 print "================================================"
-print "removing files from previous run in %s" % rstTempFolder
+print "removing files from previous run in %s" % sc.rstTempFolder
 print "================================================"
-remRst = glob.glob(rstTempFolder + "\*.rst")
+remRst = glob.glob(sc.rstTempFolder + "\*.rst")
 for item in remRst:
        os.remove(item)
 
 
-if clearOldRst:
+if rebuildall:
        print "================================================"
-       print "removing files, forcing a full rebuild %s" % docFolder
+       print "removing files, forcing a full rebuild %s" % sc.docFolder
        print "================================================"
 
-       oldRst = glob.glob(docFolder + "\*.rst")
+       oldRst = glob.glob(sc.docFolder + "\*.rst")
        for item in oldRst:
                os.remove(item)
 
 # generate .rst in tempFolder
-MakeRst(normalHtml)
+MakeRst(builder)
 
 # write picture index to a file
 genNote = """This file is generated by makeRST.py and used by genGallery.py,
 please do not change it by hand.
 """
-indexF = open(os.path.join(baseFolder, "galleryToClassIndex.py"), "w")
+indexF = open(os.path.join(sc.baseFolder, "galleryToClassIndex.py"), "w")
 indexF.write("# -*- coding: utf-8 -*-#\n\n")
 indexF.write('"""%s"""\n\n' % genNote)
 indexF.write("pictureIndex = {}\n")
@@ -1949,11 +1804,11 @@
 print "check if file(s) have changed"
 print "========================================"
 
-checkRst = glob.glob(rstTempFolder + "\*.rst")
+checkRst = glob.glob(sc.rstTempFolder + "\*.rst")
 for item in checkRst:
        path, fileName = os.path.split(item)
-       tmpFile = os.path.join(rstTempFolder, fileName)
-       docFile = os.path.join(docFolder, fileName)
+       tmpFile = os.path.join(sc.rstTempFolder, fileName)
+       docFile = os.path.join(sc.docFolder, fileName)
        if os.path.isfile(docFile):
                if not filecmp.cmp(tmpFile, docFile, False):
                        # file has changed, copy it

Modified: trunk/api/sphinx/makeSphinx.py
===================================================================
--- trunk/api/sphinx/makeSphinx.py      2011-02-26 09:59:47 UTC (rev 60)
+++ trunk/api/sphinx/makeSphinx.py      2011-02-26 14:14:56 UTC (rev 61)
@@ -10,13 +10,10 @@
 sys.setdefaultencoding('utf-8')
 del sys.setdefaultencoding
 
-#import traceback
 import subprocess
 
-import glob
+import config as sc
 
-from config import *
-
 def FractSec(s):
 
        min, s = divmod(s, 60)
@@ -27,30 +24,31 @@
        startupinfo = subprocess.STARTUPINFO()
        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
 
-       sourceFolder = docFolder
-       targetFolder = os.path.join(os.path.join(baseFolder, 'build'), builder)
-       confFolder = docFolder
+       sourceFolder = sc.docFolder
+       targetFolder = os.path.join(os.path.join(sc.baseFolder, 'build'), 
builder)
+       confFolder = sc.docFolder
        
-       sErr = os.path.join(baseFolder, "sphinxstderr.txt")
-       sphinxStdErr = open(sErr, 'wt')
-
        if rebuildall:
                # clear targetFolder
                shutil.rmtree(targetFolder, ignore_errors=True)
 
                # TO REBUILD ALL
                # sphinxErrFile is a dup of sphinxStdErr
-               command = sphinxBuildCmd + ' -ac ' + confFolder +' -b '+ 
builder + graphVizDot + sourceFolder +' ' + targetFolder
+               command = sc.sphinxBuildCmd + ' -ac ' + confFolder +' -b '+ 
builder + \
+                               sc.graphVizDot + sourceFolder +' ' + 
targetFolder
        else:
                # TO REBUILD CHANGED
-               command = sphinxBuildCmd + ' -c ' + confFolder +' -b '+ builder 
+ graphVizDot + sourceFolder +' ' + targetFolder
+               command = sc.sphinxBuildCmd + ' -c ' + confFolder +' -b '+ 
builder + \
+                               sc.graphVizDot + sourceFolder +' ' + 
targetFolder
 
-       p = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=None, 
stderr=sphinxStdErr, startupinfo=startupinfo).communicate()
+       p = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=None, 
+                       stderr=sc.sphinxStdErrFile, 
startupinfo=startupinfo).communicate()
 
        if builder == 'htmlhelp':
-               hhpFile = os.path.join(os.path.join(targetFolder), 
'helpdoc.hhp')
-               command = hhpExe + hhpFile
-               p = subprocess.Popen(command, stdin=subprocess.PIPE, 
stdout=None, stderr=sphinxStdErr, startupinfo=startupinfo).communicate()
+               hhpFile = os.path.join(os.path.join(targetFolder), sc.hhpName)
+               command = sc.hhcExe + hhpFile
+               p = subprocess.Popen(command, stdin=subprocess.PIPE, 
stdout=None, 
+                       stderr=sc.sphinxStdErrFile, 
startupinfo=startupinfo).communicate()
 
 
 start = time.time()
@@ -58,7 +56,7 @@
 args = sys.argv[1:]
 
 if not args:
-       builder = normalHtml
+       builder = 'html'
        rebuildall = False
 else:
        if len(args) != 2:
@@ -66,12 +64,12 @@
                print "e.g. 'html True' to use the html builder and force a 
full rebuild"
                sys.exit(2)
        else:
-               if args[0] in ['html',]: # doesn't work yet, 'pdf']:
+               if args[0] in sc.validBuilders:
                        builder = args[0]
                else:
                        print "builder %s is not valid" % args[0]
                        sys.exit(2)
-               if args[1]:
+               if args[1].lower() == 'true':
                        rebuildall = True
                else:
                        rebuildall = False


Property changes on: trunk/api/sphinx/source
___________________________________________________________________
Name: svn:ignore
   + *.rst


Modified: trunk/api/sphinx/source/conf.py
===================================================================
--- trunk/api/sphinx/source/conf.py     2011-02-26 09:59:47 UTC (rev 60)
+++ trunk/api/sphinx/source/conf.py     2011-02-26 14:14:56 UTC (rev 61)
@@ -197,7 +197,7 @@
 #html_file_suffix = None
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'Dabo-Thedesktopapplicationframeworkdoc'
+htmlhelp_basename = 'dabo'
 
 
 # -- Options for LaTeX output 
--------------------------------------------------


Property changes on: trunk/api/sphinx/tempsource
___________________________________________________________________
Name: svn:ignore
   + *.rst




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to