[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/common/src/utils TextUtils.py
From: |
Jason Cater |
Subject: |
gnue/common/src/utils TextUtils.py |
Date: |
Mon, 28 Apr 2003 18:11:05 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 03/04/28 18:11:05
Modified files:
common/src/utils: TextUtils.py
Log message:
added option to remove newlines in lineWrap
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/utils/TextUtils.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
Patches:
Index: gnue/common/src/utils/TextUtils.py
diff -c gnue/common/src/utils/TextUtils.py:1.4
gnue/common/src/utils/TextUtils.py:1.5
*** gnue/common/src/utils/TextUtils.py:1.4 Tue Mar 11 22:54:58 2003
--- gnue/common/src/utils/TextUtils.py Mon Apr 28 18:11:05 2003
***************
*** 30,40 ****
import string
# very simple lineWrap
! def lineWrap(message,maxWidth):
text = ""
temptext = string.strip(str(message))
! for strings in string.split(temptext,"\n"):
while len(strings) > maxWidth:
index = 0
--- 30,45 ----
import string
# very simple lineWrap
! def lineWrap(message,maxWidth, preserveNewlines=1):
text = ""
temptext = string.strip(str(message))
! if preserveNewlines:
! buff = string.split(temptext,"\n")
! else:
! buff = (temptext,)
!
! for strings in buff:
while len(strings) > maxWidth:
index = 0
- gnue/common/src/utils TextUtils.py,
Jason Cater <=