node_window.py
来自「MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis」· Python 代码 · 共 45 行
PY
45 行
# This file is part of MANTIS OS, Operating System# See http://mantis.cs.colorado.edu/## Copyright (C) 2003-2005 University of Colorado, Boulder## This program is free software; you can redistribute it and/or# modify it under the terms of the mos license (see file LICENSE)import os, reimport wxfrom wx.lib.filebrowsebutton import DirBrowseButtonclass node_window(wx.Dialog): def __init__(self, parent): wx.Dialog.__init__(self, parent, -1, "Node Selector", wx.DefaultPosition, (400,200), wx.DEFAULT_DIALOG_STYLE) sizer = wx.BoxSizer(wx.VERTICAL) self.dbb = DirBrowseButton(self, -1, wx.Point(20,80), wx.Size(450, -1), changeCallback = self.OnDbb) self.SetModal(False) wx.EVT_CLOSE(self, self.OnClose) self.node_list = [] def OnClose(self, event): self.Show(False) def OnDbb(self, event): dir = event.GetString() files = os.listdir(dir) elffile_reg = re.compile(r'(?P<nodename>.*)\.elf$') for elffile in files: match = elffile_reg.match(elffile) if (match): self.node_list.append((elffile, match.group('nodename'))) print self.node_list
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?