summaryrefslogtreecommitdiff
path: root/dotbot/util
diff options
context:
space:
mode:
authorJoshua Blum <joshblum@mit.edu>2015-04-24 12:47:42 +0300
committerAnish Athalye <me@anishathalye.com>2015-04-24 18:33:13 -0400
commit56d8d05e777e3831b9a0fab0bbdd45af72185b9f (patch)
tree98eec834aa9df68373c6a10d570b75001c4f75d1 /dotbot/util
parentfd08ddacd34530186f3954b435d4dd90b5b9471f (diff)
Provide exception information when reading config
Diffstat (limited to 'dotbot/util')
-rw-r--r--dotbot/util/string.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/dotbot/util/string.py b/dotbot/util/string.py
new file mode 100644
index 0000000..2a19b10
--- /dev/null
+++ b/dotbot/util/string.py
@@ -0,0 +1,4 @@
+def indent_lines(string, amount=2, delimiter='\n'):
+ whitespace = ' ' * amount
+ sep = '%s%s' % (delimiter, whitespace)
+ return '%s%s' % (whitespace, sep.join(string.split(delimiter)))