Changeset 5dd7499 in sasview


Ignore:
Timestamp:
Oct 6, 2016 7:07:24 PM (5 years ago)
Author:
ajj
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b61bd57
Parents:
2a07053
Message:

Fixing sphinx build to assemble documents out of source tree to avoid pollution

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    rbf75f78 r5dd7499  
    4141 
    4242/docs/sphinx-docs/build 
     43/docs/sphinx-docs/source-temp 
    4344/docs/sphinx-docs/source/dev/api 
    4445/docs/sphinx-docs/source/user/guiframe 
  • docs/sphinx-docs/build_sphinx.py

    r578a11d r5dd7499  
    3030SASVIEW_DOCS = os.path.join(SASVIEW_BUILD, "doc") 
    3131SASVIEW_TEST = os.path.join(SASVIEW_SRC, "..", "sasview", "test", "media") 
     32SASVIEW_TOC_SOURCE = os.path.join(CURRENT_SCRIPT_DIR, "source") 
    3233 
    3334# Need to slurp in the new sasmodels model definitions to replace the old model_functions.rst 
     
    4243SASMODELS_SOURCE_IMG = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "model", "img") 
    4344SASMODELS_SOURCE_AUTOIMG = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "_build", "html","_images") 
    44 SASMODELS_DEST_PROLOG = os.path.join(CURRENT_SCRIPT_DIR, "source") 
    45 SASMODELS_DEST_REF_MODELS = os.path.join(CURRENT_SCRIPT_DIR, "source", "user") 
    46 SASMODELS_DEST_MODELS = os.path.join(CURRENT_SCRIPT_DIR, "source", "user", "models") 
    47 SASMODELS_DEST_IMG = os.path.join(CURRENT_SCRIPT_DIR,  "source", "user", "model-imgs", "new-models") 
    48 SASMODELS_DEST_MAGIMG = os.path.join(CURRENT_SCRIPT_DIR,  "source", "user", "mag_img") 
    49 SASMODELS_DEST_BUILDIMG = os.path.join(CURRENT_SCRIPT_DIR,  "source", "user", "models", "img") 
     45## Don't do assemble-in-place 
     46## Assemble the docs in a temporary folder 
     47SASMODELS_DEST_PROLOG = os.path.join(CURRENT_SCRIPT_DIR, "source-temp") 
     48SASMODELS_DEST_REF_MODELS = os.path.join(SASMODELS_DEST_PROLOG, "user") 
     49SASMODELS_DEST_MODELS = os.path.join(SASMODELS_DEST_PROLOG, "user", "models") 
     50SASMODELS_DEST_IMG = os.path.join(SASMODELS_DEST_PROLOG, "user", "model-imgs", "new-models") 
     51SASMODELS_DEST_MAGIMG = os.path.join(SASMODELS_DEST_PROLOG, "user", "mag_img") 
     52SASMODELS_DEST_BUILDIMG = os.path.join(SASMODELS_DEST_PROLOG, "user", "models", "img") 
    5053 
    5154#if os.path.exists(SASMODELS_SOURCE_PROLOG): 
     
    6669 
    6770SPHINX_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") 
    68 SPHINX_SOURCE = os.path.join(CURRENT_SCRIPT_DIR, "source") 
     71SPHINX_SOURCE = os.path.join(CURRENT_SCRIPT_DIR, "source-temp") 
    6972SPHINX_SOURCE_API = os.path.join(SPHINX_SOURCE, "dev", "api") 
    7073SPHINX_SOURCE_GUIFRAME = os.path.join(SPHINX_SOURCE, "user", "sasgui", "guiframe") 
     
    104107    _remove_dir(SASVIEW_DOCS) 
    105108    _remove_dir(SPHINX_BUILD) 
    106     _remove_dir(SPHINX_SOURCE_GUIFRAME) 
    107     _remove_dir(SPHINX_SOURCE_MODELS) 
    108     _remove_dir(SPHINX_SOURCE_PERSPECTIVES) 
    109     _remove_dir(SPHINX_SOURCE_TEST) 
    110  
     109    _remove_dir(SPHINX_SOURCE) 
     110    #_remove_dir(SPHINX_SOURCE_GUIFRAME) 
     111    #_remove_dir(SPHINX_SOURCE_MODELS) 
     112    #_remove_dir(SPHINX_SOURCE_PERSPECTIVES) 
     113    #_remove_dir(SPHINX_SOURCE_TEST) 
     114 
     115def setup_source_temp(): 
     116    """ 
     117    Copy the source toctrees to new folder for assembling the sphinx-docs 
     118    """ 
     119    print "=== Copying Source toctrees ===" 
     120    if os.path.exists(SASVIEW_TOC_SOURCE): 
     121       print "Found docs folder at ", SASVIEW_TOC_SOURCE 
     122       shutil.copytree(SASVIEW_TOC_SOURCE, SPHINX_SOURCE) 
    111123 
    112124def retrieve_user_docs(): 
     
    336348def rebuild(): 
    337349    clean() 
     350    setup_source_temp() 
    338351    retrieve_user_docs() 
    339352    retrieve_bumps_docs() 
Note: See TracChangeset for help on using the changeset viewer.