Changeset 5420ef6 in sasview


Ignore:
Timestamp:
Mar 21, 2016 2:03:30 PM (9 years ago)
Author:
smk78
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
5a71761
Parents:
9274711
Message:

Fix to docs build errors resulting from reorganisation of image file
locations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/sphinx-docs/build_sphinx.py

    rf603bec r5420ef6  
    3838SASMODELS_SOURCE_MODELS = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "model") 
    3939SASMODELS_SOURCE_IMG = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "model", "img") 
     40SASMODELS_SOURCE_AUTOIMG = os.path.join(CURRENT_SCRIPT_DIR, "..", "..", "..", "sasmodels", "doc", "_build", "html","_images") 
    4041SASMODELS_DEST_PROLOG = os.path.join(CURRENT_SCRIPT_DIR, "source") 
    4142SASMODELS_DEST_REF_MODELS = os.path.join(CURRENT_SCRIPT_DIR, "source", "user") 
    4243SASMODELS_DEST_MODELS = os.path.join(CURRENT_SCRIPT_DIR, "source", "user", "models") 
    4344SASMODELS_DEST_IMG = os.path.join(CURRENT_SCRIPT_DIR,  "source", "user", "model-imgs", "new-models") 
     45SASMODELS_DEST_BUILDIMG = os.path.join(CURRENT_SCRIPT_DIR,  "source", "user", "models", "img") 
    4446 
    4547#if os.path.exists(SASMODELS_SOURCE_PROLOG): 
     
    145147    print "=== And the Sasmodels Docs ==="  
    146148    # Make sure we have the relevant images for the new sasmodels documentation 
     149    # First(!) we'll make a local reference copy for SasView (/new-models will be cleaned each build) 
    147150    if os.path.exists(SASMODELS_SOURCE_IMG): 
    148151        print "Found img  folder SASMODELS_SOURCE_IMG    at ", SASMODELS_SOURCE_IMG 
     
    155158                shutil.copy(fromhere,tohere) 
    156159 
     160    if os.path.exists(SASMODELS_SOURCE_AUTOIMG): 
     161        print "Found img  folder SASMODELS_SOURCE_AUTOIMG    at ", SASMODELS_SOURCE_AUTOIMG 
     162        if os.path.exists(SASMODELS_DEST_IMG): 
     163            print "Copying sasmodels model auto-generated image files..." 
     164            for files in os.listdir(SASMODELS_SOURCE_AUTOIMG): 
     165                fromhere=os.path.join(SASMODELS_SOURCE_AUTOIMG,files) 
     166                tohere=os.path.join(SASMODELS_DEST_IMG,files) 
     167                shutil.copy(fromhere,tohere) 
     168     
    157169    # And the rst prolog with the unit substitutions 
    158170    if os.path.exists(SASMODELS_SOURCE_PROLOG): 
     
    203215                    tohere=os.path.join(SASMODELS_DEST_MODELS,files) 
    204216                    shutil.copy(fromhere,tohere) 
     217        else: 
     218            print "Missing docs folder SASMODELS_DEST_MODELS at ", SASMODELS_DEST_MODELS 
     219            os.makedirs(SASMODELS_DEST_MODELS) 
     220            if not os.path.exists(SASMODELS_DEST_BUILDIMG): 
     221                os.makedirs(SASMODELS_DEST_BUILDIMG) 
     222            print "Created docs folder SASMODELS_DEST_MODELS at ", SASMODELS_DEST_MODELS 
     223            print "Copying model files for build..." 
     224            for files in os.listdir(SASMODELS_SOURCE_MODELS): 
     225                if files.endswith(".rst"): 
     226                    fromhere=os.path.join(SASMODELS_SOURCE_MODELS,files) 
     227                    tohere=os.path.join(SASMODELS_DEST_MODELS,files) 
     228                    shutil.copy(fromhere,tohere) 
     229            # No choice but to do this because model files are all coded for images in /models/img 
     230            print "Copying image files for build..." 
     231            for files in os.listdir(SASMODELS_DEST_IMG): 
     232                fromhere=os.path.join(SASMODELS_DEST_IMG,files) 
     233                tohere=os.path.join(SASMODELS_DEST_BUILDIMG,files) 
     234                shutil.copy(fromhere,tohere) 
    205235 
    206236 
Note: See TracChangeset for help on using the changeset viewer.