Changeset 1297

Show
Ignore:
Timestamp:
05/22/07 02:34:30 (2 years ago)
Author:
arj..@yirdis.nl
Message:

Deleted gaphor/misc/action.py.

Added documentation support using epydoc.
epydoc should be installed (not installed as a dependency).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/setup.py

    r1279 r1297  
    1010VERSION = '0.10.5' 
    1111 
     12import os 
    1213import sys 
    1314sys.path.insert(0, '.') 
     
    1819 
    1920from setuptools import setup, find_packages 
     21from distutils.cmd import Command 
    2022 
    2123from utils.command.build_mo import build_mo 
     
    2729LINGUAS = [ 'ca', 'es', 'nl', 'sv' ] 
    2830 
     31class build_doc(Command): 
     32    description = 'Builds the documentation' 
     33    user_options = [] 
     34 
     35    def initialize_options(self): 
     36        pass 
     37 
     38    def finalize_options(self): 
     39        pass 
     40 
     41    def run(self): 
     42#        from docutils.core import publish_cmdline 
     43#        docutils_conf = os.path.join('doc', 'docutils.conf') 
     44        epydoc_conf = os.path.join('doc', 'epydoc.conf') 
     45 
     46#        for source in glob('doc/*.txt'): 
     47#            dest = os.path.splitext(source)[0] + '.html' 
     48#            if not os.path.exists(dest) or \ 
     49#                   os.path.getmtime(dest) < os.path.getmtime(source): 
     50#                print 'building documentation file %s' % dest 
     51#                publish_cmdline(writer_name='html', 
     52#                                argv=['--config=%s' % docutils_conf, source, 
     53#                                      dest]) 
     54 
     55        try: 
     56            from epydoc import cli 
     57            old_argv = sys.argv[1:] 
     58            sys.argv[1:] = [ 
     59                '--config=%s' % epydoc_conf, 
     60                '--no-private', # epydoc bug, not read from config 
     61                '--simple-term', 
     62                '--verbose' 
     63            ] 
     64            cli.cli() 
     65            sys.argv[1:] = old_argv 
     66 
     67        except ImportError: 
     68            print 'epydoc not installed, skipping API documentation.' 
    2969 
    3070setup( 
     
    101141              'build_mo': build_mo, 
    102142              'build_pot': build_pot, 
     143              'build_doc': build_doc, 
    103144              'install_lib': install_lib, 
    104145              'run': run,