home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_2844 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.3 KB  |  30 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import sys
  5. sys.coinit_flags = 2
  6. import pythoncom
  7. import win32api
  8. from win32com.server import factory
  9. usage = 'Invalid command line arguments\n\nThis program provides LocalServer COM support\nfor Python COM objects.\n\nIt is typically run automatically by COM, passing as arguments\nThe ProgID or CLSID of the Python Server(s) to be hosted\n'
  10.  
  11. def serve(clsids):
  12.     infos = factory.RegisterClassFactories(clsids)
  13.     pythoncom.EnableQuitMessage(win32api.GetCurrentThreadId())
  14.     pythoncom.CoResumeClassObjects()
  15.     pythoncom.PumpMessages()
  16.     factory.RevokeClassFactories(infos)
  17.     pythoncom.CoUninitialize()
  18.  
  19.  
  20. def main():
  21.     if len(sys.argv) == 1:
  22.         win32api.MessageBox(0, usage, 'Python COM Server')
  23.         sys.exit(1)
  24.     
  25.     serve(sys.argv[1:])
  26.  
  27. if __name__ == '__main__':
  28.     main()
  29.  
  30.