Revert to the FUTURE_PYTHON_API, this means:

- switching the define on in buildsystems (NaN, auto and msvc are done)
- again import _Blender, which is the C module, from the Python modules
This commit is contained in:
Wouter van Heyst 2003-02-06 03:30:25 +00:00
parent 0feac451ac
commit 6b65e39a44
29 changed files with 44 additions and 40 deletions

@ -330,9 +330,9 @@ class ModuleFinder:
return m return m
def find_module(self, name, path): def find_module(self, name, path):
# if name in self.excludes: if name in self.excludes:
# self.msgout(3, "find_module -> Excluded") self.msgout(3, "find_module -> Excluded")
# raise ImportError, name raise ImportError, name
if path is None: if path is None:
if name in sys.builtin_module_names: if name in sys.builtin_module_names:

@ -1 +1 @@
#from _Blender.BGL import * from _Blender.BGL import *

@ -15,7 +15,7 @@ Example::
""" """
import shadow import shadow
#import _Blender.Camera as _Camera import _Blender.Camera as _Camera
class Camera(shadow.hasIPO): class Camera(shadow.hasIPO):

@ -1 +1 @@
#from _Blender.Draw import * from _Blender.Draw import *

@ -8,7 +8,7 @@
im = Image.Load('dead-parrot.jpg') im = Image.Load('dead-parrot.jpg')
""" """
#import _Blender.Image as _Image import _Blender.Image as _Image
import shadow import shadow
class Image(shadow.shadow): class Image(shadow.shadow):

@ -31,7 +31,7 @@ Example::
ob.setIpo(ipo) # assign ipo to object ob.setIpo(ipo) # assign ipo to object
""" """
#import _Blender.Ipo as _Ipo import _Blender.Ipo as _Ipo
import shadow import shadow

@ -11,7 +11,7 @@ Example::
ob.link(l) ob.link(l)
""" """
#import _Blender.Lamp as _Lamp import _Blender.Lamp as _Lamp
import shadow import shadow
_validBufferSizes = [512, 768, 1024, 1536, 2560] _validBufferSizes = [512, 768, 1024, 1536, 2560]

@ -14,7 +14,7 @@
Scene.getCurrent().link(ob) # link object to current scene Scene.getCurrent().link(ob) # link object to current scene
""" """
#import _Blender.Material as _Material import _Blender.Material as _Material
import shadow import shadow
#import Blender.Curve as Curve #import Blender.Curve as Curve

@ -51,7 +51,7 @@
from Blender.Types import NMFaceType from Blender.Types import NMFaceType
import Blender.Material as Material import Blender.Material as Material
#from _Blender import NMesh as _NMesh from _Blender import NMesh as _NMesh
FACEFLAGS = _NMesh.Const FACEFLAGS = _NMesh.Const
DEFAULTFLAGS = FACEFLAGS.LIGHT + FACEFLAGS.DYNAMIC DEFAULTFLAGS = FACEFLAGS.LIGHT + FACEFLAGS.DYNAMIC
@ -66,7 +66,7 @@ def makeFace(f):
return face return face
def toTriangles(ngon): def toTriangles(ngon):
#from utils import tesselation from utils import tesselation
# This should be a Publisher only feature...once the tesselation # This should be a Publisher only feature...once the tesselation
# is improved. The GLU tesselator of Mesa < 4.0 is crappy... # is improved. The GLU tesselator of Mesa < 4.0 is crappy...
if len(ngon.uv) == len(ngon.v): if len(ngon.uv) == len(ngon.v):

@ -6,7 +6,7 @@
most probably limited. Use the 'Mesh' module instead. most probably limited. Use the 'Mesh' module instead.
""" """
#import _Blender.NMesh as _NMesh import _Blender.NMesh as _NMesh
import shadow import shadow
class Mesh(shadow.shadow): class Mesh(shadow.shadow):

@ -17,7 +17,7 @@
ob.makeParent([actobj]) # make ob the parent of actobj ob.makeParent([actobj]) # make ob the parent of actobj
""" """
#import _Blender.Object as _Object import _Blender.Object as _Object
import shadow import shadow
reload(shadow) # XXX reload(shadow) # XXX
@ -98,7 +98,7 @@ class Object(shadow.hasIPO):
the Object's type, so you cannot link a Lamp to a mesh type Object. the Object's type, so you cannot link a Lamp to a mesh type Object.
'data' can also be an Ipo object (IpoBlock) 'data' can also be an Ipo object (IpoBlock)
""" """
#from _Blender import Types from _Blender import Types
# special case for NMesh: # special case for NMesh:
if type(data) == Types.NMeshType: if type(data) == Types.NMeshType:
return self._object.link(data) return self._object.link(data)
@ -146,7 +146,7 @@ original. The returned object is *free*, meaning, not linked to any scene."""
def getDeformData(self): def getDeformData(self):
"""Returns the Datablock object containing the object's deformed data. """Returns the Datablock object containing the object's deformed data.
Currently, this is only supported for a Mesh""" Currently, this is only supported for a Mesh"""
#import _Blender.NMesh as _NMesh import _Blender.NMesh as _NMesh
t = self._object.getType() t = self._object.getType()
if t == self.Types['Mesh']: if t == self.Types['Mesh']:
data = _NMesh.GetRawFromObject(self.name) data = _NMesh.GetRawFromObject(self.name)

@ -14,7 +14,7 @@
newscene.link(cam) newscene.link(cam)
newscene.makeCurrent() # make current Scene newscene.makeCurrent() # make current Scene
""" """
#import _Blender.Scene as _Scene import _Blender.Scene as _Scene
from Object import Object from Object import Object
import shadow import shadow

@ -11,7 +11,7 @@
Text.unlink(text) # delete Text.unlink(text) # delete
""" """
#import _Blender.Text as _Text import _Blender.Text as _Text
class Text: class Text:
"""Wrapper for Text DataBlock""" """Wrapper for Text DataBlock"""

@ -1 +1 @@
#from _Blender.Types import * from _Blender.Types import *

@ -4,7 +4,7 @@ This module currently only supports redrawing commands of windows.
Later on, it will allow screen manipulations and access to Window Later on, it will allow screen manipulations and access to Window
properties""" properties"""
#import _Blender.Window as _Window import _Blender.Window as _Window
t = _Window.Types t = _Window.Types
Const = t # emulation Const = t # emulation

@ -1,4 +1,4 @@
#import _Blender.World as _World import _Blender.World as _World
import shadow import shadow

@ -6,7 +6,7 @@ __all__ = ["Object", "Image", "NMesh", "Window", "Mesh", "sys",
"Lamp", "Scene", "Draw", "Camera", "Material", "Types", "Ipo", "Lamp", "Scene", "Draw", "Camera", "Material", "Types", "Ipo",
"BGL"] "BGL"]
#import _Blender import _Blender
Get = _Blender.Get Get = _Blender.Get
Redraw = _Blender.Redraw Redraw = _Blender.Redraw

@ -1,4 +1,4 @@
#from _Blender.sys import * from _Blender.sys import *
sep = dirsep # path separator ('/' or '\') sep = dirsep # path separator ('/' or '\')

@ -956,7 +956,7 @@ def importfile(name):
global options global options
global DEFAULTFLAGS global DEFAULTFLAGS
# from Blender import Get # XXX from Blender import Get # XXX
options = Get('vrmloptions') options = Get('vrmloptions')
DEFAULTFLAGS = FACEFLAGS.LIGHT + FACEFLAGS.DYNAMIC DEFAULTFLAGS = FACEFLAGS.LIGHT + FACEFLAGS.DYNAMIC
if options['twoside']: if options['twoside']:

@ -10,7 +10,7 @@ import string,types
# import the C module and the version number # import the C module and the version number
# #
from mxTextTools import * from mxTextTools import *
#from mxTextTools import __version__ from mxTextTools import __version__
# #
# import the symbols needed to write tag tables # import the symbols needed to write tag tables

@ -4,8 +4,8 @@
See the documentation for further information on copyrights, See the documentation for further information on copyrights,
or contact the author (mal@lemburg.com). or contact the author (mal@lemburg.com).
""" """
#from mxTextTools import * from mxTextTools import *
#from mxTextTools import __version__ from mxTextTools import __version__
# #
# Make BMS take the role of FS in case the Fast Search object was not built # Make BMS take the role of FS in case the Fast Search object was not built

@ -94,7 +94,7 @@ class shadowNMesh:
# is improved. The GLU tesselator of Mesa < 4.0 is crappy... # is improved. The GLU tesselator of Mesa < 4.0 is crappy...
if not self.tess: if not self.tess:
return [] # no faces converted return [] # no faces converted
# import tess import tess
i = 0 i = 0
global tessfaces global tessfaces
tessfaces = [] tessfaces = []

@ -10,8 +10,7 @@ flattened copy of the hierarchy)
97-03-17 Added ability to pass arguments to hier_rapply and hier_rreturn. 97-03-17 Added ability to pass arguments to hier_rapply and hier_rreturn.
97-10-31 Removed dependencies on mcf.store 97-10-31 Removed dependencies on mcf.store
''' '''
#import copy,types import copy,types
import types
import singletonlist, hier_rx import singletonlist, hier_rx
class Hierobj: class Hierobj:

@ -2,8 +2,7 @@
# Wed Oct 31 16:18:35 CET 2001 # Wed Oct 31 16:18:35 CET 2001
'''Prototype2 -- VRML 97 sceneGraph/Node/Script/ROUTE/IS implementations''' '''Prototype2 -- VRML 97 sceneGraph/Node/Script/ROUTE/IS implementations'''
#import copy, types # extern import copy, types # extern
import types # extern
import strop as string # builtin import strop as string # builtin
from utils import typeclasses, err, namespace # XXX from utils import typeclasses, err, namespace # XXX
## TODO: namespace must go ## TODO: namespace must go
@ -16,7 +15,7 @@ class baseProto:
passed arguments for the linearisation object passed arguments for the linearisation object
see lineariser4.Lineariser see lineariser4.Lineariser
''' '''
# import lineariser4 import lineariser4
lineariser = apply( lineariser4.Lineariser, (), namedargs ) lineariser = apply( lineariser4.Lineariser, (), namedargs )
return apply( lineariser.linear, ( self, ), namedargs ) return apply( lineariser.linear, ( self, ), namedargs )

@ -11,8 +11,7 @@ Destructive Functions for "collapsing" Sequences into single levels
[1, 2, 3, 4, 5, 6] # note is the same root list [1, 2, 3, 4, 5, 6] # note is the same root list
''' '''
#import copy, types, sys import copy, types, sys
import types, sys
from types import ListType, TupleType # this now only supports the obsolete stuff... from types import ListType, TupleType # this now only supports the obsolete stuff...
def hyperCollapse( inlist, allowedmap, type=type, list=list, itype=types.InstanceType, maxint= sys.maxint): def hyperCollapse( inlist, allowedmap, type=type, list=list, itype=types.InstanceType, maxint= sys.maxint):

@ -64,8 +64,7 @@ will likely want to do: from mcf.utils import extpkl, copy_extend
98.03.15 -- Fixed bug in items, values, etceteras with module-type 98.03.15 -- Fixed bug in items, values, etceteras with module-type
base objects. base objects.
''' '''
#import copy, types, string import copy, types, string
import types, string
from mcf.utils import hierobj from mcf.utils import hierobj

@ -36,7 +36,7 @@ def regnumpy():
if globals().has_key('Numeric'): if globals().has_key('Numeric'):
return 1 return 1
try: try:
# import Numeric import Numeric
SequenceTypes.append( Numeric.ArrayType ) SequenceTypes.append( Numeric.ArrayType )
MutableTypes.append( Numeric.ArrayType ) MutableTypes.append( Numeric.ArrayType )
MutableSequenceTypes.append( Numeric.ArrayType ) MutableSequenceTypes.append( Numeric.ArrayType )

@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Target_Dir "" # PROP Target_Dir ""
LINK32=link.exe -lib LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\python\include\python2.2" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\..\lib\windows\python\include\python2.2" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "FUTURE_PYTHON_API" /YX /FD /c
# ADD BASE RSC /l 0x413 /d "NDEBUG" # ADD BASE RSC /l 0x413 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
@ -195,6 +195,10 @@ SOURCE=..\..\..\..\source\blender\bpython\frozen\M_Converter__importloader.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\..\source\blender\bpython\frozen\M_copy.c
# End Source File
# Begin Source File
SOURCE=..\..\..\..\source\blender\bpython\frozen\M_copy_reg.c SOURCE=..\..\..\..\source\blender\bpython\frozen\M_copy_reg.c
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -227,6 +231,10 @@ SOURCE=..\..\..\..\source\blender\bpython\frozen\M_pprint.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\..\source\blender\bpython\frozen\M_repr.c
# End Source File
# Begin Source File
SOURCE=..\..\..\..\source\blender\bpython\frozen\M_simpleparse.c SOURCE=..\..\..\..\source\blender\bpython\frozen\M_simpleparse.c
# End Source File # End Source File
# Begin Source File # Begin Source File

@ -42,7 +42,7 @@ endif
CFLAGS += $(LEVEL_1_C_WARNINGS) CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -DCURRENT_PYTHON_API # see api.h for configuration CPPFLAGS += -DFUTURE_PYTHON_API # see api.h for configuration
#CPPFLAGS += -DNO_RELEASE # see api.h for configuration #CPPFLAGS += -DNO_RELEASE # see api.h for configuration
# OpenGL and Python # OpenGL and Python