Commit Graph

717 Commits (291a51c81506a86001dec48115acced5cd8e1ddc)

Author SHA1 Message Date
Isis Lovecruft 1780c7489a
Change the _generated_keys directory for unittests to be under tests/files/. 2013-06-28 07:27:07 +00:00
Isis Lovecruft ad5c282e9a
Change setup.py to rename the package from 'python-gnupg' to 'gnupg'.
* To import, the same 'import gnupg; gpg=gnupg.GPG' is still used, so this
   changes nothing for applications which have started using this fork.

 * This name appears to be untaken on PyPI, the changes I've made thus far are
   significant, and, I believe, are not entirely backwards compatible with
   upstream, do to various keyword argument and method renamings and such.

 * Upstream is unresponsive, their development is private, and the only way to
   get their code is to download an entire tarball and do a diff, since no
   public CVS is available. Also, looking at their recent releases in the past
   five months, they appear to be fixing bugs I've already fixed, albeit in
   different ways -- and not all of the bugs I've fixed, as the shell escape
   trick still works in upstream's 0.3.4 version -- which leads me to believe
   that they are generally oblivious to this fork, though I have tried to
   contact them several times.

 * At first, I merely bumped the major version number up to indicate the
   incompatibility, but in order to upload to PyPI it would need a different
   name, and so I might as well pick a new one and just go with it, in order
   to avoid the general confusion which might result from keeping the name
   'python-gnupg'.
2013-06-28 07:17:12 +00:00
Isis Lovecruft f11ea6901c
Set gpg.temp_[key|sec]ring to None after setting key.[key|sec]ring.
* Change the returned _parsers.GenKey from gnupg.GPG.gen_key() to store the
   location of the renamed temporary keyrings as attributes. This way, one can
   do something like:

   >>> key = gpg.gen_key(key_input)
   >>> key.keyring
   './generated-keys/328A5C6C1B2F0891125ECBE4624276B5A2296478.pubring.gpg'
2013-06-28 07:09:35 +00:00
Isis Lovecruft 8232f14f2a
Remove commented out code from GPG.gen_key() for import after generation.
* Generated keys in separate keyring would not be available after switching
   back to the normal keyrings (not the ones set up for key generation), so at
   first in the unittests I imported them back into the main keyrings… this,
   however, is would be stupid, as in nullifies half the reasons for using
   separate keyrings in the first place, thus the code was commented out. Now
   that the temporary keyrings are placed in the gnupg.GPG._generated_keys
   directory, it would be nice to eventually either extend GPG.import_keys()
   or add a new helper function for doing:

       $ gpg --no-default-keyring --keyring pubring.gpg \
            --keyring ./generated-keys/<some_fingerprint>.gpg
2013-06-28 06:44:52 +00:00
Isis Lovecruft 9008faa0db
Fix a misnamed variable in gnupg.py; self._key_dir→self._keys_dir 2013-06-28 06:42:42 +00:00
Isis Lovecruft 603379eb37
Change _copy_data() error handling to explain errors not due to broken pipes. 2013-06-28 06:40:09 +00:00
Isis Lovecruft 328e8fcbe0
Add a 'generated-keys' subdirectory to gnupg.GPG.homedir.
* Add GPG._generated_keys as an _utils.InheritableProperty class for storing
   a configurable (even by subclasses of GPGBase, without property overrides)
   subdirectory of whichever directory gnupg.GPG.homedir is set to. This
   subdirectory can be used via the 'separate_keyring=True' option to
   gnupg.GPG.gen_key_input(), which will switch temporarily to new pubring.gpg
   and secring.gpg keyrings during key creation, and upon finishing creation
   of the new key, will ask for the new key's fingerprint, and move the
   keyrings into this GPG._generated_keys directory, renamed in the format
   "<GPG.homedir>/<GPG._generated_keys>/<fingerprint>.[pub|sec]ring.gpg".
2013-06-28 06:29:38 +00:00
Isis Lovecruft ca1acaf7e6
Merge branch 'master' into develop 2013-06-28 02:47:15 +00:00
Isis Lovecruft 906cbd2305
Merge branch 'release/1.0.1' 2013-06-28 02:41:19 +00:00
Isis Lovecruft 45d714a73a Fix upstream issue #62, handle expired keys.
* see https://code.google.com/p/python-gnupg/issues/detail?id=62
2013-06-28 02:38:27 +00:00
Isis Lovecruft 9d5cdb8854
Fix upstream issue #62, handle expired keys.
* see https://code.google.com/p/python-gnupg/issues/detail?id=62
2013-06-28 02:31:37 +00:00
Isis Lovecruft d129ed5b17
Add _parsers.GenKey.secring and _parsers.GenKey.keyring attributes and docs. 2013-06-28 02:30:57 +00:00
Isis Lovecruft f996bf9e31
Update _parsers._sanitise_list() documentation. 2013-06-28 02:30:20 +00:00
Isis Lovecruft 4fcfef1bde
Add _parsers._is_string() function, and change _sanitise() to use it. 2013-06-28 02:29:36 +00:00
Isis Lovecruft 4871e9e038
Move allowed_options into separate groups in their own functions. 2013-06-28 02:28:29 +00:00
Isis Lovecruft 9b9e441dd7
Update function docs for _parsers._is_allowed() function. 2013-06-28 01:44:04 +00:00
Isis Lovecruft 1e03011296
Remove unnecessary comment, there is now a unittest for this condition. 2013-06-28 01:42:05 +00:00
Isis Lovecruft a37557c000
Change the sets of unittests to use the combined sig test. 2013-06-09 11:22:42 +00:00
Isis Lovecruft e1139c7e37
Remove commented out code from _util._copy_data(). 2013-06-09 08:36:22 +00:00
Isis Lovecruft bcaa26685b
Change several imports for installed modules to be absolute in _meta.py. 2013-06-09 08:35:17 +00:00
Isis Lovecruft a707a50c31
Update test directory shortcut in gnupg/_logger.py. 2013-06-09 08:34:15 +00:00
Isis Lovecruft ceb38fdefe
Change directory shortcuts in gnupg._util.py module. 2013-06-09 08:33:30 +00:00
Isis Lovecruft 1afcda8364
Fix a misnamed process thread variable. 2013-06-09 08:25:34 +00:00
Isis Lovecruft 5e47dd7351
Use one of our test_key files for a sig test to save entropy. 2013-06-09 08:24:46 +00:00
Isis Lovecruft c7f648e2a8
Combine sig encoding and algorithm tests into string test to save entropy. 2013-06-09 08:24:21 +00:00
Isis Lovecruft 59de070468 Write the recv key to a file for later tests to use to save entropy. 2013-06-09 08:14:05 +00:00
Isis Lovecruft 61c9a8818d Rename a unittest to test what it actually tests. 2013-06-09 08:12:46 +00:00
Isis Lovecruft ab00cd69e4
Import with from the future. 2013-06-09 08:11:33 +00:00
Isis Lovecruft 9f6a0a08fb
Use separate keyrings during multi recipient test to avoid overwrites. 2013-06-09 08:09:34 +00:00
Isis Lovecruft 762f750db0
Should be TestCase.assertEquals to test equality, not equivalence. 2013-06-09 08:07:00 +00:00
Isis Lovecruft 900c41619b
If using a virtualenv, we don't want the env pip and distribute to be upgraded.
* The proper way to do this is to upgrade globally with the get_pip.py script
   and the distribute_setup.py script, and then create the virtualenv with:
       $ . $(which virtualenvwrapper.sh)
       $ WORKON_HOME=~/.virtualenvs && export WORKON_HOME
       $ mkvirtualenv -a $PWD -r requirements.txt --unzip-setuptools \
           --distribute --no-site-packages gnupg
2013-06-09 05:44:43 +00:00
Isis Lovecruft b0001ef94c Make sure setuptools/distribute is present in new dev virtualenvs. 2013-06-09 05:41:25 +00:00
Isis Lovecruft 9f47765a3f Fix print statements in scripts/make-dev-virtualenv.sh script. 2013-06-09 05:40:55 +00:00
Isis Lovecruft 744d5c64d3
Explicitly specify package dirs and names in setup.py. 2013-06-09 04:27:52 +00:00
Isis Lovecruft e7f1899832
Fix the hash bang python in scripts/distribute_setup.py. 2013-06-08 11:19:08 +00:00
Isis Lovecruft 295d98fbdc
GPG.encrypt_file()→GPGBase.encrypt() and fix doctests and documentation. 2013-06-04 01:42:07 +00:00
Isis Lovecruft d75800a7e0
Add tests package __init__.py. 2013-06-03 21:35:23 +00:00
Isis Lovecruft 785b2760bb
Move GPG._sign_file() to GPGBase since it's never called directly. 2013-06-03 21:34:39 +00:00
Isis Lovecruft cd319e1a93
Change license string for PyPI to be the license name, not the copyright. 2013-06-03 21:28:28 +00:00
Isis Lovecruft 6e877d2871
Fix whitespace to be a TAB instead on spaces in Makefile. *le sigh* 2013-06-03 21:27:44 +00:00
Isis Lovecruft 042d52a75f
Move source files to directory named for top-level package. 2013-06-03 21:16:19 +00:00
Isis Lovecruft dfe51598cc
Add script for creating a virtualenv for testing and development. 2013-06-03 12:07:51 +00:00
Isis Lovecruft e9498e91a9
Fix assertions and add extra assertions to multi-recipient encryption test. 2013-06-03 12:04:32 +00:00
Isis Lovecruft 1cfd8b636d
Add run mechanism for unittests to main module. 2013-06-03 12:02:28 +00:00
Isis Lovecruft 2825efcda5
Add a unittest for GPG.recv-keys(). 2013-06-03 11:59:37 +00:00
Isis Lovecruft 3233cba6bb
Add a test for semicolon escapes in inputs. 2013-06-03 11:58:02 +00:00
Isis Lovecruft d81fee0912
Remove the log.warn line that printed dividers between unittest runs. 2013-06-03 11:56:47 +00:00
Isis Lovecruft aa1247f431
Fix __package__ attr and imports according to PEP366 for submodules. 2013-06-03 11:55:45 +00:00
Isis Lovecruft 4584719c5b
Deduplicate code in GPGWrapper. 2013-06-03 11:49:53 +00:00
Isis Lovecruft e573136666
Rewrite doctest for GPG.encrypt. 2013-06-03 11:39:56 +00:00