Changeset 22 in tailor for vcpx/changes.py
- Timestamp:
- 06/22/04 10:19:31 (9 years ago)
- Hash name:
- 20040622081931-97f81-5a4673a5f01b6493006286a798be70f33c0b0c66
- File:
-
- 1 edited
-
vcpx/changes.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/changes.py
r11 r22 46 46 47 47 48 from textwrap import TextWrapper 49 from re import compile, MULTILINE 50 51 itemize_re = compile('^[ ]*[-*] ', MULTILINE) 52 53 def refill(msg): 54 wrapper = TextWrapper() 55 s = [] 56 items = itemize_re.split(msg) 57 if len(items)>1: 58 if len(items)>2: 59 if items[0]: 60 wrapper.initial_indent = ' - ' 61 wrapper.subsequent_indent = ' '*3 62 else: 63 del items[0] 64 65 for m in items: 66 if m: 67 s.append(wrapper.fill(' '.join(filter(None, m.split(' '))))) 68 s.append('') 69 70 return '\n'.join(s) 71 72 48 73 class Changeset(object): 49 74 """ … … 61 86 self.date = date 62 87 self.author = author 63 self.log = log88 self.log = refill(log) 64 89 self.entries = entries 65 90
Note: See TracChangeset
for help on using the changeset viewer.
