def OnDeleteSpecRepo(self, event): item = self.dataListView.Selection if item != None: row = self.dataListView.ItemToRow(item) specRepo = PTCommandPathConfig.podspecList[row] PTCommand().removeSpecRepo(specRepo[0], self.logCallback, self.OnDeleteSpecRepoCompleteCallback)
def OnAddSpecRepo(self, event): name = self.specRepoNameText.GetValue() remotePath = self.specRepoPathText.GetValue() if len(name) > 0 and len(remotePath) > 0: PTCommand().addSpecRepo(name, remotePath, self.logCallback, self.callback) else: wx.MessageBox(u"Should fill all inputs.", u"Error", wx.OK | wx.ICON_INFORMATION)
def OnDropFileCallback(self, filepath): if self.loadingCtrl.IsPlaying() == True: self.OnEnterDropCallback(False) return self.ShowLoading(True) self.OnEnterDropCallback(False) PTCommand().svnCheckPath(filepath, self.logCallback, self.OnCheckSvnEnable)
def OnCheckPodCommand(self, event): self.checkPodLoadingCtrl.Show() self.checkPodLoadingCtrl.Play() self.checkPodCommandBtn.Enable(False) self.checkPodCommandBtn.SetLabelText(u"Checking") self.Layout() PTCommand().checkPodCommand(self.logCallback, self.OnCheckPodCommandCallback)
def OnSvnUpdateCallback(self, success, result): if success == 0: self.UpdateProgress(30, u"Svn check conflict...") PTCommand().svnCheckConflict(self.module, self.logCallback, self.OnSvnCheckConflictCallback) else: wx.MessageBox(u"Svn update failed.\n%s" % result, u"Error", wx.OK | wx.ICON_INFORMATION) self.EndModal(wx.ID_OK)
def OnCommitFilesCallback(self, result): if result == True: self.UpdateProgress(70, u"Svn tag module...") PTCommand().tagModule(self.module, self.logCallback, self.OnTagModuleCallback) else: wx.MessageBox(u"Svn committing files failed.\n%s" % result, u"Error", wx.OK | wx.ICON_INFORMATION) self.EndModal(wx.ID_OK)
def OnSvnChooseCallback(self, cancelCommit, commitList=None, addList=None, deleteList=None, commitMsg=None): if cancelCommit == True: self.EndModal(wx.ID_OK) else: self.UpdateProgress(60, u"Svn committing files...") PTCommand().svnCommitFiles(self.module, commitList, addList, deleteList, commitMsg, self.logCallback, self.OnCommitFilesCallback)
def OnTagModuleCallback(self, success, result): if success == 0: if len(self.module.sepcName) > 0: self.ContinueToPublish() else: if PTCommandPathConfig.podspecList == None: self.UpdateProgress(75, u"Fetch podspec repo list...") PTCommand().getSpecRepoList(self.logCallback, self.OnGetSpecListCallback) else: self.UpdateProgress(85, u"Select module podspec repo...") self.OnChooseSpecRepo() else: wx.MessageBox(u"Svn tag module failed.\n%s" % result, u"Error", wx.OK | wx.ICON_INFORMATION) self.EndModal(wx.ID_OK)
def __init__(self, parent, logCallback, closeCallback): super(PTSpecRepoFrame, self).__init__(parent, wx.ID_ANY, u"Podspec Repo List", size=(600, 400), style=wx.CLOSE_BOX | wx.SYSTEM_MENU) self.logCallback = logCallback self.closeCallback = closeCallback hasList = (PTCommandPathConfig.podspecList != None) self.SetupUI(hasList) self.Bind(wx.EVT_CLOSE, self.OnClose) if hasList: self.OnSuccessGetSpecRepoList() else: PTCommand().getSpecRepoList(self.logCallback, self.OnGetSpecRepoListCompleteCallback) self.CentreOnScreen() self.Show(True)
def OnOKAction(self, event): if self.notWorkingCopy == True: self.OnCancelAction(event) else: PTCommand().svnUpgrade(self.path, self.logCallback, self.OnSVNUpgradeCallback)
def publishModule(self): self.UpdateProgress(15, u"Svn updating...") PTCommand().svnUpdateModule(self.module, self.logCallback, self.OnSvnUpdateCallback)
def ContinueToPublish(self): self.UpdateProgress(90, u"Publish module to pod repo...") PTCommand().publishModule(self.module, self.logCallback, self.OnPublishModuleCallback)