Mercurial > hg > python
comparison nono.py @ 15:22b0894c0f4c
fixed Column.updateHeader wrt 5a, but broke it wrt C0 and missing red for R2
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sun, 22 Mar 2020 18:15:42 +0000 |
parents | 1e961cf10f88 |
children | a7a10e40b344 |
comparison
equal
deleted
inserted
replaced
14:1e961cf10f88 | 15:22b0894c0f4c |
---|---|
190 def checkX(self,pos,crosspos): | 190 def checkX(self,pos,crosspos): |
191 # New x at pos, are there others that can be xed out now? | 191 # New x at pos, are there others that can be xed out now? |
192 # Overkill as is? | 192 # Overkill as is? |
193 dprint('cx',self.cLet+str(crosspos),pos) | 193 dprint('cx',self.cLet+str(crosspos),pos) |
194 if self.runs: | 194 if self.runs: |
195 start0=0 if self.margin0==0 else self.margin0+1 | 195 start0=self.margin0 # 0 if self.margin0==0 else self.margin0+1 |
196 if self.marginal(range(start0,pos+1),self.runs[0]): | 196 if self.marginal(range(start0,pos),self.runs[0]): |
197 dprint('cx1a') | 197 dprint('cx1a') |
198 else: | 198 else: |
199 dprint('cx1b') | 199 dprint('cx1b') |
200 # if len(self.runs)>1: | 200 # if len(self.runs)>1: |
201 startN=self.marginN if (self.marginN==self.n-1) else self.marginN-1 | 201 startN=self.marginN # self.marginN if (self.marginN==self.n-1) else self.marginN-1 |
202 if self.marginal(range(startN,pos,-1),self.runs[-1]): | 202 if self.marginal(range(startN,pos,-1),self.runs[-1]): |
203 dprint('cx2a') | 203 dprint('cx2a') |
204 else: | 204 else: |
205 dprint('cx2b') | 205 dprint('cx2b') |
206 | 206 |
367 if maxHeight is None: | 367 if maxHeight is None: |
368 # update | 368 # update |
369 if pre: | 369 if pre: |
370 for rc in str(r): | 370 for rc in str(r): |
371 self.infix.append(RedFmt%rc) | 371 self.infix.append(RedFmt%rc) |
372 self.infix.append("-" if self.runs else "") | 372 if self.runs: |
373 self.infix.append('-') | |
373 else: | 374 else: |
374 # post | 375 # post |
375 ins=["-"] | 376 ins=["-"] if self.runs else [] |
376 for rc in str(r): | 377 for rc in str(r): |
377 ins.append(RedFmt%r) | 378 ins.append(RedFmt%r) |
378 self.suffix=ins+self.suffix | 379 self.suffix=ins+self.suffix |
379 dprint('CuH1: |%s|,%s,%s,%s'%(self.prespace,self.infix,self.suffix,self.runs)) | 380 dprint('CuH1: |%s|,%s,%s,%s'%(self.prespace,self.infix,self.suffix,self.runs)) |
380 self.header=(["-"]*self.prespace)+\ | 381 self.header=([" "]*self.prespace)+\ |
381 self.infix+\ | 382 self.infix+\ |
382 ['-'.join(str(c) for c in self.runs)]+\ | 383 (['-'.join(str(c) for c in self.runs)] if self.runs else [])+\ |
383 self.suffix | 384 self.suffix |
384 else: | 385 else: |
385 # init | 386 # init |
386 self.maxHeight=maxHeight | 387 self.maxHeight=maxHeight |
387 self.infix=[] | 388 self.infix=[] |