Show More
@@ -91,6 +91,7 b' class patchnode(object):' | |||||
91 | def allchildren(self): |
|
91 | def allchildren(self): | |
92 | "Return a list of all of the direct children of this node" |
|
92 | "Return a list of all of the direct children of this node" | |
93 | raise NotImplementedError("method must be implemented by subclass") |
|
93 | raise NotImplementedError("method must be implemented by subclass") | |
|
94 | ||||
94 | def nextsibling(self): |
|
95 | def nextsibling(self): | |
95 | """ |
|
96 | """ | |
96 | Return the closest next item of the same type where there are no items |
|
97 | Return the closest next item of the same type where there are no items | |
@@ -110,7 +111,6 b' class patchnode(object):' | |||||
110 | def parentitem(self): |
|
111 | def parentitem(self): | |
111 | raise NotImplementedError("method must be implemented by subclass") |
|
112 | raise NotImplementedError("method must be implemented by subclass") | |
112 |
|
113 | |||
113 |
|
||||
114 | def nextitem(self, constrainlevel=True, skipfolded=True): |
|
114 | def nextitem(self, constrainlevel=True, skipfolded=True): | |
115 | """ |
|
115 | """ | |
116 | If constrainLevel == True, return the closest next item |
|
116 | If constrainLevel == True, return the closest next item | |
@@ -236,7 +236,6 b' class uiheader(patchnode):' | |||||
236 | self.neverunfolded = True |
|
236 | self.neverunfolded = True | |
237 | self.hunks = [uihunk(h, self) for h in self.hunks] |
|
237 | self.hunks = [uihunk(h, self) for h in self.hunks] | |
238 |
|
238 | |||
239 |
|
||||
240 | def prettystr(self): |
|
239 | def prettystr(self): | |
241 | x = stringio() |
|
240 | x = stringio() | |
242 | self.pretty(x) |
|
241 | self.pretty(x) | |
@@ -392,6 +391,7 b' class uihunk(patchnode):' | |||||
392 | def allchildren(self): |
|
391 | def allchildren(self): | |
393 | "return a list of all of the direct children of this node" |
|
392 | "return a list of all of the direct children of this node" | |
394 | return self.changedlines |
|
393 | return self.changedlines | |
|
394 | ||||
395 | def countchanges(self): |
|
395 | def countchanges(self): | |
396 | """changedlines -> (n+,n-)""" |
|
396 | """changedlines -> (n+,n-)""" | |
397 | add = len([l for l in self.changedlines if l.applied |
|
397 | add = len([l for l in self.changedlines if l.applied | |
@@ -455,6 +455,7 b' class uihunk(patchnode):' | |||||
455 |
|
455 | |||
456 | def __getattr__(self, name): |
|
456 | def __getattr__(self, name): | |
457 | return getattr(self._hunk, name) |
|
457 | return getattr(self._hunk, name) | |
|
458 | ||||
458 | def __repr__(self): |
|
459 | def __repr__(self): | |
459 | return '<hunk %r@%d>' % (self.filename(), self.fromline) |
|
460 | return '<hunk %r@%d>' % (self.filename(), self.fromline) | |
460 |
|
461 | |||
@@ -766,7 +767,6 b' class curseschunkselector(object):' | |||||
766 | # negative values scroll in pgup direction |
|
767 | # negative values scroll in pgup direction | |
767 | self.scrolllines(selstart - padstartbuffered) |
|
768 | self.scrolllines(selstart - padstartbuffered) | |
768 |
|
769 | |||
769 |
|
||||
770 | def scrolllines(self, numlines): |
|
770 | def scrolllines(self, numlines): | |
771 | "scroll the screen up (down) by numlines when numlines >0 (<0)." |
|
771 | "scroll the screen up (down) by numlines when numlines >0 (<0)." | |
772 | self.firstlineofpadtoprint += numlines |
|
772 | self.firstlineofpadtoprint += numlines | |
@@ -894,7 +894,6 b' class curseschunkselector(object):' | |||||
894 | if isinstance(item, (uiheader, uihunk)): |
|
894 | if isinstance(item, (uiheader, uihunk)): | |
895 | item.folded = not item.folded |
|
895 | item.folded = not item.folded | |
896 |
|
896 | |||
897 |
|
||||
898 | def alignstring(self, instr, window): |
|
897 | def alignstring(self, instr, window): | |
899 | """ |
|
898 | """ | |
900 | add whitespace to the end of a string in order to make it fill |
|
899 | add whitespace to the end of a string in order to make it fill | |
@@ -1133,7 +1132,6 b' class curseschunkselector(object):' | |||||
1133 | lineprefix = " "*self.hunkindentnumchars + checkbox |
|
1132 | lineprefix = " "*self.hunkindentnumchars + checkbox | |
1134 | frtoline = " " + hunk.getfromtoline().strip("\n") |
|
1133 | frtoline = " " + hunk.getfromtoline().strip("\n") | |
1135 |
|
1134 | |||
1136 |
|
||||
1137 | outstr += self.printstring(self.chunkpad, lineprefix, towin=towin, |
|
1135 | outstr += self.printstring(self.chunkpad, lineprefix, towin=towin, | |
1138 | align=False) # add uncolored checkbox/indent |
|
1136 | align=False) # add uncolored checkbox/indent | |
1139 | outstr += self.printstring(self.chunkpad, frtoline, pair=colorpair, |
|
1137 | outstr += self.printstring(self.chunkpad, frtoline, pair=colorpair, |
General Comments 0
You need to be logged in to leave comments.
Login now