mirror of
https://github.com/arsenetar/dupeguru.git
synced 2024-10-31 22:05:58 +00:00
Added a --only-help option to build.py
This commit is contained in:
parent
2c127adf59
commit
f02fcb5e4b
34
build.py
34
build.py
@ -9,6 +9,7 @@
|
||||
|
||||
import os
|
||||
import os.path as op
|
||||
from optparse import OptionParser
|
||||
import shutil
|
||||
import json
|
||||
|
||||
@ -19,6 +20,14 @@ from hscommon import sphinxgen
|
||||
from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, ensure_empty_folder,
|
||||
filereplace, get_module_version, build_all_cocoa_locs, build_all_qt_locs)
|
||||
|
||||
def parse_args():
|
||||
usage = "usage: %prog [options]"
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option('--only-help', action='store_true', dest='only_help',
|
||||
help="Build only help file")
|
||||
(options, args) = parser.parse_args()
|
||||
return options
|
||||
|
||||
def build_cocoa(edition, dev):
|
||||
build_all_cocoa_locs('cocoalib')
|
||||
build_all_cocoa_locs(op.join('cocoa', 'base'))
|
||||
@ -85,7 +94,7 @@ def build_qt(edition, dev):
|
||||
run_contents = tmpl.replace('{{edition}}', edition)
|
||||
open('run.py', 'wt').write(run_contents)
|
||||
|
||||
def build_help(edition, ui, dev):
|
||||
def build_help(edition):
|
||||
print("Generating Help")
|
||||
current_path = op.abspath('.')
|
||||
help_basepath = op.join(current_path, 'help', 'en')
|
||||
@ -134,15 +143,8 @@ def build_pe_modules(ui):
|
||||
move('_block_qt.so', op.join('qt', 'pe', '_block_qt.so'))
|
||||
move('_block_qt.pyd', op.join('qt', 'pe', '_block_qt.pyd'))
|
||||
|
||||
def main():
|
||||
conf = json.load(open('conf.json'))
|
||||
edition = conf['edition']
|
||||
ui = conf['ui']
|
||||
dev = conf['dev']
|
||||
def build_normal(edition, ui, dev):
|
||||
print("Building dupeGuru {0} with UI {1}".format(edition.upper(), ui))
|
||||
ensure_empty_folder('build')
|
||||
if dev:
|
||||
print("Building in Dev mode")
|
||||
add_to_pythonpath('.')
|
||||
build_help(edition, ui, dev)
|
||||
print("Building dupeGuru")
|
||||
@ -153,5 +155,19 @@ def main():
|
||||
elif ui == 'qt':
|
||||
build_qt(edition, dev)
|
||||
|
||||
def main():
|
||||
options = parse_args()
|
||||
conf = json.load(open('conf.json'))
|
||||
edition = conf['edition']
|
||||
ui = conf['ui']
|
||||
dev = conf['dev']
|
||||
if dev:
|
||||
print("Building in Dev mode")
|
||||
ensure_empty_folder('build')
|
||||
if options.only_help:
|
||||
build_help(edition)
|
||||
else:
|
||||
build_normal(edition, ui, dev)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user