Commit Graph

765 Commits (1bdf0290abbcf1cd218d3c0f9a8fefa64e7fb7c0)

Author SHA1 Message Date
Mikael Nordfeldth 1bdf0290ab File and IO handling in Py3 is different than Py2
Instead of checking whether data isinstance of 'file', then we check that
it is file-like _enough_ to be treated as a file (i.e. it hasattr 'read').
2013-07-28 18:35:16 +02:00
Isis Lovecruft 72174ad535
Merge branch 'master' into develop 2013-07-27 21:16:45 +00:00
Isis Lovecruft 52f3dc8ca6
Merge branch 'release/1.2.1' 2013-07-27 21:15:26 +00:00
Isis Lovecruft eb668b3f00
Merge branch 'master' into develop 2013-07-27 20:49:20 +00:00
Isis Lovecruft 436506ec16
Merge branch 'release/1.2.0' 2013-07-27 20:42:59 +00:00
Isis Lovecruft 73bab0d0e0
Add scripts/pep8.py for checking PEP conformity. 2013-07-27 19:44:28 +00:00
Isis Lovecruft 420d2b590d
Remove TODO item for keyring separation in GPG.gen_key_input() and GPG.gen_key(). 2013-07-27 19:42:37 +00:00
Isis Lovecruft b54cb8ee42
Update docs/index.rst to point to online text of new license. 2013-07-27 19:37:07 +00:00
Isis Lovecruft 6b154c294e
Change LICENSE to GPLv3+, after discussion with intrigeri.
* ADD docs/change-license-emails.txt, which includes email exchanges between
   myself and intrigeri, including links to Debian and LEAP mailing lists with
   arguments for and against using AGPL for a library.
 * CHANGE license header for all files.
 * CHANGE LICENSE file and gnupg/copyright.py to use GPLv3+ text.
2013-07-27 19:27:53 +00:00
Isis Lovecruft e2646cb4c4
Merge remote-tracking branch 'mmn/python3_KeysView_object_is_not_indexable' into develop
* FIX Python3 error where a :class:`collections.OrderedDict` instance,
   including it's keys() method, is not iterable.
 * CLOSES PR#7 In Python 3 OrderedDict.keys() are not indexable
2013-07-27 17:33:53 +00:00
Isis Lovecruft bab8e4f54d
Merge remote-tracking branch 'mmn/xrange_replaces_range_in_python3' into develop
* CHANGE an occurence of xrange() iteration over a fixed length list to use
   range(); Python3's range() function is equivalent to Python2's xrange(),
   while the small fixed length of the list in this case doesn't effect speed
   at all.
2013-07-27 08:13:04 +00:00
Isis Lovecruft 8bad2f3c05
Merge remote-tracking branch 'mmn/mktime_takes_localtime_not_gmtime' into develop
* FIX struct_time inputs to time.mktime() to use localtime() not gmtime().
 * CLOSES #9: "mktime takes local time, not UTC"
   https://github.com/isislovecruft/python-gnupg/pull/9
2013-07-26 14:32:43 +00:00
Isis Lovecruft 6858fe5fa3
Merge branch 'mmn/python3_install_issue_with_chmod_and_exception_handling' into develop
* FIX exception raising and handling in _utils.py to use Python3 syntax.
 * FIX os.chmod call in _utils._make_passphrase() to use stat bitmasks.
2013-07-26 13:52:07 +00:00
Mikael Nordfeldth 9ff03b5be7 mktime takes localtime, or we skew the clocks
The following snippet shows that to create a proper timestamp, we should
feed mktime() with localtime() data rather than gmtime(), as it is locale
aware.

>>> from time import mktime, gmtime, localtime
>>> bad    = gmtime(mktime(gmtime()))
>>> good   = gmtime(mktime(localtime()))
>>> judge  = gmtime()
>>> if bad == good: "You're using UTC. Demonstration is impossible."
... elif bad == judge: "I can be wrong"
... elif good == judge: "but this shows I'm right"
...
"but this shows I'm right"

The above code checks whether gmtime() == gmtime(timestamp) from
mktime(). Obviously we don't get the same 'now' if we feed the bad value
to mktime.
2013-07-26 01:02:46 +02:00
Mikael Nordfeldth 59c19c8816 xrange is called 'range' in python3, change is python2 compatible 2013-07-25 00:18:13 +02:00
Mikael Nordfeldth f80f216625 mktime takes local time, not UTC
GPG signature timestamps are considered UTC, this may cause times to be off
by delta > 1000 in def test_signature_string_verification because it
incorrectly gave gmtime() as an argument to mktime().

Python 2 and 3 docs both say that mktime should have a struct_time argument
"which expresses the time in local time, not UTC". So the test is now using
time.localtime() instead of time.gmtime()
2013-07-24 17:28:18 +02:00
Mikael Nordfeldth a3e811a919 Python 3 fixes for chmod and exceptions 2013-07-24 15:04:15 +02:00
Mikael Nordfeldth 9015aab8ea In Python 3 OrderedDict.keys() are not indexable
We could always cast counts.keys() to a list, from the dictionary view they
are but a more efficient way of doing this is to simply pop the items from
our result list as we traverse the returned iterable dictionary view.
2013-07-24 14:58:58 +02:00
Isis Lovecruft 337b3fb1fb
Merge branch 'master' into develop 2013-07-09 09:06:40 +00:00
Isis Lovecruft 43191ab4af
Merge branch 'release/1.1.8' 2013-07-09 09:06:11 +00:00
Isis Lovecruft 73f7315808
Add symbolic link to markdown README file.
* I don't actually remember if this solves the problem where Github looks for
   a .md file and setup.py wants a README file that must actually be a hard
   file. *le sigh*.
2013-07-09 08:43:27 +00:00
Isis Lovecruft 967ae05c10
Merge branch 'testing/drebs/bug/3097-fix-bugs' into develop 2013-07-09 08:37:34 +00:00
drebs 632cb5d833 Add more recognized keys to ListPackets status handling method. 2013-07-09 08:35:42 +00:00
drebs ef022f977f Fix list_packets() call in utilities. 2013-07-09 08:35:42 +00:00
drebs 2832df8be1 Add missing param to utilities methods. 2013-07-09 08:35:42 +00:00
drebs 9db97dd184 Fix sign() and encrypt() docstrings. 2013-07-09 08:35:42 +00:00
drebs 171d3afa67 Fix delete_keys command line options. 2013-07-09 08:35:42 +00:00
Isis Lovecruft 78af852d25
Fix putting keys generated during unittests into tests/generated-keys/. 2013-07-09 08:16:27 +00:00
Isis Lovecruft fca8491ceb
Remove two unused inspect module imports from gnupg.py. 2013-07-06 09:01:21 +00:00
Isis Lovecruft 1ca57e7aa2
Merge branch 'master' into develop 2013-07-03 13:49:33 +00:00
Isis Lovecruft aa776982d3
Merge branch 'release/1.1.7' 2013-07-03 13:48:18 +00:00
Isis Lovecruft e44228bac3
Add link to docs: https://python-gnupg.readthedocs.org/en/latest/ 2013-07-03 10:29:58 +00:00
Isis Lovecruft 6ee18679e5
Merge branch 'fix/docs-1.1.6' into develop 2013-07-03 10:26:22 +00:00
Isis Lovecruft 94e591f6dc
Update docstrings for v1.1.6 Sphinx generation in gnupg.py and _parsers.py. 2013-07-03 10:24:11 +00:00
Isis Lovecruft 1da138e75b
Update Sphinx templating and stylesheets. 2013-07-03 10:22:05 +00:00
Isis Lovecruft f8ab757b46
Add generated Emacs orgmode → html output for docs/NOTES…audit.org file. 2013-07-03 10:20:41 +00:00
Isis Lovecruft 1f717e167d
Add Emacs orgmode → html output for doc/DETAILS file. 2013-07-03 10:19:53 +00:00
Isis Lovecruft 5b30ebd5a9
Reorganise Sphinx documentation directives in the doc/*.rst files. 2013-07-03 10:18:57 +00:00
Isis Lovecruft c77a40b820
Change around a bunch of Sphinx settings. 2013-07-03 10:16:27 +00:00
Isis Lovecruft f7a5cb3953
Fix the source directory for Sphinx to load packages from. 2013-07-03 10:13:21 +00:00
Isis Lovecruft cd3f540a3a
Merge branch 'master' into develop 2013-07-02 12:43:09 +00:00
Isis Lovecruft d6889bd3ee
Merge branch 'fix/remove-encto-orgmode' 2013-07-02 12:38:12 +00:00
Isis Lovecruft b9cef09c93
Remove epa-file-encrypt line from orgmode line. 2013-07-02 12:37:10 +00:00
Isis Lovecruft 46aac60623
Merge branch 'master' into develop 2013-07-02 11:43:12 +00:00
Isis Lovecruft efc1ba77cc
Merge branch 'release/1.1.6' 2013-07-02 11:43:09 +00:00
Isis Lovecruft 42e6381046
Remove unused code from setup.py script. 2013-07-02 11:40:20 +00:00
Isis Lovecruft ecbdfbaf3a
Giving up. Requirements are now in setup.py in install_requires. 2013-07-02 11:39:29 +00:00
Isis Lovecruft 52688f57db
Merge branch 'master' into develop 2013-07-02 11:26:24 +00:00
Isis Lovecruft 291a51c815
Merge branch 'release/1.1.5' 2013-07-02 11:26:06 +00:00
Isis Lovecruft 22b88ec71e
Remove unused function get_current_dir() from setup.py. 2013-07-02 11:22:03 +00:00