# HG changeset patch # User sirebral # Date 1251347085 18000 # Node ID 65c212e9a5b4f87c4e5f8b35d05946a3b6e43369 # Parent 51bb772c36092aa14cbf2dbae089d8dd05b41713 Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows. diff -r 51bb772c3609 -r 65c212e9a5b4 orpg/orpg_version.py --- a/orpg/orpg_version.py Mon Aug 24 00:56:09 2009 -0500 +++ b/orpg/orpg_version.py Wed Aug 26 23:24:45 2009 -0500 @@ -4,7 +4,7 @@ #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed) DISTRO = "Traipse Dev" DIS_VER = "Ornery Orc" -BUILD = "090824-00" +BUILD = "090826-00" # This version is for network capability. PROTOCOL_VERSION = "1.2" diff -r 51bb772c3609 -r 65c212e9a5b4 orpg/tools/orpg_log.py --- a/orpg/tools/orpg_log.py Mon Aug 24 00:56:09 2009 -0500 +++ b/orpg/tools/orpg_log.py Wed Aug 26 23:24:45 2009 -0500 @@ -53,8 +53,11 @@ logger.exception(msg) crash_report.close() logger.exception("Crash Report Created!!") - logger.info("Printed out a datafile called crash-report.txt\nPress to exit!", True); raw_input('') - exit() + logger.info("Printed out crash-report.txt in your System folder", True) + if sys.platform in ('win32', 'win64'): + logger.info("Press to continue!", True) + raw_input('') + #exit() class DebugConsole(wx.Frame): def __init__(self, parent): diff -r 51bb772c3609 -r 65c212e9a5b4 upmana/updatemana.py --- a/upmana/updatemana.py Mon Aug 24 00:56:09 2009 -0500 +++ b/upmana/updatemana.py Wed Aug 26 23:24:45 2009 -0500 @@ -463,7 +463,7 @@ ## Control Panel cp = wx.Panel(self) self.cp = wx.GridBagSizer(hgap=1, vgap=1) - self.buttons['update'] = wx.Button(cp, wx.ID_ANY, "Revision Update") + self.buttons['update'] = wx.Button(cp, wx.ID_ANY, "Revision Update") self.buttons['delete'] = wx.Button(cp, wx.ID_ANY, "Delete Branch") self.cp.Add(self.buttons['update'], (0,0)) self.cp.Add(self.buttons['delete'], (0,1)) @@ -483,41 +483,51 @@ self.SetAutoLayout(True) self.current = self.repo.dirstate.branch() - - self.RevInfo(self.current) - self.revlist.Select(self.revlist.FindItem(0, - str(self.repo.changelog.rev(self.repo.branchtags()[self.current]))), - True) - + self.currev = self.repo.changelog.rev(self.repo.branchtags()[self.current]) + self.RevInfo(self.currev) + self.revlist.Select(self.revlist.FindItem(0, str(self.currev), 1)) self.BranchInfo(self.current) self.Bind(wx.EVT_CHOICE, self.PackageSet) - self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.PackageSet) + self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.RevSet) + self.Bind(wx.EVT_BUTTON, self.RevUpdate, self.buttons['update']) + def PackageSet(self, event): - self.current = self.branches.GetStringSelection() branches = self.repo.branchtags() heads = dict.fromkeys(self.repo.heads(), 1) l = [((n in heads), self.repo.changelog.rev(n), n, t) for t, n in branches.items()] - if self.current != type: heads = dict.fromkeys(self.repo.heads(), self.repo.branchtags()) branches = dict.copy(self.repo.branchtags()) self.BranchInfo(self.current) self.RevInfo(self.current) - def RevInfo(self, branch): + def RevSet(self, event): + self.currev = self.revlist.GetItemText( self.revlist.GetFirstSelected() ) + i = event.GetIndex() + self.revlist.Select(i, True) + self.revlist.Focus(i) + if self.currev != self.revlist.GetItemText( self.revlist.GetFirstSelected() ): + self.RevInfo(self.currev) + + def RevInfo(self, rev): self.revlist.DeleteAllItems() - for heads in self.repo.changelog.reachable(self.repo.branchtags()[branch]): - self.revlist.InsertStringItem(0, str(self.repo.changelog.rev(heads)), 0 ) - self.revlist.SetStringItem(0, 1, str(self.repo.changectx(heads))) + self.revlist_a = []; self.revlist_b = {} + for heads in self.repo.changelog.reachable(self.repo.branchtags()[self.current]): + self.revlist_a.append(str(self.repo.changelog.rev(heads))) + self.revlist_b[str(self.repo.changelog.rev(heads))] = str(self.repo.changectx(heads)) + self.revlist_a.sort() + for i in self.revlist_a: + self.revlist.InsertStringItem(0, str(i), 0 ) + self.revlist.SetStringItem(0, 1, self.revlist_b[i]) self.revlist.SetColumnWidth(0, -1) self.revlist.SetColumnWidth(1, -1) self.revlist.Refresh() + self.BranchInfo(self.current) def BranchInfo(self, branch): - rev = self.revlist.GetItemText( self.revlist.GetFirstSelected() ) - rs = self.repo.changectx( rev ).changeset() + rs = self.repo.changectx( self.currev ).changeset() self.changelog.SetValue('') changelog = rs[4] self.changelog.AppendText(changelog + '\n') @@ -526,6 +536,30 @@ self.filelist.AppendText("Files Modified (in update): \n") for f in rs[3]: self.filelist.AppendText(f+"\n") + def DelBranch(self, event): + pass + + def RevUpdate(self, event): + filename = 'ignorelist.txt' + self.filename = dir_struct["home"] + 'upmana' + os.sep + filename + component.get('validate').config_file(filename, "default_ignorelist.txt") + self.mana = self.LoadDoc() + temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + for ignore in self.ignorelist: + shutil.copy(ignore, temp + ignore.split('/')[len(ignore.split('/')) - 1]) + hg.clean(self.repo, self.currev) + for ignore in self.ignorelist: + shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) + os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) + pass + + def LoadDoc(self): + ignore = open(self.filename) + self.ignorelist = [] + for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) + manifest = ignore.readlines() + ignore.close() + def get_packages(self, type=None): #Fixed and ready for Test. Can be cleaner self.package_list = [] @@ -617,10 +651,9 @@ shutil.copy(ignore, temp + ignore.split('/')[len(ignore.split('/')) - 1]) hg.clean(self.repo, self.current) for ignore in self.ignorelist: - print ignore.split('/')[len(ignore.split('/')) - 1] shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) - else: print 'No default repository set, skipping Auto Update!' #Add better warning! + else: wx.MessageBox('No default Rpository set. Skipping Auto Update!', 'Info') def LoadDoc(self): ignore = open(self.filename) diff -r 51bb772c3609 -r 65c212e9a5b4 upmana/validate.py --- a/upmana/validate.py Mon Aug 24 00:56:09 2009 -0500 +++ b/upmana/validate.py Wed Aug 26 23:24:45 2009 -0500 @@ -12,7 +12,7 @@ class Validate: def __init__(self, userpath=None): if userpath is None: - userpath = dir_struct["user"] + userpath = dir_struct["home"] + os.sep + 'upmana' +os.sep self.__loadUserPath = userpath def config_file(self, user_file, template_file):