Make directive into a context manager, so you can abbreviate directives
using the with statement.