summaryrefslogtreecommitdiff
path: root/textutils.py
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2008-07-14 20:10:00 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2008-07-14 20:10:00 +0200
commit93ae11ba36e2a59e8d85c8dba4b8bde5a28ca206 (patch)
treecd39aed3f925679bc8a19676ce440703dcd0f6c5 /textutils.py
parentaab929e273a41a188a244b5d2c8b3e53408172ab (diff)
downloadlogilab-common-93ae11ba36e2a59e8d85c8dba4b8bde5a28ca206.tar.gz
improve doc for better epydoc generation (again).
Diffstat (limited to 'textutils.py')
-rw-r--r--textutils.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/textutils.py b/textutils.py
index 2dfe319..fec946f 100644
--- a/textutils.py
+++ b/textutils.py
@@ -255,8 +255,8 @@ TIME_UNITS = {
def apply_units( string, units, inter=None, final=float, blank_reg=_BLANK_RE,
value_reg=_VALUE_RE):
- """parse the string applying the units define in units
- eg: "1.5m",{'m',60} -> 80
+ """Parse the string applying the units defined in units
+ (eg: "1.5m",{'m',60} -> 80).
:type string: str or unicode
:param string: the string to parse
@@ -266,20 +266,12 @@ def apply_units( string, units, inter=None, final=float, blank_reg=_BLANK_RE,
:type inter: type
:param inter: used to parse every intermediate value (need __sum__)
- :default inter: final value
-
- :type inter: type
- :param inter: used to build the final object after summing them all
- :default inter: float
:type blank_reg: regexp
:param blank_reg: should match eveyr blank char to ignore.
- :default blank_reg: (\s|,)+ # match blank space and coma
:type value_reg: regexp with "value" and optional "unit" group
:param value_reg: match a value and it's unit into the
- :default value_reg: (-?(((0x?)?[0-9]+)|([0-9]+\\.[0-9]*)))([a-zA-Z]+)?
- match any number
"""
if inter is None:
inter = final