Permalink
Switch branches/tags
Nothing to show
Commits on Dec 16, 2016
  1. Add AUTHORS file

    honza committed Dec 16, 2016
  2. Merge pull request #10 from wincent/escaping

    honza committed Dec 16, 2016
    Shell-escape searches
  3. Shell-escape searches

    wincent committed Dec 16, 2016
    I found that doing a search with parens was falling foul of shell
    escaping issues:
    
      Query: from:greg (ruby NEAR version)
      sh: -c: line 0: syntax error near unexpected token `('
      sh: -c: line 0: `{ notmuch search --output=files from:greg (ruby NEAR version); } 2>&1'
    
    The solution is to shell escape, using `shlex.quote` when available (ie.
    Python 3.3), and `pipes.quote` otherwise:
    
    -  https://docs.python.org/3/library/shlex.html#shlex.quote
    -  https://docs.python.org/2/library/pipes.html#pipes.quote
    
    As the `pipes.doc` docs say:
    
    > Deprecated since version 2.7: Prior to Python 2.7, this function was
    > not publicly documented. It is finally exposed publicly in Python
    > 3.3 as the `quote` function in the `shlex` module.
    
    So I am doing a `try`/`except` style of import.
Commits on Dec 12, 2016
  1. Merge pull request #9 from wincent/history

    honza committed Dec 12, 2016
    Add support for remembering prior searches
Commits on Dec 8, 2016
  1. Add support for remembering prior searches

    wincent committed Dec 8, 2016
    This makes the up and down keys useful.
Commits on Aug 8, 2016
  1. Bump version

    honza committed Aug 8, 2016
  2. Add version flag

    honza committed Aug 8, 2016
  3. Fix print function

    honza committed Aug 8, 2016
  4. Better ctrl-c behavior

    honza committed Aug 8, 2016
  5. Add Python 3 support

    honza committed Aug 8, 2016
Commits on Apr 21, 2016
  1. Bump version

    honza committed Apr 21, 2016
  2. Merge pull request #8 from adamdoupe/patch-1

    honza committed Apr 21, 2016
    mutt-notmuch-py crashes
Commits on Apr 14, 2016
  1. mutt-notmuch-py crashes

    adamdoupe committed Apr 14, 2016
    mutt-notmuch-py will crash when given an input with shell special characters, such as:
    (testing)
    
    This fix calls the mkarg function from commands module (which is undocumented, but is apparently the only correct function to use in Python 2) on the user input, thus escaping it correctly for use in an command argument.
Commits on Mar 22, 2016
  1. Update silly copyright notices

    honza committed Mar 22, 2016
Commits on Oct 24, 2015
  1. Add badge

    honza committed Oct 24, 2015
  2. better readme

    honza committed Oct 24, 2015
  3. rst -> md

    honza committed Oct 24, 2015
  4. Merge pull request #7 from mvanbaak/filter-on-basedir

    honza committed Oct 24, 2015
    Filter on basedir
  5. Merge pull request #6 from mvanbaak/master

    honza committed Oct 24, 2015
    Fix help output for -G
  6. Add option -p

    mvanbaak committed Oct 24, 2015
    If -p is given the files linked to the output dir are limited to source
    files that have the path given with -p in the name.
    
    This is usefull if you have a couple of mail accounts, and want to
    search only one account.
    
    Example:
    
    I have three email accounts I sync with offlineimap and index them all
    together with one notmuch index.
    To search globally, I run:
    $ mutt-notmuch -g ~/mail/temp/search
    To search only my work email, I run:
    $ mutt-notmuch -g -p 'mail/work' ~/mail/temp/search
    
    I know I could have done this with multiple notmuch databases but that
    was too much hassle with environment variables, especially with the
    combination of offlineimap, mutt, notmuch etc
  7. Fix help output for -G

    mvanbaak committed Oct 24, 2015
Commits on Jan 22, 2014
  1. Rename script

    honza committed Jan 22, 2014
  2. Add setup.py

    honza committed Jan 22, 2014
    - #4
  3. Merge pull request #3 from thiderman/speedup

    honza committed Jan 22, 2014
    Improve speed by using os.symlink() rather than ln
  4. Improve speed by using os.symlink() rather than ln

    thiderman committed Jan 22, 2014
    Shelling out to ln causes the script to take a hell of a long time, almost
    exponentially so when searching something that hits a lot of email.
    Non-scientific measurements report between 9x and 11x decrease of running time
    when using os.symlink().
    
    Also improved speed by using the slightly optimized defaultdict() for storing
    the email digests, and by dropping an extra iteration of the list returned by
    notmuch by moving filter exclusion into sha digest loop.
    
    Also did some minor cleanups:
    Changed print statement to a function for glorious Python 3 compatibility.
    Removed unnecessary use of global.
    Removed unused sys import.
    Removed redundant first mkdir -p call (the second one will create parent)
Commits on Jul 9, 2013
  1. Merge pull request #2 from MichaelRevell/patch-1

    honza committed Jul 9, 2013
    IO Errors
  2. IO Errors

    MichaelRevell committed Jul 9, 2013
    We should handle these potential IO errors, otherwise it halts the program if we happened to have deleted a file and not yet synced with notmuch (which actually happens fairly often for me).
    
    Let me know if you'd prefer to handle these errors silently or with a different error message and I'll change that. Either way, I don't think we want the program to halt because of a deleted email. :P
    
    Also, if we want, we could just wrap the open command (in digest) in the try block, but I did it outside because I didn't want to add anything to the data array if the file doesn't exist.
Commits on Sep 29, 2012
  1. Merge pull request #1 from sjl/master

    honza committed Sep 29, 2012
    Add some options (backwards compatible)
  2. Make things more configurable.

    sjl committed Sep 29, 2012
    Allows a destination folder to be passed in (defaults to the one it was before,
    for backwards-compatibility).  Also allows a -G option to disable the
    gmail-specific stuff (but defaults to the dame as before).
    
    Also adds --help thanks to optparse.
Commits on Sep 11, 2012
  1. Fix readme

    honza committed Sep 11, 2012
  2. init

    honza committed Sep 11, 2012