There's no real benefit to avoiding compiling empty regular expressions, and
the code is much simpler if we streamline the codepath.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
The key handling function does much more than simply exiting when "q" is
pressed, so give it a better name than "exit_on_q".
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Instead of manually creating attribute maps and text objects, simply provide
a function that does most of this. This simplifies and significantly
shortens the code that does this.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
A lot of the code stores the items for later, and using an iterator will
result in unhappiness when the data can't be iterated over more than once.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
A previous fix to ensure database upgrades worked correctly broke if a
version was not provided. This also caused a unit test to fail. Fix this
by checking for None before converting the value into the proper type.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
If Vim can autodetect that a file is a Python file, so can Emacs. Also, not
all Vim users will want to use folding, so remove that comment as well.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This allows for better diffing, and it also makes it possible to load
untrusted data from the dtb file if that becomes necessary.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
As well as testing that all files are checked into git when using git
transactions, test that the files actually checked in are exactly the
expected ones.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
The code that cloned existing records in order to export them was not only
unnecessary, but also buggy. Since it did not provide a table, this caused
JSON exports to have null in their place. Remove this filter, since it has
not been needed since when Record objects had their table name stored in
their first field.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Sort the keys for YAML output, but don't pretty-print it, because it isn't
clear if that will affect its validity as YAML 1.0 and 1.1.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
CSV output does not contain a table name, and therefore exporting all tables
would lose important information about which files were in which tables.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
The eventual goal is to have all attributes come off the database, including
schema access. When the DatabaseData object has only one method left (for
the database), it can then be refactored away itself.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>