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