1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

Changed sphinxgen's mechanism so that we don't have to copy the whole sphinx source dir every time we generate help.

--HG--
rename : help/en/changelog.rst => help/en/changelog.tmpl
rename : help/en/conf.py => help/en/conf.tmpl
rename : help/fr/changelog.rst => help/fr/changelog.tmpl
rename : help/fr/conf.py => help/fr/conf.tmpl
This commit is contained in:
Virgil Dupras 2011-01-22 17:06:04 +01:00
parent f9e7e82772
commit b6f56721cb
6 changed files with 14 additions and 7 deletions

View File

@ -18,4 +18,6 @@ cocoa/*/build
cocoa/*/dg_cocoa.plugin cocoa/*/dg_cocoa.plugin
qt/base/*_rc.py qt/base/*_rc.py
qt/lang/fr.qm qt/lang/fr.qm
qt/lang/en.qm qt/lang/en.qm
help/*/conf.py
help/*/changelog.rst

View File

@ -17,12 +17,14 @@ from setuptools import setup
from distutils.extension import Extension from distutils.extension import Extension
from hscommon import sphinxgen from hscommon import sphinxgen
from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, ensure_empty_folder, from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages,
filereplace, get_module_version, build_all_cocoa_locs, build_all_qt_locs) filereplace, get_module_version, build_all_cocoa_locs, build_all_qt_locs)
def parse_args(): def parse_args():
usage = "usage: %prog [options]" usage = "usage: %prog [options]"
parser = OptionParser(usage=usage) parser = OptionParser(usage=usage)
parser.add_option('--clean', action='store_true', dest='clean',
help="Clean build folder before building")
parser.add_option('--only-help', action='store_true', dest='only_help', parser.add_option('--only-help', action='store_true', dest='only_help',
help="Build only help file") help="Build only help file")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
@ -98,14 +100,13 @@ def build_help(edition):
print("Generating Help") print("Generating Help")
current_path = op.abspath('.') current_path = op.abspath('.')
help_basepath = op.join(current_path, 'help', 'en') help_basepath = op.join(current_path, 'help', 'en')
help_buildpath = op.join(current_path, 'build', 'sphinx_src'.format(edition))
help_destpath = op.join(current_path, 'build', 'help'.format(edition)) help_destpath = op.join(current_path, 'build', 'help'.format(edition))
changelog_path = op.join(current_path, 'help', 'changelog_{}'.format(edition)) changelog_path = op.join(current_path, 'help', 'changelog_{}'.format(edition))
tixurl = "https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}" tixurl = "https://hardcoded.lighthouseapp.com/projects/31699-dupeguru/tickets/{0}"
appname = {'se': 'dupeGuru', 'me': 'dupeGuru Music Edition', 'pe': 'dupeGuru Picture Edition'}[edition] appname = {'se': 'dupeGuru', 'me': 'dupeGuru Music Edition', 'pe': 'dupeGuru Picture Edition'}[edition]
homepage = 'http://www.hardcoded.net/dupeguru{}/'.format('_' + edition if edition != 'se' else '') homepage = 'http://www.hardcoded.net/dupeguru{}/'.format('_' + edition if edition != 'se' else '')
confrepl = {'edition': edition, 'appname': appname, 'homepage': homepage} confrepl = {'edition': edition, 'appname': appname, 'homepage': homepage}
sphinxgen.gen(help_basepath, help_buildpath, help_destpath, changelog_path, tixurl, confrepl) sphinxgen.gen(help_basepath, help_destpath, changelog_path, tixurl, confrepl)
def build_pe_modules(ui): def build_pe_modules(ui):
def move(src, dst): def move(src, dst):
@ -163,7 +164,11 @@ def main():
dev = conf['dev'] dev = conf['dev']
if dev: if dev:
print("Building in Dev mode") print("Building in Dev mode")
ensure_empty_folder('build') if options.clean:
if op.exists('build'):
shutil.rmtree('build')
if not op.exists('build'):
os.mkdir('build')
if options.only_help: if options.only_help:
build_help(edition) build_help(edition)
else: else:

View File

@ -127,7 +127,7 @@ html_theme = 'default'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] # html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. # using the given strftime format.

View File

@ -127,7 +127,7 @@ html_theme = 'default'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] # html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. # using the given strftime format.