def login(self): host = '%s:%s' % (str(self.tServer.text()), str(self.tPort.text())) user = unicode(self.tAuthor.text()) password = unicode(self.tPassword.text()) pms_core.login(host, user, password, os.path.join(PILLARS_HOME, 'cookie')) self.loginButton.setIcon(QtGui.QIcon(QtGui.QPixmap(':/login.png'))) proj_data = pms_core.projects() if not proj_data: return False self.projects_list.clear() projects = json.loads(proj_data) for proj in projects: item = QtGui.QListWidgetItem(proj['name']) item.setData(1, proj['id']) self.projects_list.addItem(item) return True
def testMGPane(): pms_core.login('pms.pillars.lan:80', 'kun.wang', '123123', 'E:\\home\\Pillars\\cookie') app = QtGui.QApplication(sys.argv) asset_mg = AssetMGPane() asset_mg.show() sys.exit(app.exec_())