setup.py :  » Parser » SimpleParse » SimpleParse-2.1.1a2 » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Parser » SimpleParse 
SimpleParse » SimpleParse 2.1.1a2 » setup.py
#!/usr/bin/env python
"""Installs SimpleParse using distutils

Run:
  python setup.py install
to install the packages from the source archive.
"""
from setuptools import setup,Extension
import os, sys, string

def findVersion( ):
  a = {}
  exec( open( '__init__.py' ).read(), a, a )
  return a['__version__']

def isPackage( filename ):
  """Is the given filename a Python package"""
  return (
    os.path.isdir(filename) and 
    os.path.isfile( os.path.join(filename,'__init__.py'))
  )
def packagesFor( filename, basePackage="" ):
  """Find all packages in filename"""
  set = {}
  for item in os.listdir(filename):
    dir = os.path.join(filename, item)
    if string.lower(item) != 'cvs' and isPackage( dir ):
      if basePackage:
        moduleName = basePackage+'.'+item
      else:
        moduleName = item
      set[ moduleName] = dir
      set.update( packagesFor( dir, moduleName))
  return set

packages = packagesFor( ".", 'simpleparse' )
packages.update( {'simpleparse':'.'} )

options = {
  'sdist': { 'force_manifest':1,'formats':['gztar','zip'] },
}
if sys.platform == 'win32':
  options.setdefault(
    'build_ext',{}
  )['define'] = 'BAD_STATIC_FORWARD'

if __name__ == "__main__":
  from sys import hexversion
  if hexversion >= 0x2030000:
    # work around distutils complaints under Python 2.2.x
    extraArguments = {
      'classifiers': [
        """Programming Language :: Python""",
        """Topic :: Software Development :: Libraries :: Python Modules""",
        """Intended Audience :: Developers""",
      ],
      'keywords': 'parse,parser,parsing,text,ebnf,grammar,generator',
      'long_description' : """A Parser Generator for Python (w/mxTextTools derivative)

Provides a moderately fast parser generator for use with Python,
includes a forked version of the mxTextTools text-processing library
modified to eliminate recursive operation and fix a number of 
undesirable behaviours.

Converts EBNF grammars directly to single-pass parsers for many
largely deterministic grammars.""",
      'platforms': ['Any'],
    }
  else:
    extraArguments = {
    }
  setup (
    name = "SimpleParse",
    version = findVersion(),
    description = "A Parser Generator for Python (w/mxTextTools derivative)",
    author = "Mike C. Fletcher",
    author_email = "mcfletch@users.sourceforge.net",
    url = "http://simpleparse.sourceforge.net/",

    package_dir = packages,
    options = options,

    packages = packages.keys(),
    include_package_data = True,
    zip_safe = False,
    ext_modules=[
      Extension(
        "simpleparse.stt.TextTools.mxTextTools.mxTextTools", 
        [
          'stt/TextTools/mxTextTools/mxTextTools.c',
          'stt/TextTools/mxTextTools/mxte.c',
          'stt/TextTools/mxTextTools/mxbmse.c',
        ],
        include_dirs=['stt/TextTools/mxTextTools'],
        define_macros=[ ('MX_BUILDING_MXTEXTTOOLS',1) ],
      ),
    ],
    **extraArguments
  )
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.