[python-win32] Global ActiveScripting object not visible
Łukasz Jakubowski
lukaszj at onet.pl
Thu Apr 17 11:06:12 CEST 2014
... and FWIW SetScriptSite seems to get some site:
in <win32com.axscript.client.pyscript.PyScript object at
0x05F6A910>._InvokeEx_-SetScriptSite(<PyIActiveScriptSite at 0x058067B8
with obj at 0x04A205D0>,) [1,0,None]
sss site: <PyIActiveScriptSite at 0x058067B8 with obj at 0x04A205D0>
Regards,
> Hi Mark,
>
> This is the output:
>
> ax.DOpus.OpenOutputWindow()
> ^
> Traceback (most recent call last):
> File "<Script Block >", line 1, in <module>
> ax.DOpus.OpenOutputWindow()
> File
> "C:\Python34\lib\site-packages\win32comext\axscript\client\pyscript.py",
> line 57, in __getattr__
> rc = self._FindAttribute_(attr)
> File
> "C:\Python34\lib\site-packages\win32comext\axscript\client\pyscript.py",
> line 85, in _FindAttribute_
> return getattr(self._scriptEngine_.globalNameSpaceModule, attr)
> AttributeError: 'module' object has no attribute 'DOpus'
> (0x80020009)
>
> I've tried to debug AddNamedItem in framework.py by importing
> win32traceutil and adding prints, and the problem lies in the line:
> unknown = self.scriptSite.GetItemInfo(name,
> axscript.SCRIPTINFO_IUNKNOWN)[0]
>
> File
> "C:\Python34\lib\site-packages\win32comext\axscript\client\framework.py",
> line 656, in AddNamedItem
> print('self.scriptSite: '+str(self.ScriptSite))
> AttributeError: 'PyScript' object has no attribute 'ScriptSite'
>
> Regards,
>
>
>> That all looks OK. There is a hack in the axscript engine that means
>> you may be able to use a prefix of 'ax.' - eg,
>> ax.DOpus.OpenOutputWindow()
>>
>> HTH,
>>
>> Mark
>>
>> On 17/04/2014 5:31 AM, Łukasz Jakubowski wrote:
>>> Hello Mark,
>>>
>>> This is the output:
>>>
>>> # This window will display output from any programs that import
>>> win32traceutil
>>> # win32com servers registered with '--debug' are in this category.
>>> Object with win32trace dispatcher created (object=None)
>>> in <win32com.axscript.client.pyscript.PyScript object at
>>> 0x05932D90>._InvokeEx_-SetScriptSite(<PyIActiveScriptSite at 0x057AD730
>>> with obj at 0x04B3C788>,) [1,0,None]
>>> Debugging extensions (axdebug) module does not exist - debugging is
>>> disabled..
>>> in <win32com.axscript.client.pyscript.PyScript object at
>>> 0x05932D90>._InvokeEx_-InitNew() [1,0,None]
>>> in <win32com.axscript.client.pyscript.PyScript object at
>>> 0x05932D90>._InvokeEx_-AddNamedItem('DOpus', 2) [1,0,None]
>>> in <win32com.axscript.client.pyscript.PyScript object at
>>> 0x05932D90>._InvokeEx_-ParseScriptText('DOpus.OpenOutputWindow()',
>>> None,
>>> None, None, 0, 0, 0, 0) [1,0,None]
>>> in <win32com.axscript.client.pyscript.PyScript object at
>>> 0x05932D90>._InvokeEx_-SetScriptState(2,) [1,0,None]
>>> in <win32com.axscript.client.pyscript.PyScript object at
>>> 0x05932D90>._InvokeEx_-SetScriptState(3,) [1,0,None]
>>> WARNING: Ignoring keyboard interrupt from ActiveScripting engine
>>> in <win32com.axscript.client.pyscript.PyScript object at
>>> 0x05932D90>._InvokeEx_-Close() [1,0,None]
>>>
>>> BTW, I've noticed the "Debugging extensions (axdebug) module does not
>>> exist - debugging is disabled.. " and mailing list thread:
>>> https://mail.python.org/pipermail/python-win32/2013-February/012710.html,
>>> and
>>> I can not see any solution there. The problematic import (import
>>> win32com.axdebug.axdebug) from IDLE:
>>>
>>>>>> import win32com.axdebug.axdebug
>>> Traceback (most recent call last):
>>> File "<pyshell#0>", line 1, in <module>
>>> import win32com.axdebug.axdebug
>>> ImportError: DLL load failed: Nie można odnaleźć określonego modułu.
>>> (Cannot find module specified)
>>>
>>> My system-wide PYTHONPATH is:
>>> C:\Python34\Lib;C:\Python34\DLLs
>>>
>>> All DLLs in PYTHONPATH:
>>>
>>> C:\Python34\DLLs\python3.dll
>>> C:\Python34\DLLs\sqlite3.dll
>>> C:\Python34\DLLs\tcl86t.dll
>>> C:\Python34\DLLs\tk86t.dll
>>> C:\Python34\Lib\site-packages\isapi\PyISAPI_loader.dll
>>> C:\Python34\Lib\site-packages\pythonwin\mfc100u.dll
>>> C:\Python34\Lib\site-packages\pythonwin\mfcm100u.dll
>>> C:\Python34\Lib\site-packages\pythonwin\scintilla.dll
>>> C:\Python34\Lib\site-packages\pywin32_system32\pythoncom34.dll
>>> C:\Python34\Lib\site-packages\pywin32_system32\pywintypes34.dll
>>> C:\Python34\Lib\site-packages\win32\perfmondata.dll
>>>
>>> Regards,
>>> Łukasz
>>>
>>> Dnia Wed, 16 Apr 2014 04:23:18 +0200, Mark Hammond
>>> <skippy.hammond at gmail.com> napisał:
>>>
>>>> You could try registering the python engine for debugging - change to
>>>> win32comext/axscript/client and run "python pyscript.py --debug" - a
>>>> message should be printed that the object is registered for debugging.
>>>>
>>>> Then, run "python -m win32traceutil" - this will run a python program
>>>> where debug statements should end up. Then run your script and
>>>> examine the output - hopefully you will see the names of objects
>>>> created - it may simply be a case issue.
>>>>
>>>> HTH,
>>>>
>>>> Mark
>>>>
>>>> On 16/04/2014 3:17 AM, Łukasz Jakubowski wrote:
>>>>>
>>>>> 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
>>>>> _______________________________________________
>>>>> python-win32 mailing list
>>>>> python-win32 at python.org
>>>>> https://mail.python.org/mailman/listinfo/python-win32
>>>>
>>>
>>>
>>
>
>
--
Używam klienta poczty Opera Mail: http://www.opera.com/mail/
More information about the python-win32
mailing list