Commit Graph

93 Commits (618567b1d8afb51b4a7331ce7dc56b61f40752f3)

Author SHA1 Message Date
Isis Lovecruft 618567b1d8 Fix a bug where sometimes sanitised options values were not being added. 2013-03-18 19:36:30 +00:00
Isis Lovecruft b5f687060c Deduplicate code assertion checks in GPG.__init__(). 2013-03-18 19:36:30 +00:00
Isis Lovecruft 225c05bf58 Add additional allowed options --fingerprint and --with-colons. 2013-03-18 19:36:30 +00:00
Isis Lovecruft 617eb53e57 Apply patch 0001: Make _open_subprocess argument more explicit in _handle_io(). 2013-03-18 19:36:30 +00:00
Isis Lovecruft 695c4875d3 Add quilt patches/ directory, series file, and first external patch. 2013-03-18 19:36:30 +00:00
Isis Lovecruft 311ee4b83b Add unittest for discovery of keyring files. 2013-03-18 19:36:30 +00:00
Isis Lovecruft d8264a619b Update test_gnupg.py unittests to reflect changes in the code. 2013-03-18 19:36:30 +00:00
Isis Lovecruft b776247176 Cleanup the docstring and code in gnupg.GPG.list_keys(). 2013-03-18 19:36:30 +00:00
Isis Lovecruft 608efaf60a Rewrite method gnupg.GPG.make_args() to use lists for _sanitise(). 2013-03-18 19:36:30 +00:00
Isis Lovecruft a7940e3c84 Rewrite checks in gnupg.GPG.__init__(). 2013-03-18 19:36:30 +00:00
Isis Lovecruft 852a0fae97 Rewrite function _sanitise(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft 7ac7af9bcb Update list of allowed gpg options. 2013-03-18 19:36:29 +00:00
Isis Lovecruft b35309e73f Update docstrings in several functions.
* Including updates to:
   _underscore()
   _hyphenate()
   _is_allowed()
2013-03-18 19:36:29 +00:00
Isis Lovecruft 058c6f6ca8 Change _is_file to return booleans and never raise anything. 2013-03-18 19:36:29 +00:00
Isis Lovecruft babff61ec2 Shorten assertion string in gnupg.GPG.__init__(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft 0c5e8f9110 Update test_gnupy.py to use the same standard key generation params.
* Test method now matches the batch key generation parameters in gnupg.py.
 * Fix trailing whitespace in test_gnupg.py.
2013-03-18 19:36:29 +00:00
Isis Lovecruft 2720b68b8c Update test_gnupg.py logger settings.
* The logfile is now appended to, rather than rewritten, so that we can
   still see past test results.
2013-03-18 19:36:29 +00:00
Isis Lovecruft 4d2ce56ab3 Change Makefile 'make test' to only use basic tests.
* This should reduce the load on TravisCI workers.
2013-03-18 19:36:29 +00:00
Isis Lovecruft 708f301bd5 Add TravisCI config file for continuous integration testing.
* The travis-lint tool reports that the YAML syntax is valid:
   ∃!isisⒶwintermute:~/code/riseup/python-gnupg ∴ travis-lint
   Hooray, /home/isis/code/riseup/python-gnupg/.travis.yml seems to be solid!
2013-03-18 19:36:29 +00:00
Isis Lovecruft 5952d5c09e Add Makefile for common testing tasks. 2013-03-18 19:36:29 +00:00
Isis Lovecruft b0dda3e0e4 Update .gitignore to exclude the keys/ testing directory, and *.log files. 2013-03-18 19:36:29 +00:00
Isis Lovecruft e0f0023c81 Update test_gnupg.py with update parameter names. 2013-03-18 19:36:29 +00:00
Isis Lovecruft ed63f622a1 Change logger messages in gnupg.GPG.sign() to be at the debug level. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 601dbb0dd0 Set parameter args in gnupg.GPG.make_args() to None by default. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 45cb40c8b1 Only process safe_args in gnupg.GPG.__init__() as a dict if it is one. 2013-03-18 19:36:29 +00:00
Isis Lovecruft c0265943e2 Create stricter checks on which gpg binary to call.
* Update documentation for gnupg.GPG.__init__().
2013-03-18 19:36:29 +00:00
Isis Lovecruft 3784f0469b Remove trailing whitespace in function _sanitise(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft c477033506 Change function _is_allowed() to check one option at a time. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 72b74d1960 Fix the _allowed frozenset to work with _hyphenate option string formatting.
* Change assertion checks to reflect the changes to _allowed.
2013-03-18 19:36:29 +00:00
Isis Lovecruft ffe82751b1 Remove vars frozenset from _is_allowed() because it is unnecessary.
* Using _allowed and _possible frozensets to store gpg options and flags instead.
2013-03-18 19:36:29 +00:00
Isis Lovecruft 260814f939 Add class UsageError for future devs who incorrectly add feature sets. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 0af1c84fa6 Switch back to setting gnupg.GPG class as self.gpg.
* The doctests in test_gnupg.py require this, and it would be more work to change,
   so just leave it as it was for now.
 * Update documentation for the _which() function.
2013-03-18 19:36:29 +00:00
Isis Lovecruft 745a581fea Fix problem of attempting to sanitise non-existent options. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 01861c03da Change variable names in GPG.__init__(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft f2fd09490c Sanitise input parameters in function GPG.make_args(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft a58f4b0492 Add function _hyphenate(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft 845ac96de8 Sanitise input 'options' to GPG.__init__(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft a228c91fa7 Fix variable names in assertions in GPG.__init__(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft e3dcbd9aa1 Change function _sanitise() to handle args being a string of multiple arguments. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 0312e32231 Change internal function variable 'vars' in _is_allowed() to use
_underscore(remove_prefix=True) option.
2013-03-18 19:36:29 +00:00
Isis Lovecruft 1144d79a25 Update docsting for function _underscore(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft 7008b10f69 Change function _underscore to handle stripping hyphen prefixes. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 8159d1c80f Fix problem in function _is_file() to except TypeError if given None as input. 2013-03-18 19:36:29 +00:00
Isis Lovecruft eed5b7a8ac Add note to remove the locale module later. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 8419542494 Create the gpghome directory if specified and if it doesn't exist. 2013-03-18 19:36:29 +00:00
Isis Lovecruft 1f51375676 Fix unsanitised input for GPG() parameter 'keyring'.
* Add assertions for checking that parameters 'verbose' and 'use_agent' are
   boolean values.
2013-03-18 19:36:29 +00:00
Isis Lovecruft c6f8a0bb55 Update docstring and assertion statements for GPG.__init__(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft 5dba39e0a3 Fix non-PEP-8 docstring in _underscore(). 2013-03-18 19:36:29 +00:00
Isis Lovecruft 049b2ef91c Catch TypeError in _fix_unsafe(), for cases where the input is None. 2013-03-18 19:36:28 +00:00
Isis Lovecruft ea3e8aa86d Fix unsanitised inputs for GPG() parameters 'gpgbinary' and 'gpghome'.
* Update all docstrings and functions to use 'gpghome' instead of
   'gnupghome'.
2013-03-18 19:36:28 +00:00