def GM_Expr(self): choices = Lazy(lambda: choiceM([ self._GM_Expr_1 , self._GM_Expr_2 , self._GM_Expr_3])) def GM_Expr(m): a, m = choices.v(m) return self.G_Expr(a), m return GM_Expr
def mk_GM(self, sel, unbox, names, f): attrs = map('GM_{}'.format, names) seq = Lazy(lambda: compressM( map(lambda attr: getattr(self, attr), attrs) , sel, unbox=unbox, map=f )) def _GM_XXX(m): return seq.v(m) return _GM_XXX
def _GM_Apps_(self): sel = [1, 1] unbox = False seq = Lazy(lambda: compressM( [many1M_ex(self.GM_Atom_spaces), mayM(self.GM_Abs)] , sel, unbox=unbox, map=self._G_Apps_ )) def _GM_Apps_(m): return seq.v(m) return _GM_Apps_
def _GM_Expr_1(self): sel = [1] unbox = True seq = Lazy(lambda: compressM( [self.GM_Abs] , sel, unbox=unbox, map=self._G_Expr_1 )) def _GM_Expr_1(m): return seq.v(m) return _GM_Expr_1
def mkGM(self, name, indices:'[str]'): fmtAlt = '_GM_{}_{}' if not len(indices): indices = [''] attrs = map(lambda i: fmtAlt.format(name, i), indices) choices = Lazy(lambda: choiceM(map(lambda attr: getattr(self, attr), attrs))) fmtG = 'G_{}' G_XXX = fmtG.format(name) G_XXX = getattr(self, G_XXX) def GM_XXX(m): a, m = choices.v(m) return G_XXX(a), m return GM_XXX
def __init__(self, usb, dbg_handle, parent=None): super(MainDebugger, self).__init__(parent) self.setupUi(self) self.active_event = None self.usb = usb self.dbg_handle = dbg_handle self.usb_thread = EventReceiveThread(usb, dbg_handle) AddressFormatter.AddressFormatter(self.usb, self.dbg_handle) self.bp_manager = BreakpointManager(self.usb, self.dbg_handle, self.treeBreakpoints) expr_eval = ExpressionEvaluator(self.usb, self.dbg_handle, self) self.expr_eval = expr_eval self.adapters = [] self.adapters.append(Lazy(usb, dbg_handle)) self.adapters.append( AdapterMemoryLayout(usb, dbg_handle, self.treeMemory)) self.adapters.append(AdapterThreadList(self.treeThreads)) self.adapters.append(AdapterStateLabel(self.labelState)) self.adapters.append(AdapterRegisters(usb, dbg_handle, self)) self.adapters.append( AdapterStackTrace(usb, dbg_handle, self.treeStackTrace)) self.adapters.append( AdapterView(usb, dbg_handle, expr_eval, self.lineCmdView0, self.textOutputView0)) self.adapters.append( AdapterView(usb, dbg_handle, expr_eval, self.lineCmdView1, self.textOutputView1)) self.adapters.append( AdapterView(usb, dbg_handle, expr_eval, self.lineCmdView2, self.textOutputView2)) self.adapters.append(Playground(usb, dbg_handle, self)) self.connect(self.usb_thread, SIGNAL('onDbgEvent(PyQt_PyObject)'), self.onDbgEvent) self.usb_thread.start() self.lineCmd.returnPressed.connect(self.onUserCmd)
def profile_individual(self, json_to_profile): json_file_folder = "Json_Files" json_to_profile = json.loads(json_to_profile) individual_name = json_to_profile["individual"]["name"] # Adds individuals name to the list that is used to show the current scans in progress, then re draws the layout self.list_of_individuals_being_scanned.append( [individual_name, datetime.now().strftime("%Y-%m-%d %H:%M:%S")]) self.generate_layout() lazy_profle = Lazy.lazy_profile() individual_profile = lazy_profle.profile_json_string( json_file_folder, json_to_profile) self.list_of_individuals.append(individual_profile) for item in self.list_of_individuals_being_scanned: if item[0] == individual_name: self.list_of_individuals_being_scanned.remove(item) break self.generate_layout()
#!/usr/bin/env python # -*- coding: utf-8 -*- r''' Copyright 2018, SigDev Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ''' import Lazy if __name__ == r'__main__': it = Lazy.Iterator(r'12345') it.add(Lazy.Command()) print(next(it)) print(next(it))