home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2449 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  2.3 KB  |  51 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import win32ui
  5. from pywin.mfc import object
  6. import dde
  7.  
  8. class MySystemTopic(object.Object):
  9.     
  10.     def __init__(self):
  11.         object.Object.__init__(self, dde.CreateServerSystemTopic())
  12.  
  13.     
  14.     def Exec(self, cmd):
  15.         print 'System Topic asked to exec', cmd
  16.  
  17.  
  18.  
  19. class MyOtherTopic(object.Object):
  20.     
  21.     def __init__(self, topicName):
  22.         object.Object.__init__(self, dde.CreateTopic(topicName))
  23.  
  24.     
  25.     def Exec(self, cmd):
  26.         print 'Other Topic asked to exec', cmd
  27.  
  28.  
  29.  
  30. class MyRequestTopic(object.Object):
  31.     
  32.     def __init__(self, topicName):
  33.         topic = dde.CreateTopic(topicName)
  34.         topic.AddItem(dde.CreateStringItem(''))
  35.         object.Object.__init__(self, topic)
  36.  
  37.     
  38.     def Request(self, aString):
  39.         print 'Request Topic asked to compute length of:', aString
  40.         return str(len(aString))
  41.  
  42.  
  43. server = dde.CreateServer()
  44. server.AddTopic(MySystemTopic())
  45. server.AddTopic(MyOtherTopic('RunAnyCommand'))
  46. server.AddTopic(MyRequestTopic('ComputeStringLength'))
  47. server.Create('RunAny')
  48. while None:
  49.     continue
  50.     return None
  51.