Changeset 4f82183 in sasview


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
Files:
4 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 
  • sansguiframe/src/setup.py

    r2ec6228 r4f82183  
    11 
    22""" 
    3     Installs the guiframe package 
     3Installs the guiframe package 
    44""" 
    55 
    6      
    7 from distutils.core import setup, Extension 
     6from distutils.core import setup 
     7import os 
    88 
    9 from distutils.sysconfig import get_python_lib 
    10 import os 
    11 import sys 
     9path = os.path.join(os.getcwd(), "sans", "guiframe",'local_perspectives') 
     10package_dir = {"sans.guiframe":os.path.join("sans", "guiframe"), 
     11               "sans.guiframe.local_perspectives":os.path.join("sans", 
     12                                                        "guiframe", 
     13                                                        "local_perspectives"),} 
    1214 
    13  
    14      
    15 path = os.path.join(os.getcwd(), 'local_perspectives') 
    16 package_dir = { "sans.guiframe":".", 
    17                 "sans.guiframe.local_perspectives":"local_perspectives", 
    18                 #"sans.guiframe.images":"images", 
    19                # "sans.guiframe.media":"media", 
    20                 } 
    21 #package_data = {"sans.guiframe": ['images/*'], 
    22 #                "sans.guiframe":'media/*']} 
    2315package_data = {"sans.guiframe": ['images/*', 'media/*']} 
    2416packages = ["sans.guiframe",  
     
    2921        package_name = "sans.guiframe.local_perspectives." + dir 
    3022        packages.append(package_name) 
    31         package_dir[package_name] = "local_perspectives/" + dir 
     23        package_dir[package_name] = os.path.join("sans",  
     24                                                 "guiframe", 
     25                                                 "local_perspectives" , dir) 
    3226 
    3327 
    3428setup( 
    35     name="guiframe", 
     29    name="sans.guiframe", 
    3630    version = "0.9.1", 
    3731    description = "Python module for SANS gui framework", 
    3832    author = "University of Tennessee", 
    3933    url = "http://danse.chem.utk.edu", 
    40      
    4134    package_dir = package_dir, 
    42  
    4335    packages = packages, 
    4436    package_data = package_data, 
    45  
    4637    ) 
Note: See TracChangeset for help on using the changeset viewer.