| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybPython::svndiff::Hunk Class Reference

Inheritance diagram for DybPython::svndiff::Hunk:
[legend]
Collaboration diagram for DybPython::svndiff::Hunk:
[legend]
List of all members.

Public Member Functions

def __init__
def split_
def __str__
def __repr__
def check

Public Attributes

 meta
 divs
 children

Static Public Attributes

tuple smry = property(_smry)
tuple nchild = property(_nchild)
tuple 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 196 of file svndiff.py.


Member Function Documentation

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

Reimplemented from DybPython::svndiff::Text.

Definition at line 198 of file svndiff.py.

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

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

Reimplemented from DybPython::svndiff::Text.

Definition at line 200 of file svndiff.py.

00200                                        :
00201         Text.__init__(self, *args, **kwargs)
00202     def _smry(self):
00203         c = self.meta['c'] 
00204         if c in "+-":
00205             return c
        else:

def DybPython::svndiff::Text::split_ (   self,
  cls,
  predicate = lambda line:True,
  offset = 0 
) [inherited]

Definition at line 140 of file svndiff.py.

00144                                                :True, offset=0 ):
00145         divs = []
00146         for n,line in enumerate(self):
00147             if predicate(line):
00148                 divs.append(n+offset)
00149         self.divs = divs
00150         children = []
00151         for i, n in enumerate(divs):
00152             if i + 1 < len(divs):
00153                 m = divs[i+1]
00154             else:
00155                 m = len(self) 

def DybPython::svndiff::Text::__str__ (   self  )  [inherited]

Definition at line 164 of file svndiff.py.

00164                    :
00165         return "".join([c.smry for c in self.children])
    smry = property(_smry)    

def DybPython::svndiff::Text::__repr__ (   self  )  [inherited]

Reimplemented in DybPython::svndiff::Delta.

Definition at line 166 of file svndiff.py.

00168                      :
00169         return "\n".join(self)
00170     def __repr__(self):
00171         try:
00172             label = "%(index)s[%(begin)s:%(end)s]" % self.meta
        except KeyError:

def DybPython::svndiff::Text::check (   self,
  verbose = False,
  hdr = None 
) [inherited]

Check can put together the split text 

Definition at line 175 of file svndiff.py.

00177                                  :"\n".join([str(c) for c in self.children]))
00178 
00179     def check(self, verbose=False, hdr=None ):
00180         """Check can put together the split text """ 
00181         rejo = self.rejoin 
00182         if hdr:
00183             rejo = "\n".join([ hdr, rejo])
00184 
00185         agree = str(self) == rejo
00186 
00187         if verbose or not(agree):
00188             print "." * 50 + " original " + "." * 50 
00189             print str(self)
00190             print "." * 50 + " recombined " + "." * 50 
00191             print rejo


Member Data Documentation

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

Reimplemented from DybPython::svndiff::Text.

Definition at line 206 of file svndiff.py.

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

Definition at line 158 of file svndiff.py.

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

Definition at line 173 of file svndiff.py.

DybPython::svndiff::Text::meta [inherited]

Definition at line 135 of file svndiff.py.

DybPython::svndiff::Text::divs [inherited]

Definition at line 137 of file svndiff.py.

DybPython::svndiff::Text::children [inherited]

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

Definition at line 138 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 Mon Apr 11 20:13:02 2011 for DybPython by doxygen 1.4.7