[python-win32] Global ActiveScripting object not visible

Mark Hammond skippy.hammond at gmail.com
Tue Apr 29 07:30:13 CEST 2014


On 26/04/2014 8:17 AM, Łukasz Jakubowski wrote:
> Hello,
>
> OK, so now the thing is clear (from DO authors):
>
> """
> The actual problem was very simple really - inside Opus the global
> script objects were initialised in two steps:
> Call the script engine's AddNamedItem method to add the object to its
> namespace
> Add the object to our own internal object map
>
> Unfortunately, Python (unlike VBScript/JScript) queries us for the
> object while it is still processing the AddNamedItem call. In effect, in
> Python the process was:
>
> Call the script engine's AddNamedItem method to add the object to its
> namespace
> <- Python calls back to us, to obtain the object's IDispatch interface
> Add the object to our own internal object map
>
> This was of course failing, because at the time Python called us to
> query for the object, we hadn't yet added it to our internal map - and
> so the call would fail.
> """

Cool - does that mean they are fixing it?

> Plus a not-related problem that was discovered along the way:
>
> """
> ...Python hasn't configured the registry properly, so Opus is unable to
> map from a .py extension to the Python ActiveScript handler.
> [HKEY_CLASSES_ROOT\Python.File\ScriptEngine]
> @="Python"
> """

This is by-design - .py files generally aren't axscript files.  We 
register the .pys extension for this.

Cheers,

Mark

>
> I guess there may be things to address on pywin side.
>
> Thanks for all the help.
>
> Regards,
>
>
>>
>> Hello,
>>
>> I have a problem with a file manager called Directory Opus 11. It
>> supports ActiveScripting languages, but in case of python, its global
>> objects are not visible in global namespace.
>> Python packages (python-3.4.0, pywin32-218.win32-py3.4) seem to be
>> installed correctly (fe. WScript object is visible in .pys scripts),
>> and ActiveScripting engine is actually called by Directory Opus.
>> Where should I start debugging? Are there some possible flags not set
>> or attributes not presented by the Directory Opus objects that could
>> be checked? Any namespaces to be searched?
>>
>> The exact error message is as follows:
>> DOpus.OpenOutputWindow()
>> ^
>> Traceback (most recent call last):
>>    File "<Script Block >", line 6, in <module>
>>      DOpus.OpenOutputWindow()
>> NameError: name 'DOpus' is not defined
>>   (0x80020009)
>>
>> TIA & Regards,
>> Łukasz
>
>



More information about the python-win32 mailing list