Skip to content

Commit

Permalink
Build docs prior to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
g-sherman committed Sep 25, 2014
1 parent 8c785e7 commit 4f51307
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions pb_tool/pb_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def deploy():
print """Deploying will:
* Remove your currently deployed version
* Compile the ui and resource files
* Build the help docs
* Copy everything to the .qgis/python/plugins directory
"""

Expand All @@ -52,8 +53,7 @@ def deploy():
# compile to make sure everything is fresh
print 'Compiling to make sure install is clean'
compile_files()
#click.echo('Deploying it')
# get the cfg
build_docs()
install_files = get_install_files()
# make the plugin directory if it doesn't exist
if not os.path.exists(plugin_dir):
Expand All @@ -71,7 +71,7 @@ def deploy():
print "Copying {} to {}".format(help_src, help_target)
shutil.copytree(help_src, help_target)
except OSError as oops:
print "Error copying files: {}".format(oops.strerror)
print "Error copying files: {}, {}".format(file, oops.strerror)
print "To ensure proper deployment, delete the deployed plugin before continuing."


Expand Down Expand Up @@ -122,17 +122,23 @@ def compile():
"""
compile_files()


@cli.command()
def doc():
build_docs()

def build_docs():
""" Build the docs using sphinx"""
if os.path.exists('help'):
click.echo('Building the help documentation')
if sys.platform == 'win32':
makeprg = 'make.bat'
else:
makeprg = 'make'
cwd = os.getcwd()
os.chdir('help')
subprocess.check_call([makeprg, 'html'])
os.chdir(cwd)
else:
print "No help directory exists in the current directory"

Expand Down
4 changes: 2 additions & 2 deletions test_plugin/pb_tool.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ name=icontest

[files]
# python files that should be deployed with the plugin
python_files: icontest.py icontest_dialog.py
python_files: icontest.py icontest_dialog.py __init__.py

# the main dialog file that is loaded (not compiled)
main_dialog: icontest_dialog_base.ui

# other ui files for your dialogs (these will be compiled)
compiled_ui_files: icontest_dialog_base.ui
compiled_ui_files:

# resource file(s) that will be compiled
resource_files: resources.qrc
Expand Down

0 comments on commit 4f51307

Please sign in to comment.