summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-06-12 22:19:20 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-06-12 22:19:20 +0000
commitec812fbba1eba0eca156b7d740a367867a9102f7 (patch)
tree0babfef21db943221fc747b227e0eb329771c07c
parent099a75c19f1c2fdb401aba3617edb3d2bc148959 (diff)
downloadpyparsing-ec812fbba1eba0eca156b7d740a367867a9102f7.tar.gz
Fix docstring formatting for epydoc
Cleaned up expression naming in pyparsing_common git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@368 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r--src/pyparsing.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py
index f2dbde9..5fb3fbc 100644
--- a/src/pyparsing.py
+++ b/src/pyparsing.py
@@ -3972,11 +3972,11 @@ class pyparsing_common:
signedInteger = Regex(r'[+-]?\d+').setName("signed integer").setParseAction(convertToInteger)
"""expression that parses an integer with optional leading sign, returns an int"""
- fraction = signedInteger.addParseAction(convertToFloat) + '/' + signedInteger.addParseAction(convertToFloat).setName("fraction")
+ fraction = (signedInteger.addParseAction(convertToFloat) + '/' + signedInteger.addParseAction(convertToFloat)).setName("fraction")
"""fractional expression of an integer divided by an integer, returns a float"""
fraction.addParseAction(lambda t: t[0]/t[-1])
- mixed_integer = fraction | integer + Optional(Optional('-').suppress() + fraction).setName("fraction or mixed integer-fraction")
+ mixed_integer = (fraction | integer + Optional(Optional('-').suppress() + fraction)).setName("fraction or mixed integer-fraction")
"""mixed integer of the form 'integer - fraction', with optional leading integer, returns float"""
mixed_integer.addParseAction(sum)
@@ -4016,7 +4016,7 @@ class pyparsing_common:
Helper to create a parse action for converting parsed date string to Python datetime.date
Params -
- - fmt - format to be passed to datetime.strptime (default="%Y-%m-%d")
+ - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"})
"""
return lambda s,l,t: datetime.strptime(t[0], fmt).date()
@@ -4026,7 +4026,7 @@ class pyparsing_common:
Helper to create a parse action for converting parsed datetime string to Python datetime.datetime
Params -
- - fmt - format to be passed to datetime.strptime (default="%Y-%m-%dT%H:%M:%S.%f")
+ - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"})
"""
return lambda s,l,t: datetime.strptime(t[0], fmt)
@@ -4034,7 +4034,7 @@ class pyparsing_common:
"ISO8601 date (C{yyyy-mm-dd})"
iso8601_datetime = Regex(r'(?P<year>\d{4})-(?P<month>\d\d)-(?P<day>\d\d)[T ](?P<hour>\d\d):(?P<minute>\d\d)(:(?P<second>\d\d(\.\d*)?)?)?(?P<tz>Z|[+-]\d\d:?\d\d)?').setName("ISO8601 datetime")
- "ISO8601 datetime (C{yyyy-mm-ddThh:mm:ss.s(Z|+-00:00)}) - trailing seconds and timezone optional"
+ "ISO8601 datetime (C{yyyy-mm-ddThh:mm:ss.s(Z|+-00:00)}) - trailing seconds, milliseconds, and timezone optional; accepts separating C{'T'} or C{' '}"
uuid = Regex(r'[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}').setName("UUID")
"UUID (C{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx})"