aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/format.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-02-03 16:00:24 +0200
committerGuido Günther <agx@sigxcpu.org>2015-04-01 21:01:54 +0200
commite6f1283b73c4dfaccbaf9a117d83e98fa768144c (patch)
tree70b89dc9bc168528175f24081a0740bfafbeb84f /gbp/format.py
parent1e6672bfda9131eedb6adf158cddd19091e1d8c7 (diff)
gbp.format: rename format_msg() to format_str()
The new name more precisely describes it as it can be used to format any strings (e.g. tag names) and not only messages. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/format.py')
-rw-r--r--gbp/format.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gbp/format.py b/gbp/format.py
index 9c37bb15..c367dc59 100644
--- a/gbp/format.py
+++ b/gbp/format.py
@@ -18,20 +18,20 @@
from gbp.errors import GbpError
-def format_msg(msg, args):
+def format_str(msg, args):
"""
Format a string with the given dict. Be a bit more verbose than
default python about the error cause.
- >>> format_msg("%(foo)", {})
+ >>> format_str("%(foo)", {})
Traceback (most recent call last):
...
GbpError: Failed to format %(foo): Missing value 'foo' in {}
- >>> format_msg("%(foo)", {'foo': 'bar'})
+ >>> format_str("%(foo)", {'foo': 'bar'})
Traceback (most recent call last):
...
GbpError: Failed to format %(foo) with {'foo': 'bar'}: incomplete format
- >>> format_msg("A %(foo)s is a %(bar)s", {'foo': 'dog', 'bar': 'mamal'})
+ >>> format_str("A %(foo)s is a %(bar)s", {'foo': 'dog', 'bar': 'mamal'})
'A dog is a mamal'
"""
try: