Changeset 160

Show
Ignore:
Timestamp:
08/17/04 16:50:16 (4 years ago)
Author:
ug
Message:

Show place of match in game list. Misc.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 06/devel/aglPY.py

    r153 r160  
    200200        if self.showDate: sl.append(l[5]+', ') 
    201201        try: 
    202             sl.append(join(self.DBlist[`self.boardsize`][DBindex].results[indexWithinCurrent], '')) 
    203         except: pass 
     202            sl.append(', '.join([x.output() for x in self.DBlist[`self.boardsize`][DBindex].results[indexWithinCurrent]])) 
     203        except IndexError: pass 
    204204        return join(sl, '') 
    205205 
  • 06/devel/algosPY.py

    r150 r160  
    4242    def moveno(self): 
    4343        if self.where: 
    44             print self.where 
     44            # print self.where 
    4545            return self.where 
    4646        else: 
     
    5151                return [int(labelStr)] 
    5252 
     53    def output(self): 
     54        if not self.where: return '/' + self.labelStr 
     55        if len(self.where) == 1: return str(self.where[0]) + self.labelStr 
     56        m = 0 
     57        i = 0 
     58        while i < len(self.where): 
     59            if i%2: m += 1 
     60            else: m += self.where[i] 
     61            i += 1 
     62        return 'V' + str(m) + self.labelStr 
    5363 
    5464 
     
    326336    of black/white moves and captures, respectively. The coordinates of the move/capture are 
    327337    appended (as two bytes) to the movelist, and the second coordinate gets a flag indicating 
    328     what happend at this positon (BLACK/WHITE/REMOVE). 
     338    what happened at this positon (BLACK/WHITE/REMOVE). 
    329339 
    330340    In addition, if in the first byte the ENDOFNODE flag is set, this event is the last event 
     
    518528          of a variation, we reset the dictionaries etc. to the values stored in the topmost entry of the 
    519529          stack. 
    520  
    521530        """ 
    522531         
     
    688697                                        dicts[m]['found'] = counter 
    689698                                        dicts[m]['whereAreWe'] = copy(whereAreWe) 
    690                                         print 'found', counter, whereAreWe 
     699                                        # print 'found', counter, whereAreWe 
    691700                                        del dicts[m]['foundInitial'] 
    692701                                else: 
     
    779788                                dicts[m]['found'] = counter 
    780789                                dicts[m]['whereAreWe'] = copy(whereAreWe) 
    781                                 print 'found1', counter, whereAreWe 
     790                                # print 'found1', counter, whereAreWe 
    782791                            else: dicts[m]['foundInitial'] = counter 
    783792 
  • 06/devel/kombilo.py

    r152 r160  
    327327 
    328328 
    329 def askdirectory(**options): return apply(chooseDirectory, (), options).show() 
     329def askdirectory(**options):  
     330    return apply(chooseDirectory, (), options).show() 
    330331 
    331332# --------------------------------------------------------------------------------------- 
     
    19431944        # results = [join(l.results, '|%') for l in self.gamelist.DBlist[`self.boardsize`]] 
    19441945        # FIXME results (is now list of Hit's) 
    1945         cursorSn = [self.cursor, self.cursor.currentGame, self.cursor.currentN.pathToNode()] 
    1946  
    1947  
     1946        # cursorSn = [self.cursor, self.cursor.currentGame, self.cursor.currentN.pathToNode()] 
    19481947        # see FIXME above (boardData = ...) 
    1949         #self.prevSearches.append([boardData, games, results, copy(self.continuations), 
     1948        # self.prevSearches.append([boardData, games, results, copy(self.continuations), 
    19501949        #                       self.noMatches, self.noSwitched, self.Bwins, self.Wwins, 
    19511950        #                       self.modeVar.get(), self.fixedColorVar.get(), self.fixedAnchorVar.get(), 
     
    24962495 
    24972496    def getAnchors(self): 
    2498         print 'ANCHORS' 
    2499         print self.sel 
     2497        # print 'ANCHORS' 
     2498        # print self.sel 
    25002499        if self.sel[0] == (0,0) or \ 
    25012500           (self.sel[0][0], self.sel[1][1]) == (0,self.boardsize-1) or \ 
     
    25222521                                self.boardsize-2 -self.sel[1][1]+self.sel[0][1])] 
    25232522        anchors.sort() # FIXME: is this necessary? 
    2524         print anchors 
     2523        # print anchors 
    25252524        return anchors 
    25262525 
  • 06/devel/searchPY.py

    r153 r160  
    572572        win = self.getCurrentWinner() 
    573573        self.newCurrent.append(self.current[self.currentIndexWithinCurrent]) 
     574        if not results is None and not type(results) == type([]): print 'Error' # FIXME 
    574575        self.results.append(results) 
    575576 
     
    587588        currentWithinDB = self.current[self.currentIndexWithinCurrent] 
    588589        return self.namelist[currentWithinDB][3] 
    589  
    590590 
    591591# --------------------------------------------------------------------------------------- 
  • 06/devel/v.py

    r152 r160  
    22052205 
    22062206        if not filename: 
    2207             path, filename = os.path.split(tkFileDialog.askopenfilename(filetypes=[('SGF files', '*.sgf'), 
    2208                                                                                    ('All files', '*')], 
    2209                                                                         initialdir=self.sgfpath)) 
     2207            aof = tkFileDialog.askopenfilename(filetypes=[('SGF files', '*.sgf'), ('All files', '*')], initialdir=self.sgfpath) 
     2208            if aof: path, filename = os.path.split(aof) 
    22102209        if filename: 
    22112210            try: