Example #1
0
    def init_shell(self, parent):
        self.shell = shell.Shell(parent, -1, introText=intro)
        self.shell.SetFocus()
        #timer
        self.timer = IdleTimer(self.idle)
        self.timer.Start(1000)
        self.lastTime = time()
        #self.shell.interp.locals["a"] = SharedObject(self.connection)
        self.shell.interp.locals["a"] = shared_factory(self.connection, None,
                                                       atlas.Object())
        self.shell.interp.locals["o"] = atlas.Object
        self.shell.interp.locals["app"] = self
        import local_code
        for key in local_code.__dict__.keys():
            if key[0] != "_":
                self.shell.interp.locals[key] = getattr(local_code, key)
        local_code.a = self.shell.interp.locals["a"]
        self.connection.objects = self.objects()
        self.connection.objects._send_flag = 1

        def send_op(op, connection=self.connection):
            connection.send_operation(op)

        self.shell.interp.locals["send"] = send_op

        def talk(nick, text, send_op=send_op):
            send_op(atlas.Operation("talk", atlas.Object(say=text),
                                    from_=nick))

        self.shell.interp.locals["talk"] = talk
        return self.shell
Example #2
0
    def __init__(self, *args, **kwds):
        kwds["style"] = wxDEFAULT_FRAME_STYLE
        # print args, kwds
        wxFrame.__init__(self, *args, **kwds)

        self.window = wxSplitterWindow(self, -1)
        self.upper_window = wxSplitterWindow(self.window, -1)
        self.window_pane_1 = wxPanel(self.upper_window, -1)

        self.shell = shell.Shell(self.window, -1, introText=PyCrust_IntroText)

        self.__menu_bar()

        self.plotcanvas = PlotCanvas([2, 3, 4, 5])
        self.plotwindow = PlotWindow(self.upper_window, -1)
        self.plotwindow.add(self.plotcanvas)
        self.upper_window.SplitVertically(self.window_pane_1, self.plotwindow,
                                          200)
        self.window.SplitHorizontally(self.upper_window, self.shell, -100)

        self.tree_of_structures = MyTreeCtrl(self.window_pane_1, -1,
                                             wxPoint(0, 0), wxSize(500, 1000),
                                             wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT)
        self.tree_of_structures.parent_frame = self
        self.statusbar = self.CreateStatusBar()
        self.statusbar.SetStatusText("test")
Example #3
0
def runTest(frame, nb, log):
    win = shell.Shell(nb, -1, introText=intro)
    return win