Hi,

I am also working on the pythonscript.py file. There are several things I find... let's say strange in it, thus I am trying to make it more usable (and more pythonic).

My main goal for now it to provide the standard create/rename/delete/edit functions so it is much more easy to create python scripts from OOo. My problem for now is I cannot find info on what the "invoke" method should return, and what should it actually do when called with "Creatable" for example.
I am also not very familar with these things, but you should have a look at

http://framework.openoffice.org/scripting/ScriptingFrameworkChapter.pdf

where some explanation can be found (but I think won't help you in your concrete case). The document is linked from the scripting framework homepage:

http://framework.openoffice.org/scripting/index.html

You should post questions on the scripting framework API itself separately ( e.g. in the [email protected] or [email protected] group ), don't know whether they follow "pure" pyuno threads in this list.

> In case I am right (the invoke method should return a XBrowseNode
> capable
> object), can I just return a python instance of the FileBrowseNode
> class ?
Note that there is a 3 Level hierarchy in the pythonscript.py

PythonScriptProvider->DirBrowseNodes->FileBrowseNode->ScriptBrowseNode
                  (0...n)        (0...n)         (0...n)

So on the event Creatable you must either create

- a Directory     (in PythonScriptProvider)
- a File in a directory   (in DirBrowseNode)
- a Script in a file   (in FileBrowseNode)

. Note that as far as I understand it does not make sense to implement Creatable in a ScriptBrowseNode, I guess this is your problem ? Because the above three do not yet support XInvocation and XPropertySet, you'll need to add support for them before.

ShouldI explicitely make it a Any object before returning it ?
no, at 99% you must completely ignore anys, just return an instance of XBrowseNode.

I also noticed that with "Deletable" as parameter value, the invoke method returns a "True", but I cannot make it work either.

What do you return ? A python True should do it, a simple 1 won't.

Bye,

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to