Пример #1
0
    def OnViewSociety(self, evt):
        agentList = []
        self.URL = None
        self.HOST = None
        self.PORT = None
        win = ProbeDlg(self,wxNewId(), self.log, "Society Ping", size=wxSize(400, 300),style = wxDEFAULT_DIALOG_STYLE)
        win.CenterOnScreen()
        val = win.ShowModal()
        if val == wxID_OK:
            self.log.WriteText("URLDlg OK\n")
            self.log.WriteText(self.URL)
            print "read...", self.URL, "host==", self.HOST,"port==", self.PORT
            societyreader = SocietyReader(self.URL)
            self.societyReader = societyreader
            print "societyreader:", societyreader
            agentList = societyreader.readAgents()
            self.log.WriteText(str(agentList))
            self.canvas.CreateSociety(agentList)
            self.canvas.OrganizeAgents()

        else:
            self.log.WriteText("URLDlg Cancel\n")
        print "Society Viewed"

    #~ def viewSociety(self, generator_file):
        """
Пример #2
0
    def OnViewSociety(self, evt):
        agentList = []
        self.URL = None
        self.HOST = None
        self.PORT = None
        win = ProbeDlg(self,wx.NewId(), self.log, "Society Ping", size=wx.Size(400, 300),style = wx.DEFAULT_DIALOG_STYLE)
        win.CenterOnScreen()
        val = win.ShowModal()
        if val == wx.ID_OK:
            self.log.WriteText("URLDlg OK\n")
            self.log.WriteText(self.URL)
            #~ print "read...", self.URL, "host==", self.HOST,"port==", self.PORT
            societyreader = SocietyReader(self.URL)
            self.societyReader = societyreader
            #~ print "societyreader:", societyreader
            agentList = societyreader.readAgents()
            if agentList is None:
                dlg = wx.MessageDialog(self.frame, "Society not up as yet. Try again in a few seconds",
                          'Non-fatal Error', wx.OK|wx.ICON_ERROR)
                dlg.ShowModal()
                dlg.Destroy()
            else:
                self.log.WriteText(str(agentList))
                self.canvas.CreateSociety(agentList)
                self.canvas.OrganizeAgents()

        else:
            self.log.WriteText("URLDlg Cancel\n")
        #~ print "Society Viewed"

    #~ def viewSociety(self, generator_file):
        """