Changeset 153b75a in sasview


Ignore:
Timestamp:
Sep 4, 2018 11:37:06 AM (3 weeks ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, bad_file_loader_fix, ticket-1094-headless, ticket-1111
Children:
170b251
Parents:
5d43213
Message:

doc build linting

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r1b605fb r153b75a  
    3434/docs/sphinx-docs/build 
    3535/docs/sphinx-docs/source-temp 
    36 /docs/sphinx-docs/source/dev/api 
    37 /docs/sphinx-docs/source/user/guiframe 
    38 /docs/sphinx-docs/source/user/models 
    39 /docs/sphinx-docs/source/user/sasview 
    40 /docs/sphinx-docs/source/user/perspectives 
    4136/docs/sphinx-docs/katex*.zip 
    4237/docs/sphinx-docs/node_modules 
  • docs/sphinx-docs/build_sphinx.py

    rdf72475 r153b75a  
    88from __future__ import print_function 
    99 
    10 import subprocess 
     10import sys 
    1111import os 
    1212from os.path import join as joinpath, abspath, dirname, isdir, exists, relpath 
    13 import sys 
    14 import fnmatch 
    1513import shutil 
     14import subprocess 
    1615import imp 
    17  
    1816from glob import glob 
    1917from distutils.dir_util import copy_tree 
     
    2119from distutils.spawn import find_executable 
    2220 
    23 from shutil import copy 
    24 from os import listdir 
    25  
    26 platform = '.%s-%s'%(get_platform(),sys.version[:3]) 
     21PLATFORM = '.%s-%s'%(get_platform(), sys.version[:3]) 
    2722 
    2823# sphinx paths 
     
    3530SASVIEW_ROOT = joinpath(SPHINX_ROOT, '..', '..') 
    3631SASVIEW_DOCS = joinpath(SPHINX_ROOT, "source") 
    37 SASVIEW_BUILD = abspath(joinpath(SASVIEW_ROOT, "build", "lib"+platform)) 
     32SASVIEW_BUILD = abspath(joinpath(SASVIEW_ROOT, "build", "lib"+PLATFORM)) 
    3833SASVIEW_MEDIA_SOURCE = joinpath(SASVIEW_ROOT, "src", "sas") 
    3934SASVIEW_DOC_TARGET = joinpath(SASVIEW_BUILD, "doc") 
     
    6560 
    6661def inplace_change(filename, old_string, new_string): 
    67 # Thanks to http://stackoverflow.com/questions/4128144/replace-string-within-file-contents 
    68         s=open(filename).read() 
    69         if old_string in s: 
    70                 print('Changing "{old_string}" to "{new_string}"'.format(**locals())) 
    71                 s=s.replace(old_string, new_string) 
    72                 f=open(filename, 'w') 
    73                 f.write(s) 
    74                 f.flush() 
    75                 f.close() 
    76         else: 
    77                 print('No occurences of "{old_string}" found.'.format(**locals())) 
     62    # Thanks to http://stackoverflow.com/questions/4128144/replace-string-within-file-contents 
     63    s = open(filename).read() 
     64    if old_string in s: 
     65        print('Changing "{old_string}" to "{new_string}"'.format(**locals())) 
     66        s = s.replace(old_string, new_string) 
     67        with open(filename, 'w') as f: 
     68            f.write(s) 
     69    else: 
     70        print('No occurences of "{old_string}" found.'.format(**locals())) 
    7871 
    7972def _remove_dir(dir_path): 
     
    241234        finally: 
    242235            fd_in.close() 
    243     with ZipFile(cache_path) as zip: 
    244         zip.extractall(destination) 
     236    with ZipFile(cache_path) as archive: 
     237        archive.extractall(destination) 
    245238 
    246239def convert_katex(): 
  • docs/sphinx-docs/source/conf.py

    ra8bbba2 r153b75a  
    1111# All configuration values have a default; values that are commented out 
    1212# serve to show the default. 
     13from __future__ import print_function 
    1314 
    1415import sys, os, collections 
     
    2223sys.path.insert(0, build_lib) 
    2324sys.path.insert(0, os.path.abspath('_extensions')) # for sphinx extensions 
    24 print "-- path --" 
    25 print "\n".join(sys.path) 
     25print("-- path --") 
     26print("\n".join(sys.path)) 
    2627 
    2728# -- General configuration ----------------------------------------------------- 
  • docs/sphinx-docs/source/rst_prolog

    r1659f54 r153b75a  
     1.. TODO: This file is ignored!  Prolog comes from sasmodels/doc/rst_prolog. 
     2 
    13.. Set up some substitutions to make life easier... 
    24 
Note: See TracChangeset for help on using the changeset viewer.