;ò QЦBc@sÿdZdkZdkZdkZdkZdklZeiieii e ƒƒZ eii e ddƒZ eii e dƒZd„Zd„Zd„Zd„Zd „Zd „ZeZd eijo eƒZn eƒZept‚d eGHdS( s Find out if Numeric of numarray is going to be used as its array package WARNING: PyGSL has used Numeric as its core. This is to test to see if we can support both, but sooner or later the favour has to be given to one of these packages. When imported this module: 1.) Looks on the command line if it can find a flag of type --array-object=[Numeric|nummarray] 2.) Tries to import these modules. 3.) Tries to use the preferred one. 4.) Or goes with the other one found N(sDistutilsModuleErrorsIncludespygslcCs tidƒ}d}t}d}xt|tti ƒjo]|i ti |ƒ}|o2|i dƒ}|i ƒgti ||d+Pn|d7}q$W|SdS(sE Try to find if the array object was specified at the command line s--array-object=(.+)isiN( srescompiles array_patternspossNonesarray_preferencesresultslenssyssargvsmatchsgroupsstrip(s array_patternspossresultsarray_preferencesmatch((s=/mnt/gmirror/ports/math/py-gsl/work/pygsl-0.3.2/gsl_numobj.pysextractpatterns cCsud}d}d}d}ydk}d}Wntj onXydk}d}Wntj onX|tjo^|djo |djo d}qÑdGHqÕ|djo |djo d}qÑdGHqÕn|djo |djo;|djo d}q*|djo d}q*t d‚n|djod}d}n'|djod}d}n t d‚|SdS( s2 Find out if the set preference can be used ... iNisNumerics-Did not find the Numeric module you asked forsnumarrays.Did not find the numarray module you asked fors#I need either Numeric or nummarray!( s have_numerics have_numarrays use_numerics use_numarraysNumerics ImportErrorsnumarraysarray_preferencesNonesDistutilsModuleErrors nummodule(sarray_preferencesnumarrays have_numarraysNumerics use_numarrays nummodules use_numerics have_numeric((s=/mnt/gmirror/ports/math/py-gsl/work/pygsl-0.3.2/gsl_numobj.pysswitchpreference1sL                       cCs‘ttiitdƒdƒ}d}|idƒ|i|ƒ|idƒ|idƒ|id|ƒ|id|ƒ|i ƒ~ttiit dƒdƒ}|id ƒ|i|ƒ|id ƒ|id t i |ƒƒ|i ƒ~ttiitd ƒdƒ}|idƒ|i|ƒ|idƒ|d jo|idƒn+|djo|idƒn t d|‚|i ƒ~dS(Ns _numobj.pyswsA WARNING: File Generated during build. DO NOT MODIFY!!! s""" s sfrom %s import * snummodule = "%s" s arrayobject.hs/*s*/ s#define PyGSL_%s 1 s_mlab.pysNumericsfrom MLab import * snumarrays+from numarray.linear_algebra.mlab import * sUnknown array object (sopensosspathsjoinspygsldirsfileswarnmsgswrites nummodulescloses includedirsstringsuppers ValueError(s nummoduleswarnmsgsfile((s=/mnt/gmirror/ports/math/py-gsl/work/pygsl-0.3.2/gsl_numobj.pys writenumobjhs8                cCs=tiitdƒ}h}h}t|||ƒ|dSdS(s$ read the nummodule from the file s _numobj.pys nummoduleN(sosspathsjoinspygsldirsgslsexecfile(sgslspath((s=/mnt/gmirror/ports/math/py-gsl/work/pygsl-0.3.2/gsl_numobj.pys read_numobjs cCsÆtƒ}|djoAy tƒSWqWtj o dGHqWtj o dGHqWXnt|ƒ}t}y tƒ}Wntj onX|tjp ||jodGHdGHt |ƒn|SdS(s* Find out which array module to use ... ss+No Numobj was selected, trying to find one.s8Array object found in pygsl._numobj can not be importet!sBPlease make sure that all modules are built with the same setting.sBe.g. remove the build directory and start the build process again!N( sextractpatternstmps read_numobjsIOErrors ImportErrorsswitchpreferences nummodulesNoneslasts writenumobj(stmpslasts nummodule((s=/mnt/gmirror/ports/math/py-gsl/work/pygsl-0.3.2/gsl_numobj.pys build_guessšs,      cCs,y tƒSWntj otƒSnXdS(N(s read_numobjsIOErrors build_guess(((s=/mnt/gmirror/ports/math/py-gsl/work/pygsl-0.3.2/gsl_numobj.pysread_from_numobj¹s sbuildsUsing '%s' as array object(s__doc__sresstringssyssossdistutils.errorssDistutilsModuleErrorspathsdirnamesabspaths__file__s packagedirsjoins includedirspygsldirsextractpatternsswitchpreferences writenumobjs read_numobjs build_guesssread_from_numobjsNones nummodulesargvsAssertionError(s nummodulesstrings read_numobjsextractpatternsswitchpreferencesDistutilsModuleErrorssyssres includedirspygsldirs packagedirsread_from_numobjsoss writenumobjs build_guess((s=/mnt/gmirror/ports/math/py-gsl/work/pygsl-0.3.2/gsl_numobj.pys?s(       7 (