home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- from win32com.server.exception import Exception
- from pywintypes import UnicodeType
- import winerror
-
- class Interpreter:
- _public_methods_ = [
- 'Exec',
- 'Eval']
- _reg_verprogid_ = 'Python.Interpreter.2'
- _reg_progid_ = 'Python.Interpreter'
- _reg_desc_ = 'Python Interpreter'
- _reg_clsid_ = '{30BD3490-2632-11cf-AD5B-524153480001}'
- _reg_class_spec_ = 'win32com.servers.interp.Interpreter'
-
- def __init__(self):
- self.dict = { }
-
-
- def Eval(self, exp):
- if type(exp) not in [
- type(''),
- UnicodeType]:
- raise Exception(desc = 'Must be a string', scode = winerror.DISP_E_TYPEMISMATCH)
- type(exp) not in [
- type(''),
- UnicodeType]
- return eval(str(exp), self.dict)
-
-
- def Exec(self, exp):
- if type(exp) not in [
- type(''),
- UnicodeType]:
- raise Exception(desc = 'Must be a string', scode = winerror.DISP_E_TYPEMISMATCH)
- type(exp) not in [
- type(''),
- UnicodeType]
- exec str(exp) in self.dict
-
-
-
- def Register():
- import win32com.server.register as win32com
- return win32com.server.register.UseCommandLine(Interpreter)
-
- if __name__ == '__main__':
- print 'Registering COM server...'
- Register()
-
-