[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/common/src/utils TextUtils.py
From: |
James Thompson |
Subject: |
gnue/common/src/utils TextUtils.py |
Date: |
Tue, 11 Mar 2003 22:54:58 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: James Thompson <address@hidden> 03/03/11 22:54:58
Modified files:
common/src/utils: TextUtils.py
Log message:
fix for long lines w/ no seperators
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/utils/TextUtils.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: gnue/common/src/utils/TextUtils.py
diff -c gnue/common/src/utils/TextUtils.py:1.3
gnue/common/src/utils/TextUtils.py:1.4
*** gnue/common/src/utils/TextUtils.py:1.3 Wed Jan 1 19:45:41 2003
--- gnue/common/src/utils/TextUtils.py Tue Mar 11 22:54:58 2003
***************
*** 34,50 ****
text = ""
temptext = string.strip(str(message))
-
for strings in string.split(temptext,"\n"):
while len(strings) > maxWidth:
index = 0
for sep in [' ',',',':']:
ind = string.rfind(strings,sep,0,maxWidth-1)+1
if ind > index: index = ind
! if index > maxWidth:
index = maxWidth-1
!
text += "%s\n" % strings[:index]
strings = strings[index:]
--- 34,50 ----
text = ""
temptext = string.strip(str(message))
for strings in string.split(temptext,"\n"):
while len(strings) > maxWidth:
index = 0
+
for sep in [' ',',',':']:
ind = string.rfind(strings,sep,0,maxWidth-1)+1
if ind > index: index = ind
! if index > maxWidth or index==0:
index = maxWidth-1
!
text += "%s\n" % strings[:index]
strings = strings[index:]
***************
*** 63,66 ****
value = float(text) / {'pt':72, 'in':1, 'cm':2.54,
'mm': 25.4}[unit.lower()] * multiplier
! return value
\ No newline at end of file
--- 63,66 ----
value = float(text) / {'pt':72, 'in':1, 'cm':2.54,
'mm': 25.4}[unit.lower()] * multiplier
! return value
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/common/src/utils TextUtils.py,
James Thompson <=