Changeset 57
- Timestamp:
- 02/08/04 21:34:16 (5 years ago)
- Files:
-
- 05/devel/kombilo.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
05/devel/kombilo.py
r56 r57 952 952 duplist.append(os.path.join(db['sgfpath'], g[0])) 953 953 return duplist 954 955 956 def listOfCurrentSGFFiles(self): 957 l = [] 958 for db in self.DBlist: 959 if db['disabled']: continue 960 for i in db['current']: 961 l.append(os.path.join(db['sgfpath'], getFilename(db['data'][i][0]))) 962 return l 963 954 964 955 965 … … 5620 5630 # -------------------------------------------------------------------- 5621 5631 5632 5633 def copyCurrentGamesToFolder(self): 5634 dir = askdirectory(initialdir=self.datapath) 5635 if not dir: return 5636 dir = str(dir) 5637 5638 if not os.path.exists(dir) and askokcancel('Error', 'Directory ' + dir + ' does not exist. Create it?'): 5639 try: 5640 os.makedirs(dir) 5641 except: 5642 return 5643 5644 l = self.gamelist.listOfCurrentSGFFiles() 5645 for f in l: 5646 inf = open(f) 5647 s = inf.read() 5648 inf.close() 5649 5650 outfile = os.path.join(dir, os.path.split(f)[-1]) 5651 if os.path.exists(outfile): continue 5652 out = open(outfile, 'w') 5653 out.write(s) 5654 out.close() 5655 5656 5657 5622 5658 def askMaxLengthPrevSearchStack(self): 5623 5659 s = askstring('Configure Back button', 'Enter maximal number of searches to remember:\n' + \ … … 6000 6036 self.filemenu.insert_command(7, label='Export current position', command=self.exportCurrentPos) 6001 6037 self.filemenu.insert_command(8, label='Export SGF', command=self.exportSGF) 6002 6038 6039 self.filemenu.insert_command(9, label='Copy current SGF files to folder', 6040 command=self.copyCurrentGamesToFolder) 6003 6041 6004 6042 self.customMenus = customMenus(self)
