Mercurial > hg > config
changeset 796:892b53d86ff5
this was mostly a note to self; never used
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 28 Oct 2016 10:42:49 -0700 |
parents | 171d85c69553 |
children | 3575840553c8 |
files | python/tippytodos.py |
diffstat | 1 files changed, 0 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/python/tippytodos.py Fri Oct 28 10:41:54 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import argparse -import os -import sys -from subprocess import check_output - -def call(command, **kwargs): - kwargs.setdefault('shell', True) - print (command) - return check_output(command, **kwargs) - -def main(args=sys.argv[1:]): - - usage = '%prog [options]' - parser = argparse.ArgumentParser(usage=usage, description=__doc__) - parser.add_argument('--mark', dest='mark', default='#') - parser.add_argument('-d', '--directory', dest='directory', default='.') - parser.add_argument('-p', '--pattern', dest='pattern', default='*.py') - options = parser.parse_args(args) - - command = ['find', options.directory, '-iname', options.pattern, - '|', - 'grep', '' ... ] # to finish - - output = check_output(subprocess.list2cmdline(command)) - -if __name__ == '__main__': - main()