ahhh, Yep adding [PythonType] to my class made it work.
Thanks Jonathan On Fri, Oct 10, 2014 at 3:56 AM, Jeff Hardy <jdha...@gmail.com> wrote: > On Mon, Oct 6, 2014 at 12:57 AM, rabidgremlin <rabidgrem...@gmail.com> > wrote: > > Hi there, > > > > I'm using IronPython to add scripting to my app. I have some classes with > > methods that I don't wish to expose to the IronPython scripting engine. > > > > Doing some googling it looks like I should be able to add [PythonHidden] > to > > my class methods to achieve this, however it doesn't appear to work. > > > > eg I have a Layer class with the following method > > > > [PythonHidden] > > public Canvas GetLayerCanvas() > > { > > return layerCanvas; > > } > > > > In my Python script I am still able to call this method and a dir() > command > > on a Layer object results in: > > > > ['AddElement', 'Delete', 'GetElements', 'GetLayerCanvas', 'GetName', > > 'MoveBottom', 'MoveDown', 'MoveElementBottom', 'MoveElementDown', > > 'MoveElementTop', 'MoveElementUp', 'MoveTop', 'MoveUp', 'RemoveElement', > > 'SetName', '__class__', '__delattr__', '__doc__', '__format__', > > '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', > > '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', > > '__subclasshook__'] > > > > Any ideas? > > [PythonHidden] requires the class to have the [PythonType] (or > [PythonModule]) attribute. > > - Jeff >
_______________________________________________ Ironpython-users mailing list Ironpython-users@python.org https://mail.python.org/mailman/listinfo/ironpython-users