[Bf-committers] [patch] A patch to add KX_KetsjiEngine::ShowDeprecationWarning()
mitchell at daboys4u.com
Wed Dec 17 20:58:47 CET 2008
All the methods that get combined can still use this function. For example,
getChildren() and getChildrenRecursive(). By simply adding a recursive flag
to getChildren(), the two can be combined. So, a warning can be placed on
what would be a deprecated getChildrenRecursive() like so:
-Mitchell "Moguri" Stokes
On Tue, Dec 16, 2008 at 11:24 PM, Dalai Felinto <dfelinto at gmail.com> wrote:
> I like this idea but we may need another function call slightly different.
> For example we have getDistance() (give you the distance), getVectTo()
> (give you the vector and the distance) and MathUtils that allow you to
> get the same data.
> IMHO it would be nice to centralize these calls (right now if we run a
> `print dir(obj)` we have so much functions that I found myself
> Another example(from the top of my head) could be the RayCast and
> RayCastTo. Could you unify them as well?
> Therefore I suggest to also create ShowDeprecationWarning(STR_String).
> The ShowDeprecationWarning(STR_String, STR_String) being used for
> general cases, and the other one for more specific ones.
> my 2 cents,
> (I didn't look to the patch though)
> Dalai Felinto
> 2008/12/16 Mitchell Stokes <mitchell at daboys4u.com>:
> > >From the tracker
> > (
> > "In order to clean up the BGE Python API, me and cyborg_ar needed a way
> > tell users that they were using a deprecated
> > function and should use another one.
> > Just put this into a deprecated function:
> > KX_KetsjiEngine::ShowDeprecationWarning("old way", "new way");
> > For example:
> > KX_KetsjiEngine::ShowDeprecationWarning("getPosition()", "position
> > property");
> > Will print "Method getPosition() is deprecated, please use the position
> > property instead" to the console.
> > The warnings can be turned off with Game -> Ignore Deprecation Warnings."
> > -Mitchell "Moguri" Stokes
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> Bf-committers mailing list
> Bf-committers at blender.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Bf-committers