/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes | Properties | Private Member Functions
DybPython::svndiff::Hunk Class Reference
Inheritance diagram for DybPython::svndiff::Hunk:
Inheritance graph
[legend]
Collaboration diagram for DybPython::svndiff::Hunk:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def split_
def __str__
def __repr__
def check

Public Attributes

 meta
 divs
 children
 parent

Properties

 smry = property(_smry)
 nchild = property(_nchild)
 rejoin = property(lambda self:"\n".join([str(c) for c in self.children]))

Private Member Functions

def _smry

Detailed Description

I define a hunk to be a stretch of diff text that shares the same first character...

Definition at line 240 of file svndiff.py.


Constructor & Destructor Documentation

def DybPython::svndiff::Hunk::__init__ (   self,
  args,
  kwargs 
)

Reimplemented from DybPython::svndiff::Text.

Definition at line 244 of file svndiff.py.

00245                                        :
        Text.__init__(self, *args, **kwargs)

Member Function Documentation

def DybPython::svndiff::Hunk::_smry (   self) [private]

Reimplemented from DybPython::svndiff::Text.

Definition at line 246 of file svndiff.py.

00247                    :
00248         c = self.meta['c'] 
00249         if c in "+-":
00250             return c
00251         else:
            return ""
def DybPython::svndiff::Text::split_ (   self,
  cls,
  predicate = lambda line:True,
  offset = 0 
) [inherited]

Definition at line 187 of file svndiff.py.

00187                                                :True, offset=0 ):
00188         divs = []
00189         for n,line in enumerate(self):
00190             if predicate(line):
00191                 divs.append(n+offset)
00192         self.divs = divs
00193         children = []
00194         for i, n in enumerate(divs):
00195             if i + 1 < len(divs):
00196                 m = divs[i+1]
00197             else:
00198                 m = len(self) 
00199             child = cls(self[n:m], index=i, begin=n+1, end=m)   ## 1-based begin/end numbering for direct vi "set nu" comparison 
00200             child.parent = self  
00201             children.append(child) 
00202         return children
00203 
def DybPython::svndiff::Text::__str__ (   self) [inherited]

Definition at line 212 of file svndiff.py.

00213                      :
        return "\n".join(self)
def DybPython::svndiff::Text::__repr__ (   self) [inherited]

Reimplemented in DybPython::svndiff::Delta.

Definition at line 214 of file svndiff.py.

00215                       :
00216         try:
00217             label = "%(index)s[%(begin)s:%(end)s]" % self.meta
00218         except KeyError:
00219             label = "%r" % self.meta     
00220         return "%s %s (%d) %d [%s] " % ( self.__class__.__name__, label, len(self), self.nchild, self.smry  ) 

def DybPython::svndiff::Text::check (   self,
  verbose = False,
  hdr = None 
) [inherited]
Check can put together the split text 

Definition at line 223 of file svndiff.py.

00224                                              :
00225         """Check can put together the split text """ 
00226         rejo = self.rejoin 
00227         if hdr:
00228             rejo = "\n".join([ hdr, rejo])
00229 
00230         agree = str(self) == rejo
00231 
00232         if verbose or not(agree):
00233             print "." * 50 + " original " + "." * 50 
00234             print str(self)
00235             print "." * 50 + " recombined " + "." * 50 
00236             print rejo
00237             print "." * 100
00238         assert agree , ("mismatch for %s %r " % ( self.__class__.__name__, self) ) 


Member Data Documentation

Definition at line 179 of file svndiff.py.

Definition at line 179 of file svndiff.py.

Reimplemented in DybPython::svndiff::Block, DybPython::svndiff::Delta, and DybPython::svndiff::Diff.

Definition at line 179 of file svndiff.py.

Definition at line 179 of file svndiff.py.


Property Documentation

DybPython::svndiff::Hunk::smry = property(_smry) [static]

Reimplemented from DybPython::svndiff::Text.

Definition at line 252 of file svndiff.py.

DybPython::svndiff::Text::nchild = property(_nchild) [static, inherited]

Definition at line 206 of file svndiff.py.

DybPython::svndiff::Text::rejoin = property(lambda self:"\n".join([str(c) for c in self.children])) [static, inherited]

Definition at line 221 of file svndiff.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:41 for DybPython by doxygen 1.7.4