[MOAB-dev] r2940 - in MOAB/trunk/tools/iMesh/python: . doc

jvporter at wisc.edu jvporter at wisc.edu
Tue Jun 9 16:00:40 CDT 2009


Author: jvporter
Date: 2009-06-09 16:00:40 -0500 (Tue, 09 Jun 2009)
New Revision: 2940

Added:
   MOAB/trunk/tools/iMesh/python/setup.cfg.example
Modified:
   MOAB/trunk/tools/iMesh/python/doc/build.rst
   MOAB/trunk/tools/iMesh/python/setup.py
Log:
* Add an example setup.cfg file
* Change --imesh-path to --imesh-dir for consistenty with distutils


Modified: MOAB/trunk/tools/iMesh/python/doc/build.rst
===================================================================
--- MOAB/trunk/tools/iMesh/python/doc/build.rst	2009-06-09 20:00:28 UTC (rev 2939)
+++ MOAB/trunk/tools/iMesh/python/doc/build.rst	2009-06-09 21:00:40 UTC (rev 2940)
@@ -9,16 +9,18 @@
 
 The PyTAPS setup script supports importing definitions from the
 `iMesh-Defs.inc` file. In order to make use of this, specify the command-line
-options ``--imesh-path=PATH`` to the `build_ext` command. For example, if your
+options ``--imesh-dir=PATH`` to the `build_ext` command. For example, if your
 `iMesh-Defs.inc` is located in `/usr/local/iMesh/lib/iMesh-Defs.inc`, then
-``--imesh-path`` should be `/usr/local/iMesh`.  This options may also be
-specified in the `setup.cfg` file (see below). 
+``--imesh-dir`` should be `/usr/local/iMesh`.  This options may also be
+specified in the `setup.cfg` file:
 
+.. literalinclude:: ../setup.cfg.example
+   :language: ini
+
 If the `iMesh-Defs.inc` file was not installed, or you don't wish to use it,
 you can manually specify the build options as described below in `Non-standard
 Library Locations`_.
 
-
 Requirements
 ============
 
@@ -66,5 +68,6 @@
 In some cases, required objects for building PyTAPS aren't in the expected
 directories. One solution to this is to include the appropriate directories in
 the environment variables ``CPATH`` and ``PYTHONPATH``. Another, more flexible
-method is to use the ``setup.cfg`` file. Information on how to use this file can
-be found in the official Python `documentation <http://docs.python.org/install/index.html#distutils-configuration-files>`_.
+method is to use the `setup.cfg` file. Information on how to use this file can
+be found in the official Python `documentation
+<http://docs.python.org/install/index.html#distutils-configuration-files>`_.

Added: MOAB/trunk/tools/iMesh/python/setup.cfg.example
===================================================================
--- MOAB/trunk/tools/iMesh/python/setup.cfg.example	                        (rev 0)
+++ MOAB/trunk/tools/iMesh/python/setup.cfg.example	2009-06-09 21:00:40 UTC (rev 2940)
@@ -0,0 +1,3 @@
+[build_ext]
+include-dirs = /path/to/include
+imesh-dir = /path/to/imesh
\ No newline at end of file

Modified: MOAB/trunk/tools/iMesh/python/setup.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/setup.py	2009-06-09 20:00:28 UTC (rev 2939)
+++ MOAB/trunk/tools/iMesh/python/setup.py	2009-06-09 21:00:40 UTC (rev 2940)
@@ -1,13 +1,12 @@
 from distutils.core import setup, Extension, Command
 from distutils.sysconfig import parse_makefile
 from distutils.errors import DistutilsOptionError
+from distutils.command.build_ext import build_ext
 from unittest import TextTestRunner, TestLoader
 import re
 import os
 import sys
 
-from distutils.command.build_ext import build_ext
-
 def pair_fun(pre, post):
     def tmp(self):
         pre(self)
@@ -15,8 +14,8 @@
     return tmp
 
 def new_run(self):
-    if self.imesh_path:
-        defs = parse_makefile( os.path.join(self.imesh_path,
+    if self.imesh_dir:
+        defs = parse_makefile( os.path.join(self.imesh_dir,
                                             'lib/iMesh-Defs.inc') )
 
         lib_match = re.compile(r'(?:(?<=\s)|^)-([lL])\s*(\S*)')
@@ -31,9 +30,9 @@
             self.include_dirs.append( match.group(2) )
 
 def new_init(self):
-    self.imesh_path = None
+    self.imesh_dir = None
 
-build_ext.user_options.append(('imesh-path=', None, 'blah blah'))
+build_ext.user_options.append(('imesh-dir=', None, 'blah blah'))
 build_ext.initialize_options = pair_fun(new_init, build_ext.initialize_options)
 build_ext.run = pair_fun(new_run, build_ext.run)
 



More information about the moab-dev mailing list