Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create the Sphinx conf.py file when building the docs on Windows.

  • Loading branch information...
commit a006a21473fa9d19a1e50e9e00520118583ab003 1 parent 6dac173
@akshay-joshi akshay-joshi authored dpage committed
Showing with 32 additions and 2 deletions.
  1. +1 −0  Makefile.am
  2. +2 −2 docs/Docs.vcproj
  3. +29 −0 docs/createConf.vbs
View
1  Makefile.am
@@ -31,6 +31,7 @@ EXTRA_DIST = \
$(top_srcdir)/stringmerge \
$(top_srcdir)/docs/Docs.vcproj \
$(top_srcdir)/docs/builddocs.bat \
+ $(top_srcdir)/docs/createConf.vbs \
$(top_srcdir)/docs/en_US/*.rst \
$(top_srcdir)/docs/en_US/conf.py.in \
$(top_srcdir)/docs/en_US/images/*.png
View
4 docs/Docs.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="Docs"
ProjectGUID="{CFAD4001-CC90-415E-87AC-1A85446BFA54}"
RootNamespace="Docs"
@@ -29,7 +29,7 @@
<Tool
Name="VCCustomBuildTool"
Description="Calling help build script..."
- CommandLine="builddocs.bat&#x0D;&#x0A;"
+ CommandLine="createConf.vbs &#x0D;&#x0A;builddocs.bat&#x0D;&#x0A;"
AdditionalDependencies=""
Outputs=".\en_US\pgadmin3.chm;.\en_US\pgadmin3.hhp.cached"
/>
View
29 docs/createConf.vbs
@@ -0,0 +1,29 @@
+Set objFS = CreateObject("Scripting.FileSystemObject")
+
+' *********** Read the version from version.h ***********
+strFile= "..\pgadmin\include\version.h"
+Set objFile = objFS.OpenTextFile(strFile, 1)
+Do Until objFile.AtEndOfStream
+ strLine = objFile.ReadLine
+ If InStr(strLine,"#define VERSION_PACKAGE")> 0 then
+ strLongToken= split(strLine)
+ strLongVer = strLongToken(2)
+ End If
+Loop
+objFile.Close
+strShortToken = split(strLongVer, ".")
+strShortVer = strShortToken(0) & "." & strShortToken(1)
+
+' ********** Copy the conf.py.in file as conf.py *********
+objFS.Copyfile "en_US\conf.py.in" , "en_US\conf.py"
+
+' ****** Replace the Long and Short version in conf.py file ******
+strConfFile = "en_US\conf.py"
+Set objConfFile = objFS.OpenTextFile(strConfFile, 1)
+strText = objConfFile.ReadAll
+objConfFile.Close
+strText = Replace(strText, "PGADMIN_LONG_VERSION", strLongVer)
+strText = Replace(strText, "PGADMIN_SHORT_VERSION", strShortVer)
+Set objConfFile = objFS.OpenTextFile(strConfFile, 2)
+objConfFile.WriteLine strText
+objConfFile.Close
Please sign in to comment.
Something went wrong with that request. Please try again.