Changeset 510 in tailor


Ignore:
Timestamp:
08/06/05 18:07:24 (8 years ago)
Author:
lele@…
Hash name:
20050806160724-97f81-dee22ebf3bd9a25f8ae7a1c71c461347426b6414
Message:

M-x whitespace-cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/changes.py

    r474 r510  
    11# -*- mode: python; coding: utf-8 -*- 
    2 # :Progetto: vcpx -- Changesets  
     2# :Progetto: vcpx -- Changesets 
    33# :Creato:   ven 11 giu 2004 15:31:18 CEST 
    44# :Autore:   Lele Gaifax <lele@nautilus.homeip.net> 
    55# :Licenza:  GNU General Public License 
    6 #  
     6# 
    77 
    88""" 
     
    2121    to indicate possible conflicts. 
    2222    """ 
    23      
     23 
    2424    ADDED = 'ADD' 
    2525    DELETED = 'DEL' 
     
    2929    APPLIED = 'APPLIED' 
    3030    CONFLICT = 'CONFLICT' 
    31      
     31 
    3232    def __init__(self, name): 
    3333        self.name = name 
     
    5353from textwrap import TextWrapper 
    5454from re import compile, MULTILINE 
    55      
     55 
    5656itemize_re = compile('^[ ]*[-*] ', MULTILINE) 
    5757 
     
    6464    starting with either a dash "-" or an asterisk "*". 
    6565    """ 
    66      
     66 
    6767    wrapper = TextWrapper() 
    6868    res = [] 
    6969    items = itemize_re.split(msg.strip()) 
    70      
     70 
    7171    if len(items)>1: 
    7272        # Remove possible first empty split, when the message immediately 
     
    7474        if not items[0]: 
    7575            del items[0] 
    76              
     76 
    7777        if len(items)>1: 
    7878            wrapper.initial_indent = '- ' 
    7979            wrapper.subsequent_indent = ' '*2 
    80                  
     80 
    8181    for item in items: 
    8282        if item: 
     
    100100    REFILL_MESSAGE = True 
    101101    """Refill changelogs""" 
    102      
     102 
    103103    def __init__(self, revision, date, author, log, entries=None, **other): 
    104104        """ 
    105105        Initialize a new Changeset. 
    106106        """ 
    107          
     107 
    108108        self.revision = revision 
    109109        self.date = date 
     
    127127        self.entries.append(e) 
    128128        return e 
    129      
     129 
    130130    def __str__(self): 
    131131        s = [] 
     
    149149        Apply the changeset using ``patch(1)`` to a given directory. 
    150150        """ 
    151          
     151 
    152152        from shwrap import ExternalCommand 
    153153        from source import ChangesetApplicationFailure 
     
    163163            patch = ExternalCommand(cwd=working_dir, command=cmd) 
    164164            patch.execute(input=self.unidiff) 
    165              
     165 
    166166            if patch.exit_status: 
    167167                raise ChangesetApplicationFailure( 
    168168                    "%s returned status %s" % (str(patch), patch.exit_status)) 
    169          
     169 
    170170    def addedEntries(self): 
    171171        """ 
    172172        Facility to extract a list of added entries. 
    173173        """ 
    174          
     174 
    175175        return [e for e in self.entries if e.action_kind == e.ADDED] 
    176176 
Note: See TracChangeset for help on using the changeset viewer.