diff options
Diffstat (limited to 'pomu/util')
-rw-r--r-- | pomu/util/cache.py | 3 | ||||
-rw-r--r-- | pomu/util/fs.py | 1 | ||||
-rw-r--r-- | pomu/util/str.py | 6 |
3 files changed, 10 insertions, 0 deletions
diff --git a/pomu/util/cache.py b/pomu/util/cache.py index b1d09b2..93502c5 100644 --- a/pomu/util/cache.py +++ b/pomu/util/cache.py @@ -2,6 +2,9 @@ Caches the return value of a function -> Result, regardless of input params """ class cached(): + """ + A decorator to make the function cache its return value, regardless of input + """ def __init__(self, fun): self.fun = fun def __call__(self, *args): diff --git a/pomu/util/fs.py b/pomu/util/fs.py index 3e69e2e..5d25ec5 100644 --- a/pomu/util/fs.py +++ b/pomu/util/fs.py @@ -11,5 +11,6 @@ def strip_prefix(string, prefix): return string def remove_file(repo, dst): + """Removes a file from a repository""" repo.index.remove(dst) os.remove(dst) diff --git a/pomu/util/str.py b/pomu/util/str.py index 419425b..96a7c81 100644 --- a/pomu/util/str.py +++ b/pomu/util/str.py @@ -1,4 +1,10 @@ +"""String processing utilities""" def pivot(string, idx, keep_pivot=True): + """ + A function to split a string in two, pivoting at string[idx]. + If keep_pivot is set, the pivot character is included in the second string. + Alternatively, it is omitted. + """ if keep_pivot: return (string[:idx], string[idx:]) else: |