brian m. carlson
f9cc2980df
Render all views using the session.
...
This ensures that each view will get access to the appropriate session
object.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-20 22:52:29 +00:00
brian m. carlson
438c563871
Format logging text correctly.
...
If passed a single string, the logging code would insert spaces between
each character. Also, it was not possible to print non-string args.
Ensure that the logging behavior is as similar to what print() would
provide as possible,
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-18 10:54:31 +00:00
brian m. carlson
9727fc5967
Allow specifying debug path through the environment.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-18 10:52:02 +00:00
brian m. carlson
08cb029916
Render views from keyboard shortcuts with Session.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-17 23:26:47 +00:00
brian m. carlson
03395e3235
Add session attribute to view objects.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-17 23:26:16 +00:00
brian m. carlson
4b42f4b69e
Localize most of the main program.
...
Some format strings have been converted from the Python 3-style strings
to the %s strings, as these are more common for potential translators.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-16 02:03:33 +00:00
brian m. carlson
21b8a44ccb
newfol: add basic gettext support.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-15 22:57:45 +00:00
brian m. carlson
69f7cd5be2
Write log files in the user's home directory.
...
The log function stored logs in /tmp, but only if the NEWFOL_DEBUG
environment variable was set and logging statements were added.
However, avoid any possibility of attacks by storing this file in the
user's home directory instead.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-14 20:55:41 +00:00
brian m. carlson
67baea4318
Bump version to v6~pre.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-09 23:00:35 +00:00
brian m. carlson
bf9fde8329
Update version number to version 5.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-09 22:55:13 +00:00
brian m. carlson
0f2d370f86
Simplify code for starting GUI.
2014-09-08 22:25:00 +00:00
brian m. carlson
3ca6275c50
Print supported transaction types for --version.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-09-07 23:43:38 +00:00
brian m. carlson
f6c5e4bbb7
Use dict.get instead of catching exceptions.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-31 20:30:56 +00:00
brian m. carlson
dc4f8e4909
Ensure that locale character set is UTF-8.
...
newfol uses Unicode strings internally, and Python wants to read strings
from the terminal based on the locale. We want the locale to be in
UTF-8 so that all files are also written that way, and also so that the
behavior is consistent between invocations.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-28 23:16:30 +00:00
brian m. carlson
2f0693e87d
Handle editor process failures.
...
If the editor process couldn't be spawned, or it exited nonzero, provide
a message box with a sensible error message to indicate this to the
user.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-25 10:32:50 +00:00
brian m. carlson
2ea7c15601
Clarify confusing comment.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-21 07:53:39 +00:00
brian m. carlson
182759b9b8
Add basic tests for KeyboardShortcuts.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-21 07:42:03 +00:00
brian m. carlson
083faadb12
Allow unsetting a keyboard shortcut.
...
Also make it possible to override an existing shortcut.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-21 06:53:50 +00:00
brian m. carlson
8282016c8e
Move a large set of if statements to a table.
...
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2014-08-13 23:08:49 +00:00
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