/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
DybPython::svndiff::Diff Class Reference
Inheritance diagram for DybPython::svndiff::Diff:
Inheritance graph
[legend]
Collaboration diagram for DybPython::svndiff::Diff:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def dump
def split_
def __str__
def __repr__
def check

Public Attributes

 children
 meta
 divs
 parent

Properties

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

Detailed Description

Hold the raw text of the full output of "svn diff" or "svnlook diff"
and split into sub-Delta using the divider

Definition at line 342 of file svndiff.py.


Constructor & Destructor Documentation

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

Reimplemented from DybPython::svndiff::Text.

Definition at line 347 of file svndiff.py.

00348                                         :
00349         Text.__init__(self, *args, **kwargs)
00350         self.children = self.split_(Delta,lambda l:Delta.ptn[1].match(l), offset=-1 )
00351         self.check()
00352         pass


Member Function Documentation

def DybPython::svndiff::Diff::dump (   self)

Definition at line 353 of file svndiff.py.

00354                   :
00355         print repr(self)
00356         for dlt in self.children:
00357             print repr(dlt)
00358             if self.meta.get('verbose',False):
00359                 for blk in dlt.children:
00360                     print repr(blk)
00361                     for hnk in blk.children:
00362                         if hnk.smry:
00363                             print repr(hnk)
00364 

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

Reimplemented from DybPython::svndiff::Text.

Definition at line 347 of file svndiff.py.

Definition at line 179 of file svndiff.py.

Definition at line 179 of file svndiff.py.

Definition at line 179 of file svndiff.py.


Property Documentation

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

Definition at line 206 of file svndiff.py.

DybPython::svndiff::Text::smry = property(_smry) [static, inherited]

Reimplemented in DybPython::svndiff::Hunk.

Definition at line 210 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