Changeset 4f82183 in sasview for sansguiframe/docs/sphinx


Ignore:
Timestamp:
Aug 9, 2011 8:43:46 AM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
d075f58
Parents:
05d444f
Message:

edit configuration file for sphinx
edit setup.py to properly add data_package
remove unused import

Location:
sansguiframe/docs/sphinx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/docs/sphinx/conf.py

    r2d33e76 r4f82183  
    1717# add these directories to sys.path here. If the directory is relative to the 
    1818# documentation root, use os.path.abspath to make it absolute, like shown here. 
    19 sys.path.append(os.path.abspath(os.path.dirname('../../guiframe'))) 
    20 path = '../../guiframe/local_perspectives/plotting' 
    21 sys.path.append(os.path.abspath(os.path.dirname(path))) 
     19sys.path.append(os.path.abspath(os.path.join('..', '..', 'src'))) 
    2220sys.path.append(os.path.abspath('_extensions')) 
    2321# -- General configuration ----------------------------------------------------- 
  • sansguiframe/docs/sphinx/genmods.py

    r2d33e76 r4f82183  
     1""" 
     2This module generates .rst file for each python file under sans.guiframe. 
     3Please run this file to autogenerate .rst files and build sphinx doc. 
     4 
     5""" 
     6 
     7 
     8 
     9 
    110from __future__ import with_statement 
    211import os.path 
     
    3948 
    4049def genfiles(package, package_name, modules, dir='api'): 
     50    """ 
     51    Generates .rst file for each python module under sans.guiframe 
     52    """ 
    4153 
    4254    if not os.path.exists(dir): 
     
    5264 
    5365 
    54 modules=[ 
    55          ('aboutbox', 'aboutbox'), 
    56     ('config', 'config'), 
    57     ('data_loader', 'data_loader'), 
    58     ('dataFitting', 'dataFitting'), 
    59     ('dummyapp', 'dummyapp'), 
    60     ('gui_manager', 'gui_manager'), 
    61     ('load_thread', 'load_thread'), 
    62     ('statusbar', 'statusbar'), 
    63     ('utils', 'utils'), 
    64     ('version', 'version'), 
    65 ] 
    66 package = 'sans.guiframe' 
    67 package_name='Reference' 
     66def create_module_tuple(path): 
     67    """ 
     68    Create tuples of module  and module name 
     69    :param path: path of the a package directory 
     70    """ 
     71    modules = [] 
     72    list = os.listdir(path) 
     73    for item in list: 
     74        toks = os.path.splitext(os.path.basename(item)) 
     75        if toks[1] == '.py' and toks[0] not in ["__init__"]: 
     76            exec "module = ('%s', '%s')"%(toks[0], toks[0]) 
     77            modules.append(module) 
     78    return modules 
    6879 
    6980if __name__ == "__main__": 
     81    
     82    path = os.path.join('..', '..', 'src', 'sans', 'guiframe') 
     83    modules = create_module_tuple(path) 
     84    package = 'sans.guiframe' 
     85    package_name = 'Reference' 
    7086    genfiles(package, package_name, modules, dir='api') 
    71      
    72     modules=[ 
    73              ('AnnulusSlicer', 'AnnulusSlicer'), 
    74              ('Arc', 'Arc'), 
    75              ('AzimutSlicer', 'AzimutSlicer'), 
    76              ('BaseInteractor', 'BaseInteractor'), 
    77              ('binder', 'binder'), 
    78              ('boxMask', 'boxMask'), 
    79              ('boxSlicer', 'boxSlicer'), 
    80              ('boxSum', 'boxSum'), 
    81              ('detector_dialog', 'detector_dialog'), 
    82              ('Edge', 'Edge'), 
    83              ('masking', 'masking'), 
    84              ('Plotter1D', 'Plotter1D'), 
    85              ('Plotter2D', 'Plotter2D'), 
    86              ('plotting', 'plotting'),  
    87              ('sectorMask', 'sectorMask'), 
    88              ('SectorSlicer', 'SectorSlicer'), 
    89              ('slicerpanel', 'slicerpanel'), 
    90              ('SlicerParameters', 'SlicerParameters'), 
    91              ] 
    92     package = 'sans.guiframe.local_perspectives.plotting' 
    93     package_name = 'Local Perspective: Plotting' 
    94     genfiles(package, package_name, modules, dir='api/local_perspectives/plotting') 
     87    # build local plugin 
     88    for f in os.listdir(path): 
     89        if os.path.isdir(os.path.join(path, f)) and not f.startswith('.') \ 
     90            and f not in ['images', 'media']: 
     91            if f  == "local_perspectives": 
     92                temp = os.path.join(path, f) 
     93                if os.path.isdir(temp): 
     94                    for tf in os.listdir(temp): 
     95                        if os.path.isdir(os.path.join(path, f, tf)) \ 
     96                            and not tf.startswith('.') : 
     97                            package = "sans.guiframe" 
     98                            package += ".local_perspectives.%s" % str(tf) 
     99                            p = os.path.join(path, f, tf) 
     100                            package_name = 'Local Perspective: %s' % str(tf) 
     101                            modules = create_module_tuple(p) 
     102                            dir = os.path.join("api", "local_perspectives", tf) 
     103                            genfiles(package, package_name, modules, dir=dir) 
     104           
    95105    print "Sphinx: generate .rst files complete..." 
    96106     
  • sansguiframe/docs/sphinx/index.rst

    r2d33e76 r4f82183  
    1414   api/index.rst 
    1515   api/local_perspectives/plotting/index.rst 
     16   api/local_perspectives/data_loader/index.rst 
    1617 
    1718Indices and tables 
Note: See TracChangeset for help on using the changeset viewer.