Ejemplo n.º 1
0
    def OnInit(self):
        ftp = FTPClient()
        login = Login()
        explorer = Explorer()
        
        start = login.ShowModal()

        if start == wx.ID_OK:
            login.disable()
            
            ftp.setHostname(login.getHostname())
            ftp.setUsername(login.getUsername())
            ftp.setPassword(login.getPassword())
                       
            ftp.connect()
            ftp.login()
            
            explorer.setFTP(ftp)
            explorer.Show()
            
            login.Destroy()
        else:
            return False
            
        return True
 def commit(self):
     savepoint = {
         "explorer": Explorer(self._board),
         "current_player": self._game.getCurrentPlayer(),
         "errors": self._game.getErrors(),
         "warnings": self._game.getWarnings()
     }
     self._save_points.append(savepoint)
     return self
Ejemplo n.º 3
0
def test2DQuadratic():
    def twoDimQuadratic(x, y):
        return np.power(x, 2) + np.power(y, 2)

    QuadraticExplorer = Explorer.Explore(twoDimQuadratic,
                                         order=1,
                                         resolution=50,
                                         bounds=False,
                                         optimize=np.min)
    print "[QuadraticExplorer.finalParameterList: {0}]".format(
        QuadraticExplorer.finalParameterList)
Ejemplo n.º 4
0
 def _getAvailablePositions(self, chessman: IChessman):
     king = False
     for row in self._board.get():
         for el in row:
             if el:
                 if isinstance(el, King):
                     if el.getColor() == chessman.getColor():
                         king = el
                         break
     position = self._board.getChessmanPosition(chessman)
     result = []
     for av_pos in chessman.getAvailablePositions():
         if king:
             explorer = Explorer(self._board)
             doesUnderAttack = explorer.move(
                 position, av_pos).doesChessmenUnderAttack(king)
             explorer.reverse()
             if doesUnderAttack:
                 continue
         result.append(av_pos)
     return result
Ejemplo n.º 5
0
 def setInfoForChessmenUnderAttack(self):
     for chessman in Explorer(self._board).getChessmenUnderAttack(
             self._currentPlayer):
         attack_pos = self._board.getChessmanPosition(chessman)
         if not chessman:
             continue
         if chessman.getColor() != self._currentPlayer:
             continue
         if isinstance(chessman, King):
             self.setWarning("CHECK!")
         self._board.setCellInfo(attack_pos["x"],
                                 attack_pos["y"],
                                 info1="!")
Ejemplo n.º 6
0
def testQuadratic():
    def quadratic(x):
        return -np.power(x - 3, 2)

    QuadraticExplorer = Explorer.Explore(quadratic,
                                         order=1,
                                         resolution=50,
                                         bounds=False,
                                         optimize=np.max)

    print "[QuadraticExplorer.finalParameterList: {0}]".format(
        QuadraticExplorer.finalParameterList)
    plt.plot(np.linspace(-10, 10, 50), quadratic(np.linspace(-10, 10, 50)))
    for vline in QuadraticExplorer.finalParameterList:
        plt.axvline(x=vline)
    plt.show()
Ejemplo n.º 7
0
def testQuasiQuadratic():
    def quasiQuadratic(x):
        return np.power(x, 4) + np.power(
            x, 3) + -4.4 * np.power(x, 2) + -1.7 * x + np.e

    QuadraticExplorer = Explorer.Explore(quasiQuadratic,
                                         order=1,
                                         resolution=50,
                                         bounds=[(0, 2)],
                                         optimize=np.min)

    print "[QuadraticExplorer.finalParameterList: {0}]".format(
        QuadraticExplorer.finalParameterList)
    plt.plot(np.linspace(-2, 2, 50), quasiQuadratic(np.linspace(-2, 2, 50)))
    for vline in QuadraticExplorer.finalParameterList:
        plt.axvline(x=vline)
    plt.show()
Ejemplo n.º 8
0
def get_file():
    appName = request.args.get('project')
    path = request.args.get('path')
    baseDir = get_project_dir(appName)
    filePath = baseDir + path
    return Explorer.read_file_content(filePath)
Ejemplo n.º 9
0
def get_dir():
    appName = request.args.get('project')
    baseDir = get_project_dir(appName)
    ret = Explorer.list_directory_recursive(baseDir)
    return json.dumps(ret)
Ejemplo n.º 10
0
from Explorer import *
from View import *
from Controller import *

model = Explorer("C")
controller = Controller(model)
view = View(model, controller)
view.mainloop()
Ejemplo n.º 11
0
argparser.add_argument("-M",
                       "--impact",
                       help="Enable impact statistics.",
                       action="store_true")
argparser.add_argument(
    "--config",
    help="Set another option; Group.Option:value;Group2.Option:value",
    type=str)

# @todo More config overrides...

args = argparser.parse_args()

start_time = time.time()
print("Creating the explorer...")
explorer = Explorer.Explorer(path=args.repo_path)

print("Loading configurations...")
explorer.loadConfigs(args.ini_file)

# Override configs
print("Performing command line overrides...")
if args.enable_cache:
    print("\tEnabling cache...")
    explorer.setConfig('General', 'enable_cache', 'true')

if args.cache_file is not None:
    print("\tSetting Caching.cache_file to: %s..." % (args.cache_file))
    explorer.setConfig('Caching', 'cache_file', args.cache_file)

if args.tops:
Ejemplo n.º 12
0
    def __init__(self,
                 parent,
                 title="",
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER
                 | wx.CLIP_CHILDREN):

        self.log = wx.GetApp().GetLog()
        #self.log.write("Images will now be provided by SampoArt\n")
        wx.ArtProvider.PushProvider(ed_art.EditraArt())

        wx.Frame.__init__(self, parent, wx.ID_ANY, title, pos, size, style)

        self._perspectives = []
        self.n = 0
        self.x = 0

        util.SetWindowIcon(self)

        self.style = Profile_Get('SYNTHEME', 'str', 'default')
        self.statusbar = self.CreateStatusBar(3)  #, wx.ST_SIZEGRIP
        self.statusbar.SetStatusWidths([-1, 24, 150])
        self.statusbar.SetStatusText(_("Welcome To Sampo Framework"), 0)
        self._status_icon = wx.StaticBitmap(
            self.statusbar, wx.ID_ANY,
            wx.Image(os.path.join("pixmaps", "ledgray.png")).ConvertToBitmap())
        self._gauge = wx.Gauge(self.statusbar, wx.ID_ANY)
        self._gauge.SetRange(100)

        # tell FrameManager to manage this frame
        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self)

        #   Open sub-menu
        self._open_menu = wx.Menu()
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_FOLDER), wx.ART_MENU,
                                        wx.Size(16, 16))
        mi = self._open_menu.AppendItem(
            wx.MenuItem(self._open_menu, self.ID_OpenWorldFile,
                        _("&Open world")))
        mi.SetBitmap(tbmp)
        self._open_menu.AppendItem(
            wx.MenuItem(self._open_menu, self.ID_OpenWorldMerge,
                        _("Merge with another world")))
        self._open_menu.AppendItem(
            wx.MenuItem(self._open_menu, self.ID_OpenWorldReduced,
                        _("Open world without restoring views")))

        self._save_menu = wx.Menu()
        self._save_menu.AppendItem(
            wx.MenuItem(self._save_menu, self.ID_SaveWorld, _("&Save world")))
        self._save_menu.AppendItem(
            wx.MenuItem(self._save_menu, self.ID_SaveWorldAs,
                        _("Save world &as...")))
        # min size for the frame itself isn't completely done.
        # see the end up FrameManager::Update() for the test
        # code. For now, just hard code a frame minimum size
        self.SetMinSize(wx.Size(400, 300))

        # create some toolbars
        tb1 = aui.AuiToolBar(self, -1)
        tb1.SetToolBitmapSize(wx.Size(16, 16))
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_NEW), wx.ART_MENU,
                                        wx.Size(16, 16))
        tb1.AddTool(self.ID_CreateWorld, '', tbmp, tbmp, wx.ITEM_NORMAL,
                    _("New world"), _("Create new empty world"), None)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_FOLDER), wx.ART_MENU,
                                        wx.Size(16, 16))
        tb1.AddTool(self.ID_OpenWorld, '', tbmp, tbmp, wx.ITEM_NORMAL,
                    _("Open world"), _("Open world from storage"), None)
        tb1.SetToolDropDown(self.ID_OpenWorld, True)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_SAVE), wx.ART_MENU,
                                        wx.Size(16, 16))
        tb1.AddTool(self.ID_SaveWorld, '', tbmp, tbmp, wx.ITEM_NORMAL,
                    _("Save world"), _("Save world to storage"), None)
        tb1.SetToolDropDown(self.ID_SaveWorld, True)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_PREF), wx.ART_MENU,
                                        wx.Size(16, 16))
        tb1.AddTool(self.ID_Settings, '', tbmp, tbmp, wx.ITEM_NORMAL,
                    _("Options"), _("Tune the framework"), None)
        tb1.AddSeparator()
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_DECA_LAYER),
                                        wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(Explorer.expPanel.ID_AddLayer, '', tbmp,
                    tbmp, wx.ITEM_NORMAL, _("Add layer"),
                    _("Create new empty layer"), None)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_DECA_IMAGES),
                                        wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(self.ID_ImageLib, '', tbmp, tbmp, wx.ITEM_NORMAL,
                    _("Images"), _("Edit images library"), None)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_DECA_ENGINE),
                                        wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(Explorer.expPanel.ID_RefreshEngines, '', tbmp, tbmp,
                    wx.ITEM_NORMAL, _("Reload engines"),
                    _("Rebuild engines tree and reinitialize packages"), None)
        tb1.AddSeparator()
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_COMPUTER), wx.ART_MENU,
                                        wx.Size(16, 16))
        tb1.AddTool(self.ID_ViewMenu, '', tbmp, tbmp, wx.ITEM_NORMAL,
                    _("View"), _("Select visible components"), None)
        tb1.SetToolDropDown(self.ID_ViewMenu, True)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_HELP), wx.ART_MENU,
                                        wx.Size(16, 16))
        tb1.AddTool(self.ID_HelpView, '', tbmp, tbmp, wx.ITEM_NORMAL,
                    _("Help"), _("Show the help browser"), None)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_ABOUT), wx.ART_MENU,
                                        wx.Size(16, 16))
        tb1.AddTool(self.ID_About, '', tbmp, tbmp, wx.ITEM_NORMAL, _("About"),
                    _("About the framework"), None)
        tb1.Realize()

        self.tb2 = None

        # add a bunch of panes
        self.propgrid = PropertySheet.PropGridPanel(self)
        self._mgr.AddPane(
            self.propgrid,
            aui.AuiPaneInfo().Name("props").Caption(
                "Properties").Right().CloseButton(True).MaximizeButton(True))
        self.propgrid.SetPropObject(Deca.world)
        self.explorer = Explorer.expPanel(self, wx.Point(0, 0),
                                          wx.Size(160, 250))
        self.explorer.UpdateWorldTree()
        self._mgr.AddPane(
            self.explorer,
            aui.AuiPaneInfo().Name("explorer").Caption("World").Left().Layer(
                1).Position(1).CloseButton(True).MaximizeButton(True))

        self.logger = Logger.LogView(self)
        self._mgr.AddPane(
            self.logger,
            aui.AuiPaneInfo().Name("logger").Caption("Logs & Messages").Bottom(
            ).Layer(1).Position(1).CloseButton(True).MaximizeButton(True))
        self.log.Frame = self.logger

        # create some center panes
        self.nbook = aui.AuiNotebook(self)
        self.shell = PyShellView(self.nbook)
        if Profile_Get('ALLOW_CONSOLE', 'bool', True):
            self.AddTab(self.shell, self.shell.Title)
        self.UpdateIndexes()

        self._mgr.AddPane(self.nbook,
                          aui.AuiPaneInfo().Name("notebook").CenterPane())

        # add the toolbars to the manager

        self._mgr.AddPane(
            tb1,
            aui.AuiPaneInfo().Name("tb1").Caption("MainToolbar").ToolbarPane().
            Top().Row(0).Position(0).LeftDockable(False).RightDockable(False))

        # make some default perspectives

        perspective_all = self._mgr.SavePerspective()

        all_panes = self._mgr.GetAllPanes()

        for ii in xrange(len(all_panes)):
            all_panes[ii].MinimizeMode(aui.AUI_MINIMIZE_CAPT_SMART
                                       | (all_panes[ii].GetMinimizeMode()
                                          & aui.AUI_MINIMIZE_POS_MASK))
            if not all_panes[ii].IsToolbar():
                all_panes[ii].Hide()

        self._mgr.GetPane("props").Show()
        self._mgr.GetPane("explorer").Show().Left().Layer(0).Row(0).Position(0)
        self._mgr.GetPane("logger").Show().Bottom().Layer(0).Row(0).Position(0)
        self._mgr.GetPane("notebook").Show()

        perspective_default = self._mgr.SavePerspective()

        self._perspectives.append(perspective_default)
        self._perspectives.append(perspective_all)

        # "commit" all changes made to FrameManager
        self._mgr.Update()

        #self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
        self.sizeChanged = False
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_IDLE, self.OnIdle)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnPageClose)

        # Show How To Use The Closing Panes Event
        self.Bind(aui.EVT_AUI_PANE_CLOSE, self.OnPaneClose)

        self.Bind(wx.EVT_MENU, self.OnNewWorld, id=self.ID_CreateWorld)
        self.Bind(wx.EVT_MENU, self.DoOpenWorld, id=self.ID_OpenWorldFile)
        self.Bind(wx.EVT_MENU, self.DoOpenWorld, id=self.ID_OpenWorldReduced)
        self.Bind(wx.EVT_MENU, self.DoOpenWorld, id=self.ID_OpenWorldMerge)
        self.Bind(aui.EVT_AUITOOLBAR_TOOL_DROPDOWN,
                  self.OnOpenWorld,
                  id=self.ID_OpenWorld)
        self.Bind(wx.EVT_MENU, self.DoSaveWorld, id=self.ID_SaveWorld)
        self.Bind(aui.EVT_AUITOOLBAR_TOOL_DROPDOWN,
                  self.OnSaveWorld,
                  id=self.ID_SaveWorld)
        self.Bind(wx.EVT_MENU, self.DoSaveWorld, id=self.ID_SaveWorldAs)

        self.Bind(wx.EVT_MENU, self.OnSettings, id=self.ID_Settings)
        self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
        self.Bind(wx.EVT_MENU, self.OnAbout, id=self.ID_About)
        self.Bind(wx.EVT_MENU, self.OnHelpView, id=self.ID_HelpView)
        self.Bind(wx.EVT_MENU, self.OnImageLib, id=self.ID_ImageLib)
        self.Bind(wx.EVT_MENU,
                  self.OnNewLayer,
                  id=Explorer.expPanel.ID_AddLayer)
        self.Bind(wx.EVT_MENU,
                  self.OnRefreshWorld,
                  id=Explorer.expPanel.ID_RefreshEngines)

        #self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewMenu)
        self.Bind(aui.EVT_AUITOOLBAR_TOOL_DROPDOWN,
                  self.OnPaneViewMenu,
                  id=self.ID_ViewMenu)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewExplorer)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewProps)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewLogger)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewConsole)

        self.Bind(wx.EVT_MENU,
                  self.DispatchToControl,
                  id=ed_glob.ID_SHOW_AUTOCOMP)
        self.Bind(wx.EVT_MENU, self.DispatchToControl, id=wx.ID_SAVE)
        self.Bind(wx.EVT_MENU, self.DispatchToControl, id=wx.ID_OPEN)
        self.Bind(wx.EVT_MENU, self.DispatchToControl, id=wx.ID_FIND)
        accel_tbl = wx.AcceleratorTable([
            (wx.ACCEL_CTRL, ord(' '), ed_glob.ID_SHOW_AUTOCOMP),
            (wx.ACCEL_CTRL, ord('Q'), wx.ID_EXIT),
            (wx.ACCEL_CTRL, ord('S'), wx.ID_SAVE),
            (wx.ACCEL_CTRL, ord('O'), wx.ID_OPEN),
            (wx.ACCEL_CTRL, ord('F'), wx.ID_FIND)
        ])
        self.SetAcceleratorTable(accel_tbl)
        self.UpdateColors(self.style)
        wx.CallAfter(self._FixTbarsView)
Ejemplo n.º 13
0
# coding:utf-8
import Explorer

b = Explorer.Exploit()
a = Explorer.Spider(b.add)
a.add("https://www.hao123.com")
a.start()
Ejemplo n.º 14
0
    def __init__(
        self,
        parent,
        title="",
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN,
    ):

        self.log = wx.GetApp().GetLog()
        # self.log.write("Images will now be provided by SampoArt\n")
        wx.ArtProvider.PushProvider(ed_art.EditraArt())

        wx.Frame.__init__(self, parent, wx.ID_ANY, title, pos, size, style)

        self._perspectives = []
        self.n = 0
        self.x = 0

        util.SetWindowIcon(self)

        self.style = Profile_Get("SYNTHEME", "str", "default")
        self.statusbar = self.CreateStatusBar(3)  # , wx.ST_SIZEGRIP
        self.statusbar.SetStatusWidths([-1, 24, 150])
        self.statusbar.SetStatusText(_("Welcome To Sampo Framework"), 0)
        self._status_icon = wx.StaticBitmap(
            self.statusbar, wx.ID_ANY, wx.Image(os.path.join("pixmaps", "ledgray.png")).ConvertToBitmap()
        )
        self._gauge = wx.Gauge(self.statusbar, wx.ID_ANY)
        self._gauge.SetRange(100)

        # tell FrameManager to manage this frame
        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self)

        #   Open sub-menu
        self._open_menu = wx.Menu()
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_FOLDER), wx.ART_MENU, wx.Size(16, 16))
        mi = self._open_menu.AppendItem(wx.MenuItem(self._open_menu, self.ID_OpenWorldFile, _("&Open world")))
        mi.SetBitmap(tbmp)
        self._open_menu.AppendItem(wx.MenuItem(self._open_menu, self.ID_OpenWorldMerge, _("Merge with another world")))
        self._open_menu.AppendItem(
            wx.MenuItem(self._open_menu, self.ID_OpenWorldReduced, _("Open world without restoring views"))
        )

        self._save_menu = wx.Menu()
        self._save_menu.AppendItem(wx.MenuItem(self._save_menu, self.ID_SaveWorld, _("&Save world")))
        self._save_menu.AppendItem(wx.MenuItem(self._save_menu, self.ID_SaveWorldAs, _("Save world &as...")))
        # min size for the frame itself isn't completely done.
        # see the end up FrameManager::Update() for the test
        # code. For now, just hard code a frame minimum size
        self.SetMinSize(wx.Size(400, 300))

        # create some toolbars
        tb1 = aui.AuiToolBar(self, -1)
        tb1.SetToolBitmapSize(wx.Size(16, 16))
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_NEW), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(
            self.ID_CreateWorld, "", tbmp, tbmp, wx.ITEM_NORMAL, _("New world"), _("Create new empty world"), None
        )
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_FOLDER), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(
            self.ID_OpenWorld, "", tbmp, tbmp, wx.ITEM_NORMAL, _("Open world"), _("Open world from storage"), None
        )
        tb1.SetToolDropDown(self.ID_OpenWorld, True)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_SAVE), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(
            self.ID_SaveWorld, "", tbmp, tbmp, wx.ITEM_NORMAL, _("Save world"), _("Save world to storage"), None
        )
        tb1.SetToolDropDown(self.ID_SaveWorld, True)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_PREF), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(self.ID_Settings, "", tbmp, tbmp, wx.ITEM_NORMAL, _("Options"), _("Tune the framework"), None)
        tb1.AddSeparator()
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_DECA_LAYER), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(
            Explorer.expPanel.ID_AddLayer,
            "",
            tbmp,
            tbmp,
            wx.ITEM_NORMAL,
            _("Add layer"),
            _("Create new empty layer"),
            None,
        )
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_DECA_IMAGES), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(self.ID_ImageLib, "", tbmp, tbmp, wx.ITEM_NORMAL, _("Images"), _("Edit images library"), None)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_DECA_ENGINE), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(
            Explorer.expPanel.ID_RefreshEngines,
            "",
            tbmp,
            tbmp,
            wx.ITEM_NORMAL,
            _("Reload engines"),
            _("Rebuild engines tree and reinitialize packages"),
            None,
        )
        tb1.AddSeparator()
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_COMPUTER), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(self.ID_ViewMenu, "", tbmp, tbmp, wx.ITEM_NORMAL, _("View"), _("Select visible components"), None)
        tb1.SetToolDropDown(self.ID_ViewMenu, True)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_HELP), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(self.ID_HelpView, "", tbmp, tbmp, wx.ITEM_NORMAL, _("Help"), _("Show the help browser"), None)
        tbmp = wx.ArtProvider_GetBitmap(str(ed_glob.ID_ABOUT), wx.ART_MENU, wx.Size(16, 16))
        tb1.AddTool(self.ID_About, "", tbmp, tbmp, wx.ITEM_NORMAL, _("About"), _("About the framework"), None)
        tb1.Realize()

        self.tb2 = None

        # add a bunch of panes
        self.propgrid = PropertySheet.PropGridPanel(self)
        self._mgr.AddPane(
            self.propgrid,
            aui.AuiPaneInfo().Name("props").Caption("Properties").Right().CloseButton(True).MaximizeButton(True),
        )
        self.propgrid.SetPropObject(Deca.world)
        self.explorer = Explorer.expPanel(self, wx.Point(0, 0), wx.Size(160, 250))
        self.explorer.UpdateWorldTree()
        self._mgr.AddPane(
            self.explorer,
            aui.AuiPaneInfo()
            .Name("explorer")
            .Caption("World")
            .Left()
            .Layer(1)
            .Position(1)
            .CloseButton(True)
            .MaximizeButton(True),
        )

        self.logger = Logger.LogView(self)
        self._mgr.AddPane(
            self.logger,
            aui.AuiPaneInfo()
            .Name("logger")
            .Caption("Logs & Messages")
            .Bottom()
            .Layer(1)
            .Position(1)
            .CloseButton(True)
            .MaximizeButton(True),
        )
        self.log.Frame = self.logger

        # create some center panes
        self.nbook = aui.AuiNotebook(self)
        self.shell = PyShellView(self.nbook)
        if Profile_Get("ALLOW_CONSOLE", "bool", True):
            self.AddTab(self.shell, self.shell.Title)
        self.UpdateIndexes()

        self._mgr.AddPane(self.nbook, aui.AuiPaneInfo().Name("notebook").CenterPane())

        # add the toolbars to the manager

        self._mgr.AddPane(
            tb1,
            aui.AuiPaneInfo()
            .Name("tb1")
            .Caption("MainToolbar")
            .ToolbarPane()
            .Top()
            .Row(0)
            .Position(0)
            .LeftDockable(False)
            .RightDockable(False),
        )

        # make some default perspectives

        perspective_all = self._mgr.SavePerspective()

        all_panes = self._mgr.GetAllPanes()

        for ii in xrange(len(all_panes)):
            all_panes[ii].MinimizeMode(
                aui.AUI_MINIMIZE_CAPT_SMART | (all_panes[ii].GetMinimizeMode() & aui.AUI_MINIMIZE_POS_MASK)
            )
            if not all_panes[ii].IsToolbar():
                all_panes[ii].Hide()

        self._mgr.GetPane("props").Show()
        self._mgr.GetPane("explorer").Show().Left().Layer(0).Row(0).Position(0)
        self._mgr.GetPane("logger").Show().Bottom().Layer(0).Row(0).Position(0)
        self._mgr.GetPane("notebook").Show()

        perspective_default = self._mgr.SavePerspective()

        self._perspectives.append(perspective_default)
        self._perspectives.append(perspective_all)

        # "commit" all changes made to FrameManager
        self._mgr.Update()

        # self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
        self.sizeChanged = False
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_IDLE, self.OnIdle)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnPageClose)

        # Show How To Use The Closing Panes Event
        self.Bind(aui.EVT_AUI_PANE_CLOSE, self.OnPaneClose)

        self.Bind(wx.EVT_MENU, self.OnNewWorld, id=self.ID_CreateWorld)
        self.Bind(wx.EVT_MENU, self.DoOpenWorld, id=self.ID_OpenWorldFile)
        self.Bind(wx.EVT_MENU, self.DoOpenWorld, id=self.ID_OpenWorldReduced)
        self.Bind(wx.EVT_MENU, self.DoOpenWorld, id=self.ID_OpenWorldMerge)
        self.Bind(aui.EVT_AUITOOLBAR_TOOL_DROPDOWN, self.OnOpenWorld, id=self.ID_OpenWorld)
        self.Bind(wx.EVT_MENU, self.DoSaveWorld, id=self.ID_SaveWorld)
        self.Bind(aui.EVT_AUITOOLBAR_TOOL_DROPDOWN, self.OnSaveWorld, id=self.ID_SaveWorld)
        self.Bind(wx.EVT_MENU, self.DoSaveWorld, id=self.ID_SaveWorldAs)

        self.Bind(wx.EVT_MENU, self.OnSettings, id=self.ID_Settings)
        self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
        self.Bind(wx.EVT_MENU, self.OnAbout, id=self.ID_About)
        self.Bind(wx.EVT_MENU, self.OnHelpView, id=self.ID_HelpView)
        self.Bind(wx.EVT_MENU, self.OnImageLib, id=self.ID_ImageLib)
        self.Bind(wx.EVT_MENU, self.OnNewLayer, id=Explorer.expPanel.ID_AddLayer)
        self.Bind(wx.EVT_MENU, self.OnRefreshWorld, id=Explorer.expPanel.ID_RefreshEngines)

        # self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewMenu)
        self.Bind(aui.EVT_AUITOOLBAR_TOOL_DROPDOWN, self.OnPaneViewMenu, id=self.ID_ViewMenu)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewExplorer)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewProps)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewLogger)
        self.Bind(wx.EVT_MENU, self.OnContextMenu, id=self.ID_ViewConsole)

        self.Bind(wx.EVT_MENU, self.DispatchToControl, id=ed_glob.ID_SHOW_AUTOCOMP)
        self.Bind(wx.EVT_MENU, self.DispatchToControl, id=wx.ID_SAVE)
        self.Bind(wx.EVT_MENU, self.DispatchToControl, id=wx.ID_OPEN)
        self.Bind(wx.EVT_MENU, self.DispatchToControl, id=wx.ID_FIND)
        accel_tbl = wx.AcceleratorTable(
            [
                (wx.ACCEL_CTRL, ord(" "), ed_glob.ID_SHOW_AUTOCOMP),
                (wx.ACCEL_CTRL, ord("Q"), wx.ID_EXIT),
                (wx.ACCEL_CTRL, ord("S"), wx.ID_SAVE),
                (wx.ACCEL_CTRL, ord("O"), wx.ID_OPEN),
                (wx.ACCEL_CTRL, ord("F"), wx.ID_FIND),
            ]
        )
        self.SetAcceleratorTable(accel_tbl)
        self.UpdateColors(self.style)
        wx.CallAfter(self._FixTbarsView)