コード例 #1
0
ファイル: socket_plugin.py プロジェクト: smarr/RSqueak
    def expose_primitive(self, wrap_func=None, **kwargs):
        original_decorator = Plugin.expose_primitive(self,
                                                     wrap_func=wrap_func,
                                                     **kwargs)

        def decorator(func):
            original_decorator(func)
            wrapped = self.primitives[func.func_name]

            def catchall(interp, s_frame, argcount, w_method=None):
                try:
                    return wrapped(interp,
                                   s_frame,
                                   argcount,
                                   w_method=w_method)
                except rsocket.SocketError as e:
                    print "!!!SOCKET ERROR!!!"
                    print e.get_msg()
                    print "!!!SOCKET ERROR!!!"
                    raise error.PrimitiveFailedError

            catchall.func_name = "catchall_" + wrapped.func_name
            self.primitives[func.func_name] = catchall
            return func

        return decorator
コード例 #2
0
ファイル: socket_plugin.py プロジェクト: smarr/RSqueak
 def wrappedcall(self, name, interp, s_frame, argcount, w_method):
     import time
     # sys.stdout.write("%s(%s): " % (name, s_frame.peek_n(argcount)))
     print name
     if "Socket" in name:
         time.sleep(0.5)
     r = Plugin.call(self, name, interp, s_frame, argcount, w_method)
     # print r
     return r
コード例 #3
0
ファイル: socket_plugin.py プロジェクト: HPI-SWA-Lab/RSqueak
 def wrappedcall(self, name, interp, s_frame, argcount, w_method):
     import time
     # sys.stdout.write("%s(%s): " % (name, s_frame.peek_n(argcount)))
     print name
     if "Socket" in name:
         time.sleep(0.5)
     r = Plugin.call(self, name, interp, s_frame, argcount, w_method)
     # print r
     return r
コード例 #4
0
ファイル: socket_plugin.py プロジェクト: HPI-SWA-Lab/RSqueak
 def expose_primitive(self, wrap_func=None, **kwargs):
     if not self.is_enabled():
         return lambda x: x  # do not install primitives when disabled
     original_decorator = Plugin.expose_primitive(self, wrap_func=wrap_func, **kwargs)
     def decorator(func):
         original_decorator(func)
         wrapped = self.primitives[func.func_name]
         def catchall(interp, s_frame, argcount, w_method=None):
             try:
                 return wrapped(interp, s_frame, argcount, w_method=w_method)
             except rsocket.SocketError as e:
                 print "!!!SOCKET ERROR!!!"
                 print e.get_msg()
                 print "!!!SOCKET ERROR!!!"
                 raise error.PrimitiveFailedError
         catchall.func_name = "catchall_" + wrapped.func_name
         self.primitives[func.func_name] = catchall
         return func
     return decorator
コード例 #5
0
ファイル: os_process.py プロジェクト: HPI-SWA-Lab/RSqueak
 def is_enabled(self):
     return Plugin.is_enabled(self) and IS_WINDOWS
コード例 #6
0
 def __init__(self):
     Plugin.__init__(self)
     self.ascii_order = Cell(None)
コード例 #7
0
ファイル: __init__.py プロジェクト: HPI-SWA-Lab/RSqueak
 def __init__(self):
     Plugin.__init__(self)
     self.register_default_primitives()
     self._break_on_exceptions_during_sends = Cell(False)
コード例 #8
0
ファイル: vmdebugging.py プロジェクト: fniephaus/RSqueak
import os
from rsqueakvm import model, error
from rsqueakvm.plugins.plugin import Plugin
from rsqueakvm.util.system import IS_WINDOWS


DebuggingPlugin = Plugin()

DebuggingPlugin.userdata['stop_ui'] = False
def stop_ui_process():
    DebuggingPlugin.userdata['stop_ui'] = True

# @DebuggingPlugin.expose_primitive(unwrap_spec=[object])
# def trace(interp, s_frame, w_rcvr):
#     interp.trace = True
#     return w_rcvr

# @DebuggingPlugin.expose_primitive(unwrap_spec=[object])
# def untrace(interp, s_frame, w_rcvr):
#     interp.trace = False
#     return w_rcvr


if IS_WINDOWS:
    def fork():
        raise NotImplementedError("fork on windows")
else:
    fork = os.fork


@DebuggingPlugin.expose_primitive(unwrap_spec=[object])
コード例 #9
0
 def __init__(self):
     Plugin.__init__(self)
     self.register_default_primitives()
     self._break_on_exceptions_during_sends = Cell(False)
コード例 #10
0
ファイル: socket_plugin.py プロジェクト: smarr/RSqueak
 def __init__(self):
     Plugin.__init__(self)
     self.last_lookup = Cell(None)
コード例 #11
0
 def is_enabled(self):
     return Plugin.is_enabled(self) and not IS_WINDOWS
コード例 #12
0
ファイル: socket_plugin.py プロジェクト: HPI-SWA-Lab/RSqueak
 def __init__(self):
     Plugin.__init__(self)
     self.last_lookup = Cell(None)
コード例 #13
0
ファイル: ruby_plugin.py プロジェクト: smarr/RSqueak
 def __init__(self):
     Plugin.__init__(self)
     self.w_ruby_object_class = QuasiConstant(None, cls=W_AbstractObjectWithIdentityHash)
     self.w_ruby_plugin_send = QuasiConstant(None, cls=W_AbstractObjectWithIdentityHash)