2 """This is a notmuch implementation in python. It's goal is to allow running the test suite on the cnotmuch python bindings."""
7 from cnotmuch import notmuch
8 #TODO Handle variable: NOTMUCH-CONFIG
10 #-------------------------------------------------------------------------
11 HELPTEXT="""The notmuch mail system.
13 Usage: notmuch <command> [args...]
15 Where <command> and [args...] are as follows:
17 setup Interactively setup notmuch for first use.
21 Find and import new messages to the notmuch database.
23 search [options...] <search-terms> [...]
25 Search for messages matching the given search terms.
27 show <search-terms> [...]
29 Show all messages matching the search terms.
31 count <search-terms> [...]
33 Count messages matching the search terms.
35 reply [options...] <search-terms> [...]
37 Construct a reply template for a set of messages.
39 tag +<tag>|-<tag> [...] [--] <search-terms> [...]
41 Add/remove tags for all messages matching the search terms.
45 Create a plain-text dump of the tags for each message.
49 Restore the tags from the given dump file (see 'dump').
51 search-tags [<search-terms> [...] ]
53 List all tags found in the database or matching messages.
57 This message, or more detailed help for the named command.
59 Use "notmuch help <command>" for more details on each command.
60 And "notmuch help search-terms" for the common search-terms syntax.
62 #-------------------------------------------------------------------------
63 #TODO: replace the dynamic pieces
64 USAGE="""Notmuch is configured and appears to have a database. Excellent!
66 At this point you can start exploring the functionality of notmuch by
67 using commands such as:
69 notmuch search tag:inbox
71 notmuch search to:"Sebastian Spaeth"
73 notmuch search from:"Sebastian@SSpaeth.de"
75 notmuch search subject:"my favorite things"
77 See "notmuch help search" for more details.
79 You can also use "notmuch show" with any of the thread IDs resulting
80 from a search. Finally, you may want to explore using a more sophisticated
81 interface to notmuch such as the emacs interface implemented in notmuch.el
82 or any other interface described at http://notmuchmail.org
84 And don't forget to run "notmuch new" whenever new mail arrives.
86 Have fun, and may your inbox never have much mail.
88 #-------------------------------------------------------------------------
89 if __name__ == '__main__':
91 # Handle command line options
93 if len(sys.argv) == 1:
96 elif sys.argv[1] == 'setup':
97 """ Interactively setup notmuch for first use. """
98 print "Not implemented."
100 elif sys.argv[1] == 'help':
101 if len(sys.argv) == 2: print HELPTEXT
102 else: print "Not implemented"
104 elif sys.argv[1] == 'new':
105 #TODO: handle --verbose
106 print "Not implemented."
109 print "Error: Unknown command '%s' (see \"notmuch help\")" % sys.argv[1]
114 search [options...] <search-terms> [...]
116 Search for messages matching the given search terms.
118 show <search-terms> [...]
120 Show all messages matching the search terms.
122 count <search-terms> [...]
124 Count messages matching the search terms.
126 reply [options...] <search-terms> [...]
128 Construct a reply template for a set of messages.
130 tag +<tag>|-<tag> [...] [--] <search-terms> [...]
132 Add/remove tags for all messages matching the search terms.
136 Create a plain-text dump of the tags for each message.
139 search-tags [<search-terms> [...] ]
141 List all tags found in the database or matching messages.