Commit graph

370 commits

Author SHA1 Message Date
brian m. carlson
455acb833c
Don't needlessly copy all the records.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-17 22:39:20 +00:00
brian m. carlson
b78eeba4c9
Eliminate useless callback type checks.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-16 21:24:22 +00:00
brian m. carlson
d4d61cf452
Simplify callback type checking.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-16 21:22:43 +00:00
brian m. carlson
95873edc0e
Simplify search code.
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>
2014-03-16 21:02:02 +00:00
brian m. carlson
5dda2812c2
Fix record deletion functionality.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-15 19:40:26 +00:00
brian m. carlson
f0fb198916
Simplify key handling code.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-12 01:38:59 +00:00
brian m. carlson
f707a05cc5
Choose a better name for the key handling function.
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>
2014-03-12 01:35:07 +00:00
brian m. carlson
003e13695f
Refactor out callbacks for RecordListViews.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-11 01:16:03 +00:00
brian m. carlson
cd32416548
Refactor out selection of the current item.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-10 22:57:09 +00:00
brian m. carlson
08d69c8389
Actually look up records in SearchRecordView.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-05 23:52:47 +00:00
brian m. carlson
816e92aa6d
Bump version to v5~pre1.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-05 02:20:56 +00:00
brian m. carlson
9dd008c850
Fix a few old references to sub-databases.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-05 02:17:32 +00:00
brian m. carlson
f5f552dde0
Refactor text styling.
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>
2014-03-05 02:15:21 +00:00
brian m. carlson
a29ff3cbac
Replace if-else statement with ternary.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-05 02:02:25 +00:00
brian m. carlson
ca7410fb25
Use new filter logic where possible.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-04 01:38:27 +00:00
brian m. carlson
daa3d6fef7
Ensure that records() always returns a list.
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>
2014-03-04 01:34:55 +00:00
brian m. carlson
dc4a1b21e7
Add automatic record filtering.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-03-02 22:36:18 +00:00
brian m. carlson
9db3563ba8
Ensure upgrades work if no version is provided.
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>
2014-02-26 00:37:41 +00:00
brian m. carlson
c6b79197fd
Remove editor-specific comments.
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>
2014-02-18 20:10:12 +00:00
brian m. carlson
63bc52354d
Allow command-line upgrades and downgrades.
This allows for easier testing of conversions.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-18 02:51:48 +00:00
brian m. carlson
5e39f3f885
Ensure CSV downgrades don't corrupt data.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-18 02:50:36 +00:00
brian m. carlson
5bef62bef5
Ensure that the preferred version has the right type.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-18 02:50:18 +00:00
brian m. carlson
c0405f126c
Remove duplicate test.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-17 02:54:15 +00:00
brian m. carlson
63345a969d
Prefer JSON over pickle.
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>
2014-02-14 02:58:47 +00:00
brian m. carlson
e753bf26f3
Add more database format tests.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-13 03:39:56 +00:00
brian m. carlson
3051df1650
Add the ability to upgrade to any given version.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-13 03:17:08 +00:00
brian m. carlson
19b0507da0
Add support for compression automatically based on version.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-13 03:07:25 +00:00
brian m. carlson
d145cdb068
Add tests for compression version.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-13 03:05:18 +00:00
brian m. carlson
faa606e6e9
Add a version field for compression type.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-12 03:06:32 +00:00
brian m. carlson
24f1e7728b
Add additional database tests.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-08 23:16:04 +00:00
brian m. carlson
8422918f6e
Verify that new databases meet strict validation.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-08 01:56:24 +00:00
brian m. carlson
061b98abaa
Verify that new database pass validation.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-07 02:14:17 +00:00
brian m. carlson
77712b3150
Add tests for upgrading databases.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-02-06 03:38:25 +00:00
brian m. carlson
eb67121630
Test what files are checked in to git.
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>
2014-02-01 03:16:00 +00:00
brian m. carlson
ee2987f3fc
Implement lzma compression.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-28 00:31:57 +00:00
brian m. carlson
60a6acb44c Use an SHA-256 check for xz compression.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-26 23:50:56 +00:00
brian m. carlson
ed232bc6ba
Add support for xz compression.
This support isn't available in newfol proper, but filemanip does support
it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-26 02:57:54 +00:00
brian m. carlson
f915b16a0b
List table name in JSON exports.
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>
2014-01-25 01:34:30 +00:00
brian m. carlson
ec7365fb17
Pretty-print JSON output.
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>
2014-01-25 01:20:35 +00:00
brian m. carlson
4a343d324c
Allow exporting all tables for non-CSV.
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>
2014-01-25 01:10:50 +00:00
brian m. carlson
e7986043c0
Make help for table options refer to tables.
The help previously referred to databases, which was confusing.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-25 01:03:10 +00:00
brian m. carlson
6491b5ebaa
Add JSON as a valid storage format for databases.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-25 01:01:07 +00:00
brian m. carlson
3e64a897c2
Refactor out records property from DatabaseData.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-24 05:51:53 +00:00
brian m. carlson
4f8e04930b
Refactor out edoptions property from DatabaseData.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-24 05:47:41 +00:00
brian m. carlson
1af520e209
Refactor out the version property from DatabaseData.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-24 05:39:16 +00:00
brian m. carlson
2746bf0476
Refactor out the homedir property from DatabaseData.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-24 05:37:23 +00:00
brian m. carlson
8d7ef22319
Refactor database access in DatabaseData.
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>
2014-01-24 05:33:59 +00:00
brian m. carlson
1cd9478454
Remove property columns from DatabaseData.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-24 05:29:36 +00:00
brian m. carlson
9db7217230
Remove unused property nfields from DatabaseData.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-24 05:27:46 +00:00
brian m. carlson
d8089177e8
Remove legacy property layout from DatabaseData.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-01-24 05:26:15 +00:00