Re: Python Heads Please spread the love

2012-11-06 Thread Alok

  
  
You might need to patch a file in
  pywin32.
  
  C:\Python26\Lib\site-packages\win32com\client\__init__.py
  
  The first function should be commented out, only the protoype and
  return should remain:
  
  def __WrapDispatch(dispatch, userName = None, resultCLSID = None,
  typeinfo = None, \
   UnicodeToString=None, clsctx =
  pythoncom.CLSCTX_SERVER,
   WrapperClass = None):
   """
   Helper function to return a makepy generated class for a CLSID
  if it exists,
   otherwise cope by using CDispatch.
   """
   #assert UnicodeToString is None, "this is deprecated and will go
  away"
   #if resultCLSID is None:
   #try:
   #typeinfo = dispatch.GetTypeInfo()
   #if typeinfo is not None: # Some objects return NULL, some
  raise exceptions...
   #resultCLSID = str(typeinfo.GetTypeAttr()[0])
   #except (pythoncom.com_error, AttributeError):
   #pass
   #if resultCLSID is not None:
   #import gencache
   ## Attempt to load generated module support
   ## This may load the module, and make it available
   #klass = gencache.GetClassForCLSID(resultCLSID)
   #if klass is not None:
   #return klass(dispatch)
  
   # Return a "dynamic" object - best we can do!
   if WrapperClass is None: WrapperClass = CDispatch
   return dynamic.Dispatch(dispatch, userName, WrapperClass,
  typeinfo, clsctx=clsctx)
  
  Maybe this might work.
  
  On 06/11/2012 3:57 PM, Ben Beckett wrote:


  Hi all
  
  I have a few plugin that require
  Python, They used to work
  before I a fresh version of windows7 64bit.
  Plugins like Gear mbfeathers require
  Python am getting this
  error:
  #  File "C:\Program
  Files\Autodesk\Softimage 2012
  SP1\Application\python\Lib\site-packages\win32com\client\dynamic.py",
  line
  538, in __setattr__
  #  
  self._oleobj_.Invoke(entry.dispid, 0,
  invoke_type, 0, value)
  # COM Error: Unexpected failure. -
  [line 39 in
C:\Users\Ben\Autodesk\Softimage_2012_SP1\Addons\mbFeatherTools\Application\Plugins\mb_FeatherToolsPlugin.py]
  
  So How I installed python and the
  files i used would be like
  this:
  1)
  I
  downloaded the file Python-2.6.8 from the python site, and
  extracted to the
  root of my c drive. Could not find a .exe version
  2)
I added the python folder (e.g.
  C:\ Python-2.6.8) to the PATH environment variable, system
  properties/Advanced
  tab/ environment variable
  In the System
  variables section
  PYTHONPATH C:\ Python-2.6.8
  3) in stall
  pywin32-212.win-64-py2.6
  4)switch xsi to
  script python and tick
  off use xsi python
  5) restart
  6) open xsi and all should work
  or not in my case
  Is this the right
  way are these the right files can any one
  spread any light on this
  In my plugin list there are still
  some scripts with red warning triangles
  All the best Ben
  No virus
found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2221 / Virus Database: 2441/5377 - Release Date:
11/06/12


  



Re: Python Heads Please spread the love

2012-11-06 Thread Raffaele Fragapane
It looks like you might be missing ActiveState's pywin. Did you install
that?

Also, I wouldn't recommend the forceful dispatch fix. There is so very
little these days that still has dispatching problems that it's not worth
the bother, not to mention the divergence from standards if you ever want
to release anything, and a performance hiccup in some uses.


Re: Python Heads Please spread the love

2012-11-06 Thread Xavier Lapointe
Make sure you installed the 64 bit version of Python.

On Wed, Nov 7, 2012 at 9:03 AM, Raffaele Fragapane 
raffsxsil...@googlemail.com wrote:

 It looks like you might be missing ActiveState's pywin. Did you install
 that?

 Also, I wouldn't recommend the forceful dispatch fix. There is so very
 little these days that still has dispatching problems that it's not worth
 the bother, not to mention the divergence from standards if you ever want
 to release anything, and a performance hiccup in some uses.




-- 
Xavier


Re: Python Heads Please spread the love

2012-11-06 Thread Xavier Lapointe
Should have been a little more explicit on that one.

Like Raff and Eric said, don't patch it. Use the dispatch fix coming with
pywin32.

Also, make sure to use the Python installer (64bits), and reinstall pywin32
64 bit.

You can use the 2.7 version I think without having trouble:
http://python.org/download/

One you have both 64bit version installed if python 2.7 and pywin32, you
should be ok.


Re: Python Heads Please spread the love

2012-11-06 Thread Ben Beckett
Thanks you guys your brill. Am at home now but in the morning I will look
at it again. If any one has any other idea's thats great.

Thankyou
Ben


On 6 November 2012 22:47, Xavier Lapointe xl.mailingl...@gmail.com wrote:

 Should have been a little more explicit on that one.

 Like Raff and Eric said, don't patch it. Use the dispatch fix coming with
 pywin32.

 Also, make sure to use the Python installer (64bits), and reinstall
 pywin32 64 bit.

 You can use the 2.7 version I think without having trouble:
 http://python.org/download/

 One you have both 64bit version installed if python 2.7 and pywin32, you
 should be ok.