def newWorkSpace(self): if self.workspace == None: self.workspace = ws.Workspace(self.root, widgets.StatusBar(self.root, self.images), self.images, gridX = 32, gridY = 32, width = 1920 * 3, height = 1080) self.root.config(menu = widgets.MenuBar(self.root, self.workspace, self.images, self.newWorkSpace, self.loadWorkSpace)) else: self.workspace.destroy() self.workspace = ws.Workspace(self.root, widgets.StatusBar(self.root, self.images), self.images, gridX = 32, gridY = 32, width = 1920 * 3, height = 1080) self.root.config(menu = widgets.MenuBar(self.root, self.workspace, self.images, self.newWorkSpace, self.loadWorkSpace))
def loadWorkSpace(self): if self.workspace == None: self.workspace = ws.Workspace(self.root, widgets.StatusBar(self.root, self.images), self.images, gridX = 32, gridY = 32, width = 1920 * 3, height = 1080, option = con.WCC["LOAD"], file = fd.askopenfilename(parent = self.root, defaultextension = ".blml", title = "Open", filetypes=[("rbr level file", ".blml"), ("All files", ".*")])) self.root.config(menu = widgets.MenuBar(self.root, self.workspace, self.images, self.newWorkSpace, self.loadWorkSpace)) else: self.workspace.destroy() self.workspace = ws.Workspace(self.root, widgets.StatusBar(self.root, self.images), self.images, gridX = 32, gridY = 32, width = 1920 * 3, height = 1080, option = con.WCC["LOAD"], file = fd.askopenfilename(parent = self.root, defaultextension = ".blml", title = "Open", filetypes=[("rbr level file", ".blml"), ("All files", ".*")])) self.root.config(menu = widgets.MenuBar(self.root, self.workspace, self.images, self.newWorkSpace, self.loadWorkSpace))
def newWorkSpace(self): if self.workspace is None: self.workspace = ws.Workspace(self.root, widgets.StatusBar(self.root, self.images), self.images, gridX=self.inDict["gridX"], gridY=self.inDict["gridY"], width=self.inDict["width"], height=self.inDict["height"]) self.root.config(menu=widgets.MenuBar(self.root, self.workspace, self.images, self.newDialog, self.loadWorkSpace)) else: self.workspace.destroy() self.workspace = ws.Workspace(self.root, widgets.StatusBar(self.root, self.images), self.images, gridX=self.inDict["gridX"], gridY=self.inDict["gridY"], width=self.inDict["width"], height=self.inDict["height"]) self.root.config(menu=widgets.MenuBar(self.root, self.workspace, self.images, self.newDialog, self.loadWorkSpace))
def test_150(self): """Retrieve folder""" with workspace.Workspace() as w: #folder = w.get_folder([]) #pprint.pprint(folder, depth=3) #self._print_folder_items(folder) folder = w.get_folder(['folder_2']) self._print_folder(folder)
def describeindetail(): workspaces_dirs = workspace.list_workspaces_dirs() workspaces = [ workspace.Workspace(_workspace) for _workspace in workspaces_dirs ] workspace_shelloutput.print_workspaces_with_main_repos(workspaces, is_detailed=True) workspace_shelloutput.print_workspaces_without_main_repos(workspaces)
def _process_frames(self, frames): """ Evaluate movements and moations in frame. """ for g in frames[-1].gestures(frames[0]): if (g.type == Leap.Gesture.TYPE_KEY_TAP # See settings for explanation. and time.time() > (self.key_tap_timestamp + settings.key_tap_seconds_lock)): self.activated = not self.activated self.key_tap_timestamp = time.time() if self.activated: # Same control movements for workspace and blender objects, # except use one hand for controlling workspace and two for blender objects. obj = None if len(frames[0].hands) > 1: obj1 = blender_object.BlenderObject() obj2 = workspace.Workspace() else: obj1 = workspace.Workspace() obj2 = blender_object.BlenderObject() #print(frames[0].hands.leftmost.palm_position) # Hand with fingers stretched. # Controls rotation and zooming. if len(frames[0].fingers) > 3: v = self._frames_difference_vector( frames, lambda x: x.hands.leftmost.palm_position) # Zoom just applies for workspace. # Not all objects can zoom. print(v) zoom = getattr(obj1, "zoom", None) if zoom is not None: obj1.zoom(v.z * settings.lb_factor) self._rotate(obj1, v) # Fist or hand without fingers. # Controls movements. elif len(frames[0].fingers) < 2 and len(frames[0].hands) > 0: v = self._frames_difference_vector( frames, lambda x: x.hands.leftmost.palm_position) print(v) self._move(obj2, v)
def get(): workspaces_tree = workspace.get_workspaces_tree() workspaces_dirs = workspaces_tree.children(workspaces_tree.root) workspaces = [ workspace.Workspace(_workspace.data.name) for _workspace in workspaces_dirs ] # _remove_workspace_without_main_repo(workspaces_tree, workspaces) workspace_shelloutput.prettify_workspaces_tree(workspaces_tree, workspaces) return workspaces_tree
def _test_1000(self): """TODO: Test refresh on various non-emtpy cache.""" with tempfile.NamedTemporaryFile(delete=False) as f: pickle.dump([], f) f.close() with workspace.Workspace( workspace_cache_path=f.name, workspace_def_path='workspace_empty.xml' ) as w: w.refresh() self.assertEqual(w._workspace, [])
def __init__(self): # window setup log.debug('creating GUI') QMainWindow.__init__(self) self.setupUi(self) # icon self.setWindowIcon( QIcon( platform_specific.get_embedded_file_path( 'images/prest.ico', # deployment 'gui/images/prest.ico', # development ))) # instance attributes self.workspace = workspace.Workspace() # main menu self.actionGenerate_random_subjects.triggered.connect( self.catch_exc(self.dlg_simulation)) self.actionWorkspaceClear.triggered.connect( self.catch_exc(self.dlg_workspace_clear)) self.actionWorkspaceLoad.triggered.connect( self.catch_exc(self.dlg_workspace_load)) self.actionWorkspaceSave.triggered.connect( self.catch_exc(self.dlg_workspace_save)) self.actionWorkspaceSaveAs.triggered.connect( self.catch_exc(self.dlg_workspace_save_as)) self.actionDatasetImport.triggered.connect( self.catch_exc(self.dlg_dataset_import)) self.actionImport_budgetary_dataset.triggered.connect( self.catch_exc(self.dlg_budgetary_import)) self.actionHelp.triggered.connect(self.catch_exc(self.dlg_help_show)) self.actionAbout_Prest.triggered.connect(self.catch_exc( self.dlg_about)) self.actionQuit.triggered.connect( self.close) # self.close is a slot -> not wrapping # debug self.actionShow_console_window.toggled.connect( self.catch_exc(self.show_console_window)) self.actionCrash_core.triggered.connect( self.catch_exc(self.dlg_crash_core)) self.actionSoft_core_failure.triggered.connect( self.catch_exc(self.dlg_soft_core_failure)) self.actionHidden_features.toggled.connect( self.catch_exc(self.enable_hidden_features)) self.tblDataSets.doubleClicked.connect( self.catch_exc(self.dlg_view_current_dataset)) self.tblDataSets.customContextMenuRequested.connect( self.catch_exc(self.context_menu)) self.tblDataSets.horizontalHeader().setSectionResizeMode( QHeaderView.ResizeToContents) self.tblDataSets.horizontalHeader().setStretchLastSection(False) if not platform_specific.is_windows(): self.actionShow_console_window.setEnabled(False) self.enableDebuggingTools = QShortcut( QKeySequence(Qt.CTRL + Qt.Key_D), self, ) self.enableDebuggingTools.activated.connect( self.enable_debugging_tools) self.menuDebugging_tools.menuAction().setVisible(False) self.hidden_features_enabled = False try: doc.start_daemon( platform_specific.get_embedded_file_path( 'html', # deployment 'docs/build/html', # development )) except OSError as e: log.exception('could not start doc server')
def __init__(self): tk.Tk.__init__(self) self.title('Protocol Dissector Generator System') import workspace workspace.Workspace.current = workspace.Workspace('Example') center = tk.Frame(self) top = tk.Frame(self) left = AreaProjectNavigation(self) center.grid(row=1, column=1, sticky='NEWS', padx=0, pady=2) top.grid(row=0, column=1, sticky='N', padx=2, pady=2) left.grid(row=1, column=0, sticky='NS', padx=1, pady=2) pcap_path = "C:\\Users\\xeroj\Desktop\\Local_Programming\\Python-Software-GUI\\example\\icmp.pcap" lua_path = "C:\\Users\\xeroj\Desktop\\Local_Programming\\Python-Software-GUI\\example\\icmp.lua" center_top = AreaDissectorBuilder(center) center_bottom = tk.Frame(center) psa = AreaPacketStream(center_bottom) dsa = AreaDissectedStream(center_bottom) dsa.get_info(pcap_path, lua_path) rda = AreaRawData(center_bottom) rda.get_raw(pcap_path) ca = AreaConsole(center_bottom) center_top.grid(column=0, row=0, sticky="NS") center_bottom.grid(column=0, row=1, sticky='NS') psa.grid(column=0, row=0, sticky='NE') dsa.grid(column=1, row=0, sticky='NE') rda.grid(column=2, row=0, sticky='NE') ca.grid(column=3, row=0, sticky='NE') button_createProject = tk.Button( top, text='Create Project', command=lambda: self.new_window(WindowType.WINDOW_NEW_PROJECT)) button_saveProject = tk.Button(top, text='Save Project') button_closeProject = tk.Button(top, text='Close Project', command=lambda: self.quit()) button_switchWorkspace = tk.Button( top, text='Switch Workspace', command=lambda: self.new_window(WindowType. WINDOW_WORKSPACE_LAUNCHER)) button_importProject = tk.Button( top, text='Import Project', command=lambda: self.new_window(WindowType.WINDOW_PROJECT_IMPORT)) button_exportProject = tk.Button( top, text='Export Project', command=lambda: self.new_window(WindowType.WINDOW_PROJECT_EXPORT)) button_generateDissectorS = tk.Button( top, text='Generate Dissector Script', command=lambda: self.new_window(WindowType.WINDOW_DISSECTOR_SCRIPT )) button_organizeViews = tk.Button( top, text='Organize Views', command=lambda: self.new_window(WindowType.WINDOW_ORGANIZE_VIEWS)) button_openPCAP = tk.Button( top, text='Open PCAP', command=lambda: self.new_window(WindowType.WINDOW_OPEN_PCAP)) # place the buttons in the top frame button_createProject.grid(row=0, column=0, padx=5, pady=2) button_saveProject.grid(row=0, column=1, padx=5, pady=2) button_closeProject.grid(row=0, column=2, padx=5, pady=2) button_switchWorkspace.grid(row=0, column=3, padx=5, pady=2) button_importProject.grid(row=0, column=4, padx=5, pady=2) button_exportProject.grid(row=0, column=5, padx=5, pady=2) button_generateDissectorS.grid(row=0, column=6, padx=5, pady=2) button_organizeViews.grid(row=0, column=7, padx=5, pady=2) button_openPCAP.grid(row=0, column=8, padx=5, pady=2)
def test_140(self): """Create Workspace, unpickle default cache and refresh with all folders""" #with workspace.Workspace(workspace_def_path='workspace_tiny_two_levels.xml') as w: with workspace.Workspace(workspace_def_path='workspace_all.xml') as w: w.refresh()
def test_130(self): """Create Workspace, unpickle default cache and refresh with single folder""" with workspace.Workspace( workspace_def_path='workspace_single.xml', automatic_refresh=True ): pass
def test_120(self): """Create Workspace, unpickle default cache and refresh with empty def""" with workspace.Workspace(workspace_def_path='workspace_empty.xml') as w: w.refresh()
def test_110(self): """Create Workspace and unpickle default cache""" with workspace.Workspace(): pass
def test_100(self): """Create Workspace with defaults""" workspace.Workspace()