def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.set_icon() self.ui = Ui_ProcExplorer.Ui_ProcExplorer() self.ui.setupUi(self) self.ses = madre.ses() self.tabs = {} self.ui.bScan.clicked.connect(self.do_scan) self.ui.bStartStop.clicked.connect(self.toggle_trace) self.postproc = [] self.ui.bSignal.addActions([ self.ui.actionSigKill, self.ui.actionSigAbort, self.ui.actionSigSegv ]) def sigkill(): self.send_signal(9) def sigabort(): self.send_signal(6) def sigsegv(): self.send_signal(11) self.ui.actionSigAbort.triggered.connect(sigabort) self.ui.actionSigKill.triggered.connect(sigkill) self.ui.actionSigSegv.triggered.connect(sigsegv) self.trace_enabled = False self._pidof = None
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_ProcList.Ui_ProcList() self.ui.setupUi(self) self.ses = madre.ses() t = self.ui.tableWidget t.setSortingEnabled(True) self.ui.bRefresh.clicked.connect(self.refresh) self.ui.bKill.clicked.connect(self.kill)
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_DynViewer.Ui_DynViewer() self.ui.setupUi(self) self.ses = madre.ses() self.ui.textBrowser.anchorClicked.connect(self.anchor_clicked) self.ui.textBrowser.setOpenLinks(False) self.pagestack = [] self.currentpage = None self.ui.bBack.clicked.connect(self.go_back)
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_TraceViewer.Ui_TraceViewer() self.ui.setupUi(self) self.ses = madre.ses() self.ui.btnRefresh.clicked.connect(self.refresh) self.ui.bExternal.clicked.connect(self.external_editor) self.state = None self.trace = None
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_Beamer.Ui_Beamer() self.ui.setupUi(self) self.setAcceptDrops(True) self.ses = madre.ses() self.set_icon() self.inbox = self.ses.rootdir() + "/inbox" self.outbox = self.ses.rootdir() + "/outbox" self.ses.ex('mkdir -p ' + self.inbox) self.ui.bFetchOutbox.clicked.connect(self.fetch_outbox) self.ui.bDropClipboard.clicked.connect(self.drop_clipboard) self.cb = QtGui.QApplication.clipboard()
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.logViewer = logviewer.LogViewer() self.logViewer.show() self.ses = madre.ses() self.ui = Ui_ProcLauncher.Ui_ProcLauncher() self.ui.setupUi(self) self.parse_config() self.connected = False self.ui.bReconnect.clicked.connect(self.try_connect) #self.try_connect() self.ui.bFindExec.clicked.connect(self.find_app) self.ui.comboSelectedDevice.currentIndexChanged.connect( self.select_device) #print "root" #print self.ses.ex_root("pwd") tools = self.get_tools() cols = 3 for (i, (title, func)) in enumerate(tools): b = QtGui.QPushButton(self.ui.centralwidget) b.setText(title) self.ui.procLayout.addWidget(b, i / cols, i % cols) b.clicked.connect(func) tools = self.get_device_tools() for (i, (title, func)) in enumerate(tools): b = QtGui.QPushButton(self.ui.centralwidget) b.setText(title) self.ui.deviceLayout.addWidget(b, i / cols, i % cols) b.clicked.connect(func) self.ui.inpProcName.setText("/bin/ls") self.add_actions() self.procs = [] # explorer instances self.exps = [] self.pl = None self.dv = None self.beamer = None self.oprofile = None cdir = cachedir() if not os.path.isdir(cdir): os.makedirs(cdir) self.set_icon()
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.logViewer = logviewer.LogViewer() self.logViewer.show() self.ses = madre.ses() self.ui = Ui_ProcLauncher.Ui_ProcLauncher() self.ui.setupUi(self) self.parse_config() self.connected = False self.ui.bReconnect.clicked.connect(self.try_connect) #self.try_connect() self.ui.bFindExec.clicked.connect(self.find_app) self.ui.comboSelectedDevice.currentIndexChanged.connect(self.select_device) #print "root" #print self.ses.ex_root("pwd") tools = self.get_tools() cols = 3 for (i, (title, func)) in enumerate(tools): b = QtGui.QPushButton(self.ui.centralwidget) b.setText(title) self.ui.procLayout.addWidget(b,i/cols, i % cols) b.clicked.connect(func) tools = self.get_device_tools() for (i,(title, func)) in enumerate(tools): b = QtGui.QPushButton(self.ui.centralwidget) b.setText(title) self.ui.deviceLayout.addWidget(b, i/cols, i% cols) b.clicked.connect(func) self.ui.inpProcName.setText("/bin/ls") self.add_actions() self.procs = [] # explorer instances self.exps = [] self.pl = None self.dv = None self.beamer = None self.oprofile = None cdir = cachedir() if not os.path.isdir(cdir): os.makedirs(cdir) self.set_icon()
#!/usr/bin/env python """ test for threadutil 'repeater' """ from PyQt4 import QtCore import madre, sys import threadutil ses = madre.ses() ses.connect() from threadutil import Repeater def main(): app = QtCore.QCoreApplication(sys.argv) ch = ses.invoke_shell("ls") print ch # print `r.ex("ls")` ch.send("top\n") def f(): print "call" return ch.recv(1000) rep = Repeater(f)
#!/usr/bin/env python from PyQt4 import QtGui import sys,os import logging log = logging.getLogger("devicesetup") import madre import crdconfig ses = madre.ses() def setup_logging(): # Log everything, and send it to stderr. logging.basicConfig(level=logging.DEBUG) pm = logging.getLogger("paramiko.transport") pm.setLevel(logging.INFO) class SetupWiz(QtGui.QWizard): def __init__(self, parent = None): QtGui.QWizard.__init__(self, parent) self.cfg = crdconfig.parse_config() self.host = self.cfg['host'] self.user = self.cfg['user'] ses.user = self.user ses.host = self.host