diff --git a/dotfiles/lib/python/imalison.py b/dotfiles/lib/python/imalison.py index 515ea09b..d6a0c579 100644 --- a/dotfiles/lib/python/imalison.py +++ b/dotfiles/lib/python/imalison.py @@ -1,6 +1,6 @@ import os import errno -from invoke import run +from invoke import run, Collection, ctask def link_filenames(ctx, link_pairs, force=False): @@ -26,3 +26,15 @@ def ensure_path_exists(path): def command_exists(command, run=run): return run("hash {0}".format(command), warn=True, hide=True).exited == 0 + + +def build_task_factory(ns): + def task(function): + ns.add_task(ctask(function)) + return function + return task + + +def namespace_and_factory(): + ns = Collection() + return ns, build_task_factory(ns) diff --git a/dotfiles/lib/python/merge_zsh_history.py b/dotfiles/lib/python/merge_zsh_history.py index e92f57aa..b70e3267 100644 --- a/dotfiles/lib/python/merge_zsh_history.py +++ b/dotfiles/lib/python/merge_zsh_history.py @@ -1,5 +1,6 @@ import re + history_entry_re = re.compile(": ([0-9]*):[0-9]*;.*")