aboutsummaryrefslogtreecommitdiffhomepage
path: root/devel
Commit message (Collapse)AuthorAge
* nmbug-status: Convert from XHTML 1.0 to HTML 5Gravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | | | | | | | | | HTML 5 for the win :). I also de-namespaced the language; the HTML 5 spec allows a vestigial xml:lang attribute, but it's a no-op [1], so I stripped it. This shouldn't break anything at tethera, which already serves the status as text/html: $ wget -S http://nmbug.tethera.net/status/ --2014-02-02 21:20:39-- http://nmbug.tethera.net/status/ Resolving nmbug.tethera.net... 87.98.215.224 Connecting to nmbug.tethera.net|87.98.215.224|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Vary: Accept-Encoding Content-Type: text/html ... This also matches the Content-Type in the generated HTML's http-equiv meta. [1]: http://www.w3.org/TR/html5/dom.html#the-lang-and-xml:lang-attributes
* nmbug-status: Normalize table HTML indentationGravatar W. Trevor King2014-02-10
| | | | | I don't think I've ever seen '</td><td>{value}\n' before :p. The new formatting avoids mixing tag levels and content across lines.
* nmbug-status: Add an OrderedDict stub for Python 2.6Gravatar W. Trevor King2014-02-10
| | | | | | | | | | | | Tomi Ollila and David Bremner (and presumably others) are running Python 2.6 on their nmbug-status boxes, so it makes sense to keep support for that version. This commit adds a really minimal OrderedDict stub (e.g. it doesn't handle key removal), but it gets the job done for Page._get_threads. Once we reach a point where Python 2.6 is no longer important (it's already out of it's security-fix window [1]), we can pull this stub back out. [1]: http://www.python.org/download/releases/2.6.9/
* nmbug-status: Add Page and HtmlPage for modular renderingGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was having trouble understanding the logic of the longish print_view function, so I refactored the output generation into modular bits. The basic text rendering is handled by Page, which has enough hooks that HtmlPage can borrow the logic and slot-in HTML generators. By modularizing the logic it should also be easier to build other renderers if folks want to customize the layout for other projects. Timezones ========= This commit has not effect on the output, except that some dates have been converted from the sender's timezone to UTC due to: - val = m.get_header(header) - ... - if header == 'date': - val = str.join(' ', val.split(None)[1:4]) - val = str(datetime.datetime.strptime(val, '%d %b %Y').date()) ... + value = str(datetime.datetime.utcfromtimestamp( + message.get_date()).date()) I also tweaked the HTML header date to be utcnow instead of the local now() to make all times independent of the generator's local time. This matches Gmane, which converts all Date headers to UTC (although they use a 'GMT' suffix). Notmuch uses g_mime_utils_header_decode_date to calculate the UTC timestamps, but uses a NULL tz_offset which drops the information we'd need to get back to the sender's local time [1]. With the generator's local time arbitrarily different from the sender's and viewer's local time, sticking with UTC seems the best bet. [1]: https://developer.gnome.org/gmime/stable/gmime-gmime-utils.html#g-mime-utils-header-decode-date
* nmbug-status: Add a Python-3-compatible urllib.parse.quote importGravatar W. Trevor King2014-02-10
| | | | | | | | Python 2's urllib.quote [1] has moved to urllib.parse.quote in Python 3 [2]. [1]: http://docs.python.org/2/library/urllib.html#urllib.quote [2]: http://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote
* nmbug-status: Consolidate HTML header printingGravatar W. Trevor King2014-02-10
| | | | | | | | Make this all one big string, using '...{date}...'.format(date=...) to inject the date [1]. This syntax was added in Python 2.6, and is preferred to %-formatting in Python 3 [1]. [1]: http://docs.python.org/2/library/stdtypes.html#str.format
* nmbug-status: Don't require write accessGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | The database in only used for notmuch.Query, so there's no need for write access. This allows nmbug-status to run while the database is being updated, without raising: A Xapian exception occurred opening database: Unable to get write lock on …: already locked Traceback (most recent call last): File "./nmbug-status", line 182, in <module> db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) File "/…/notmuch/database.py", line 154, in __init__ self.open(path, mode) File "/…/notmuch/database.py", line 214, in open raise NotmuchError(status) notmuch.errors.XapianError
* nmbug-status: Consolidate functions and main codeGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | The definitions of Thread, output_with_separator, and print_view were between the main argparse and view-printing code. Group them together with our existing read_config at the top of the module, which makes for easier reading in the main section. I also: * Made 'headers' a print_view argument instead of a module-level global. The list -> tuple conversion avoids having a mutable default argument, which makes some people jumpy ;). * Made 'db' a print_view argument instead of relying on the global namespace to access it from print_view.
* nmbug-status: Add metavars for --config and --get-queryGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | Now the suggested usage (listed by 'nmbug-status --help') is: usage: nmbug-status [-h] [--text] [--config PATH] [--list-views] [--get-query VIEW] instead of the less obvious: usage: nmbug-status [-h] [--text] [--config CONFIG] [--list-views] [--get-query GET_QUERY]
* nmbug-status: Factor config-loading out into read_configGravatar W. Trevor King2014-02-10
| | | | | By isolating this peripheral handling, we make the core logic of nmbug-status easier to read.
* nmbug-status: Decode Popen output using the user's localeGravatar W. Trevor King2014-02-10
| | | | | | | | | | | | | | | | | | | | | | Avoid: $ ./nmbug-status --list-views Traceback (most recent call last): File "./nmbug-status", line 47, in <module> 'cat-file', 'blob', sha1+':status-config.json'], TypeError: can't concat bytes to str by explicitly converting the byte-stream read from Popen into a Unicode string. On Python 2, this conversion is str -> unicode; on Python 3 it is bytes -> str. _ENCODING is derived from the user's locale (or system default) in an attempt to match Git's output encoding. It may be more robust to skip the encoding/decoding by using a Python wrapper like pygit2 [1] for Git access. That's a fairly heavy dependency though, and using the locale will probably work. [1]: http://www.pygit2.org/
* nmbug-status: Use email.utils instead of rfc822Gravatar W. Trevor King2014-02-10
| | | | | | | rfc822 has been deprecated since Python 2.3, and it's gone in Python 3 [1]. [1]: http://docs.python.org/2/library/rfc822.html
* nmbug-status: Convert to Python-3-compatible print functionsGravatar W. Trevor King2014-02-10
| | | | We shouldn't require folks to install Python 2 to run nmbug-status.
* devel: add doxygen configuration fileGravatar Jani Nikula2014-01-05
| | | | | | | | | | This is a pretty basic config to get started, generated using 'doxygen -s -g' and mildly tweaked. To generate the library man page man/man3/notmuch.3 from lib/notmuch.h use: $ doxygen devel/doxygen.cfg
* devel/release-checks.sh: adjust to LIBNOTMUCH version checksGravatar Tomi Ollila2013-12-30
| | | | | | NOTMUCH_VERSION_* macros in lib/notmuch.h are replaced with LIBNOTMUCH_VERSION_* macros. Check that the values of those match the LIBNOTMUCH_*_VERSION values in lib/Makefile.local.
* devel/release-checks.sh: check NOTMUCH_(MAJOR|MINOR|MICRO)_VERSIONGravatar Tomi Ollila2013-11-11
| | | | | | New defines NOTMUCH_MAJOR_VERSION, NOTMUCH_MINOR_VERSION and NOTMUCH_MICRO_VERSION were added to lib/notmuch.h. Check that these match the current value defined in ./version.
* emacs: Fix search tagging racesGravatar Austin Clements2013-11-08
| | | | | | | | | | | | | | This fixes races in thread-local and global tagging in notmuch-search (e.g., "+", "-", "a", "*", etc.). Previously, these would modify tags of new messages that arrived after the search. Now they only operate on the messages that were in the threads when the search was performed. This prevents surprises like archiving messages that arrived in a thread after the search results were shown. This eliminates `notmuch-search-find-thread-id-region(-search)' because these functions strongly encouraged racy usage. This fixes the two broken tests added by the previous patch.
* Add TODO about more efficient stable thread queriesGravatar Austin Clements2013-11-08
|
* search: Add stable queries to thread search resultsGravatar Austin Clements2013-11-08
| | | | | | | | | | | | | | These queries will match exactly the set of messages currently in the thread, even if more messages later arrive. Two queries are provided: one for matched messages and one for unmatched messages. This can be used to fix race conditions with tagging threads from search results. While tagging based on a thread: query can affect messages that arrived after the search, tagging based on stable queries affects only the messages the user was shown in the search UI. Since we want clients to be able to depend on the presence of these queries, this ushers in schema version 2.
* schemata: Disambiguate non-terminal namesGravatar Austin Clements2013-11-08
| | | | | | | | Previously, the show schema and the search schema used different "thread" non-terminals. While these schemata don't interact, this is still confusing, so rename search's "thread" to "thread_summary". To further limit confusion, prefix all top-level search non-terminals now begin with "search_".
* TODO: keybindings for next/previous thread doneGravatar Jani Nikula2013-05-31
|
* devel: add dkg's printmimestructure script to notmuch devel scriptsGravatar David Bremner2013-05-23
| | | | | | | | I find this script pretty useful when figuring out who to blame for MIME rendering problems. The notmuch repo will be the new primary home for this script, unless and until a better home turns up.
* TODO: remove some completed todo items from the listGravatar Jani Nikula2013-04-14
| | | | | | Bash completion has been rewritten. Configuration file saves follow symlinks. There is --config=FILE top level option to specify configuration file.
* nmbug-status: only import notmuch when neededGravatar Jani Nikula2013-04-06
| | | | | Make it possible to use the script to query search views without notmuch python bindings installed.
* nmbug-status: add support for querying the search viewsGravatar Jani Nikula2013-04-06
| | | | Make it easy for scripts to read the views and corresponding searches.
* devel: add post-release tools news2wiki.pl and man-to-mdwn.plGravatar Tomi Ollila2013-03-29
| | | | | | | | | After new notmuch release has been published the NEWS and manual pages have been updated using these 2 programs. Adding the tools to notmuch repository eases their use, adds more transparency to the "process" and gives more people chance to do the updates is one is unavailable to do it at the time being.
* devel/STYLE: information how to enable standard pre-commit hookGravatar Tomi Ollila2013-03-29
| | | | | It is easier to enable git standard pre-commit hook, when the operation to do so is presented.
* nmbug: allow empty prefixGravatar David Bremner2013-03-02
| | | | | | | Current code does not distinguish between an empty string in the NMBPREFIX environment variable and the variable being undefined. This makes it impossible to define an empty prefix, if, e.g. somebody wants to dump all of their tags with nmbug.
* nmbug: replace hard-coded magic hash with git-hash-objectGravatar David Bremner2013-03-02
| | | | | | This is at least easier to understand than the magic hash. It may also be a bit more robust, although it is hard to imagine these numbers changing without many other changes in git.
* nmbug: use 'notmuch tag --batch'Gravatar David Bremner2013-03-02
| | | | | | | | This should be more robust with respect to tags with whitespace and and other special characters. It also (hopefully) fixes a remaining bug handling message-ids with whitespace. It should also be noticeably faster for large sets of changes since it does one exec per change set as opposed to one exec per tag changed.
* nmbug: use dump --format=batch-tagGravatar David Bremner2013-03-02
| | | | | | | This should make nmbug tolerate tags with whitespace and other special characters it. At the moment this relies on _not_ passing calls to notmuch tag through the shell, which is a documented feature of perl's system function.
* devel/release-checks.sh: added check that 1st NEWS header is tidyGravatar Tomi Ollila2013-02-18
| | | | | | | Check that the underlining '===...' for first (header) line in NEWS file is of the same length as the header text and it is all '=':s. -- extra execs removed by db.
* nmbug: move from contrib to develGravatar David Bremner2013-02-16
| | | | | | | There seems to be consensus to use presence in contrib as documentation of limited support by the notmuch developers; in fact nmbug is pretty integrated into our current development process, so devel seems more appropriate.
* TODO: update entry on date range queriesGravatar Jani Nikula2013-01-24
|
* TODO: cleanup stuff that has been doneGravatar Jani Nikula2013-01-24
| | | | | | | | M-RET notmuch-show-open-or-close-all opens all closed messages. The archiving change is mentioned twice, remove dupe. "notmuch search" supports --format=text0 to work with xargs -0
* CLI: remove alias machinery, and "part", "search-tags" commandsGravatar David Bremner2013-01-22
| | | | | | The commands are long deprecated, so removal is probably overdue. The real motivation is to simplify argument handling for notmuch so that we can migrate to the common argument parsing framework.
* devel/release-checks.sh: version string problem does not halt executionGravatar Tomi Ollila2013-01-19
| | | | | | | | | | Version string has strict format requirements in release-check.sh: only numbers and periods (in sane order) are accepted. Mismatch there used to halt further execution. In this case, checking versions like '*~rc1' for (more) problems was not possible. This 'fatal error' is now changed buffered error message like in following tests, and is displayed at the end of execution.
* show: indicate length, encoding of omitted body contentGravatar Peter Wang2012-12-17
| | | | | | | | | | | If a leaf part's body content is omitted, return the encoded length and transfer encoding in --format=json output. This information may be used by the consumer, e.g. to decide whether to download a large attachment over a slow link. Returning the _encoded_ content length is more efficient than returning the _decoded_ content length. Returning the transfer encoding allows the consumer to estimate the decoded content length.
* cli: Framework for structured output versioningGravatar Austin Clements2012-12-16
| | | | | | | | | | | | | | | | | | | | | Currently there is a period of pain whenever we make backward-incompatible changes to the structured output format, which discourages not only backward-incompatible improvements to the format, but also backwards-compatible additions that may not be "perfect". In the end, these problems limit experimentation and innovation. This series of patches introduces a way for CLI callers to request a specific format version on the command line and to determine if the CLI does not supported the requested version (and perhaps present a useful diagnostic to the user). Since the caller requests a format version, it's also possible for the CLI to support multiple incompatible versions simultaneously, unlike the alternate approach of including version information in the output. This patch lays the groundwork by introducing a versioning convention, standard exit codes, and a utility function to check the requested version and produce standardized diagnostic messages and exit statuses.
* Use the S-Expression structured printer in notmuch-show, notmuch-reply and ↵Gravatar Peter Feigl2012-12-08
| | | | | | | notmuch-search. This patch uses the new S-Expression printer in the notmuch CLI (show, search and reply). You can now use --format=sexp for any of them.
* Rename the -json printer functions in notmuch-reply and notmuch-show to ↵Gravatar Peter Feigl2012-12-08
| | | | | | | | | generic -sprinter functions. All the structured output functions in notmuch-reply and notmuch-show are renamed to a generic name (as they do not contain any json-specific code anyway). This patch is a preparation to actually using the new S-Expression sprinter in notmuch-reply and notmuch-show.
* devel: Document schemata in STYLEGravatar Austin Clements2012-11-08
|
* devel: Add Reply-to to the schemataGravatar Austin Clements2012-11-08
| | | | The code got out of sync with the documentation in 7d3c06dc.
* uncrustify.cfg: added 3 new types for uncrustify to knowGravatar Tomi Ollila2012-11-07
| | | | | | | Added FILE, notmuch_show_params_t and sprinter_t to be types when uncrustifying sources. This affect spacing when uncrustify is deciding for type declaration instead of binary multiplication operation.
* devel: add release-checks.shGravatar Tomi Ollila2012-09-05
| | | | | | | | | | | | | | | | | | | | | | Currently Makefile.local contains some machine executable release checking functionality. This is unnecessarily complex way to do it: Multiline script functionality is hard to embed -- from Makefile point of view there is just one line split using backslashes and every line ends with ';'. It is hard to maintain such "script" when it gets longer. The embedded script does not fail as robust as separate script; set -eu could be added to get same level of robustness -- but the provided Bourne Again Shell (bash) script exceeds this with 'set -o pipefail', making the script to fail when any of the commands in pipeline fails (and not just the last one). Checking for release is done very seldom compared to all other use; The whole Makefile.local gets simpler and easier to grasp when most release checking targets are removed. When release checking is done, the steps are executed sequentially; nothing is allowed to be skipped due to some satisfied dependency.
* schemata: update for --body=true|false optionGravatar Mark Walters2012-07-24
| | | | | | Previously body: was a compulsory field in a message. The new --body=false option causes notmuch show to omit this field so update schemata to reflect this.
* Add missing "tags" field to search schemaGravatar Austin Clements2012-07-09
| | | | | This field is output by search, but it didn't make it into the documentation.
* Minor correction to devel/schemataGravatar Mark Walters2012-06-30
| | | | | | In id:"87sjdm12d1.fsf@awakening.csail.mit.edu" Austin pointed out that devel/schemata needs a slight correction with the new --entire-thread=false option. This is that correction.
* Update devel/schemata for --entire-thread=falseGravatar Mark Walters2012-06-29
| | | | Also remove the Json --entire-thread item from devel/TODO.
* uncrustify.cfg: comments and more typesGravatar Tomi Ollila2012-06-03
| | | | | | | | | Changes to devel/uncrustify.cfg: * Updated header comment to state this is config file for *notmuch*. * Added comment about the reason of 'type' keyword used. * Added some more custom types woth 'type' keyword. * Have (every) multiline comment lines start with '*'.