From: Ben Steffen Date: Tue, 26 Nov 2019 19:52:21 +0000 (-0500) Subject: Fix formatting of docstrings X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-base.git/commitdiff_plain/c18a57f12a052c46ed5f3df37ff63eeae7074f43 Fix formatting of docstrings --- diff --git a/python/invirt/config.py b/python/invirt/config.py index 3a0bf2d..ae960b1 100644 --- a/python/invirt/config.py +++ b/python/invirt/config.py @@ -14,7 +14,8 @@ cache_path = '/var/lib/invirt/cache.json' lock_path = '/var/lib/invirt/cache.lock' def augment(d1, d2): - """Splice dict-tree d2 into d1. Return d1. + """ + Splice dict-tree d2 into d1. Return d1. d2 may be None for an empty dict-tree, because yaml.load produces that. @@ -25,6 +26,7 @@ def augment(d1, d2): >>> d {'a': {'b', 1, 'd': 3}, 'c': 2} """ + if d2 is None: return d1 for k in d2: @@ -35,7 +37,8 @@ def augment(d1, d2): return d1 def run_parts_list(dirname): - """Reimplements Debian's run-parts --list. + """ + Reimplements Debian's run-parts --list. One difference from run-parts's behavior: run-parts --list /foo/ will give output like /foo//bar, but run_parts_list('/foo/') gives @@ -43,6 +46,7 @@ def run_parts_list(dirname): Matches documented behavior of run-parts in debianutils v2.28.2, dated 2007. """ + # From run-parts(8). lanana_re = re.compile('^[a-z0-9]+$') lsb_re = re.compile('^_?([a-z0-9_.]+-)+[a-z0-9]+$')