brian m. carlson
7d61cfbdce
Convert some NewfolErrors to DataErrors.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-06 00:44:09 +00:00
brian m. carlson
c4aaf59940
Add support for per-user configuration.
...
By default, the file in $XDG_CONFIG_HOME/newfol/defaults will be read
and parsed almost exactly as if it were a schema file. If it is
missing, nothing happens.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-05 23:36:29 +00:00
brian m. carlson
9c9662ae9a
Add support for loading configuration files.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-05 23:23:34 +00:00
brian m. carlson
26a83e68d7
Make Schema.load a regular method.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-05 23:04:57 +00:00
brian m. carlson
42643dface
Use a more specific class for schema errors.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-05 23:01:45 +00:00
brian m. carlson
6131cc6c43
Make Schema.load_file a regular method.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-05 22:56:31 +00:00
brian m. carlson
07983b4a32
Allow loading schema data from an arbitrary file.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-05 22:51:09 +00:00
brian m. carlson
476863a44b
Allow longer names for schema fields.
...
The current names are hard to remember. Allow using longer names for
most fields.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-05 22:48:07 +00:00
brian m. carlson
ee1a228919
Add support for specifying keyboard shortcuts.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-04 23:14:39 +00:00
brian m. carlson
6279323334
Create a session object.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-31 22:39:38 +00:00
brian m. carlson
8563e90739
Remove unused code.
...
The only case in which we can call toggle_state from outside of the
class it's declared in is in DisplayTemplateRecordView. However, we no
longer try to toggle the first cell, which is the only one that can
contain a non-checkbox. Remove this code since it is never used.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-30 22:33:29 +00:00
brian m. carlson
b46144f50c
Write KeyboardShortcuts more naturally.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-30 01:22:08 +00:00
brian m. carlson
fc2b1cb177
Centralize list of default transaction types.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-29 02:14:18 +00:00
brian m. carlson
4984feef92
Allow changing transaction types during upgrade.
...
The --txntype option, while useful, overrode the types of transactions
both on load and store. While this was fine for some types of
transactions, like the git type, this prevented converting from one type
of hash transaction to another. Add an option, --from-txntype, which
overrides the load transactions only on upgrade.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-28 23:20:09 +00:00
brian m. carlson
58c15a77c3
Allow specifying multiple transaction types on the command line.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-28 23:08:31 +00:00
brian m. carlson
021b90bb30
Expand --version output.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-20 00:28:50 +00:00
brian m. carlson
219116d414
Expose supported compression and serialization types.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-20 00:26:05 +00:00
brian m. carlson
fe49c35c14
Improve reporting of database data with --version.
...
The user can now see the raw hex version as well.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-20 00:11:39 +00:00
brian m. carlson
0f11e5118d
Avoid print() with keyword arguments.
...
This syntax isn't compatible with Python 2, so some syntax checking
tools complain.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-20 00:04:25 +00:00
brian m. carlson
3e5ef8d7ec
filemanip: use with statements to open files.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-18 23:10:48 +00:00
brian m. carlson
d66aa22c12
testgit: use with statements to open files.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-18 23:10:22 +00:00
brian m. carlson
74ab2d9fc7
testdatabase: use with statement to open files.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-18 23:07:21 +00:00
brian m. carlson
72e4372532
testfilemanip: use with statement for opening files.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-18 23:04:39 +00:00
brian m. carlson
000ca6c1a1
Explicitly specify encoding.
...
The default encoding is utf-8, which is what we want, but it's confusing
not to specify it.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-16 23:18:20 +00:00
brian m. carlson
d615f6b2e7
Explicitly clean up temporary directories.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-15 20:39:17 +00:00
brian m. carlson
3f1a8c9939
Move git tests all to one file.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-15 20:36:11 +00:00
brian m. carlson
7395798515
Convert some uses of range(len(x)) to enumerate(x).
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-15 15:35:13 +00:00
brian m. carlson
223ed1e3d3
Makefile: add pyflakes3 to test target.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-14 19:04:02 +00:00
brian m. carlson
bdca3c4071
database: remove unused variables.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-14 18:59:33 +00:00
brian m. carlson
05b23107d0
filemanip: remove unused variable recno.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-14 18:57:41 +00:00
brian m. carlson
58e4834b01
Print message about mappings when importing.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-14 18:56:32 +00:00
brian m. carlson
92e590c33c
main: remove unused variables.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-14 18:51:23 +00:00
brian m. carlson
0922819f78
filemanip: remove unused variable.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-14 18:48:55 +00:00
brian m. carlson
b781fce94a
filemanip: don't assign DirectoryChanger to a variable.
...
The variable name is never used, so don't use the as clause of the with
statement.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-14 13:28:10 +00:00
brian m. carlson
f71b71e542
filemanip: explicitly initialize fieldno.
...
We know, due to the way QDDB files are structured and the way the code
is written, that fieldno will always be initialized appropriately.
However, pyflakes3 does not, so help it out by initializing the
variable.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:49:26 +00:00
brian m. carlson
19d057e210
filemanip: make QDDB code produce CorruptFileError.
...
The use of ValueError was inconsistent with the rest of the code, so
make the QDDB code use CorruptFileError as well. This also has the nice
side effect of making the error messages consistent and well-formatted.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:44:25 +00:00
brian m. carlson
c59a8c350f
database: don't hard-code class name.
...
It's much better to use a class method than a static method and calling
the class name directly, so that any subclasses can override the
relevant methods if need be.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:38:40 +00:00
brian m. carlson
e6179fd43f
database: properly qualify function name.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:33:50 +00:00
brian m. carlson
1661d6b330
main: add missing import of sys.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:31:28 +00:00
brian m. carlson
5e46afc20f
Remove unused imports.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:30:25 +00:00
brian m. carlson
14a7e6e8d9
Makefile: add pep8 checking to the test target.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:29:46 +00:00
brian m. carlson
85fdd1862f
testfilemanip: bring up to PEP 8 standards.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:25:16 +00:00
brian m. carlson
ab85ae76b4
testdatabase: bring up to PEP 8 standards.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 16:19:19 +00:00
brian m. carlson
14785e7437
testversion: refactor to eliminate duplicate code.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 15:30:48 +00:00
brian m. carlson
af092061a2
testversion: bring spacing up to PEP 8 standards.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 15:26:04 +00:00
brian m. carlson
3cc24f5806
testgit: bring up to PEP 8 standards.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-13 15:22:28 +00:00
brian m. carlson
35e5516f5b
main: bring up to PEP 8 standards.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-12 21:42:26 +00:00
brian m. carlson
f8d5ea87e3
testcallbacks: add spacing for PEP 8.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-12 18:53:42 +00:00
brian m. carlson
1d8848b6f3
Prevent warning about unclosed popen.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-12 18:26:00 +00:00
brian m. carlson
07f3bb0cc0
Ensure checksums are checked in.
...
Because sets are unordered, it was possible for the transactions to be
ordered such that the hash transactions occurred after the git
transactions. That resulted in the dtb.checksum file not being checked
in properly. It also resulted in a sporadically-failing test.
Ensure that the hash transactions are ordered before the git
transactions. Run the tests 100 times to ensure that the failure is
fixed.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-07-12 18:04:50 +00:00