Commit Graph

89 Commits (ca28c1a4d202ce67168f29f35c3fd73d4af3289f)

Author SHA1 Message Date
Isis Lovecruft 406f212a3f
Remove old keyring property code. 2013-05-21 13:50:31 +00:00
Isis Lovecruft 6cbed40f84
Add doctest and docstring for GPG.list_sigs(). 2013-05-21 13:49:06 +00:00
Isis Lovecruft f64b0eef03
Add docstring for GPG.list_sigs(). 2013-05-21 13:47:50 +00:00
Isis Lovecruft 6400efa0e6
Add GPG.list_packets() function from drebs' wrapper code.
* TODO This needs unittests.
2013-05-21 13:47:07 +00:00
Isis Lovecruft 1b95e254d7
Update docstring for GPG.list_keys(). 2013-05-21 13:03:58 +00:00
Isis Lovecruft 60b97938f4
Update a log statement. 2013-05-21 13:03:31 +00:00
Isis Lovecruft ece570fdda
Rename all calls _utils._make_binary_stream→_make_binary_stream 2013-05-21 13:02:29 +00:00
Isis Lovecruft 8af74f0981
Update docstring for GPG._sign_file(). 2013-05-21 12:59:57 +00:00
Isis Lovecruft d9b7a85fe6
Change variable names in GPG.sign() to be clearer. 2013-05-21 12:57:24 +00:00
Isis Lovecruft b5a0770d56
Update docstring for GPG.sign(). 2013-05-21 12:46:21 +00:00
Isis Lovecruft 93cfc8a20e
Update several log statements. 2013-05-21 12:45:47 +00:00
Isis Lovecruft 3b769c5202
Update docst
ring for GPG._open_subprocess().
2013-05-21 12:43:00 +00:00
Isis Lovecruft ebf51ecb5d
Add additional integer variables to GPG.verbose to enable getting GnuPG debugging. 2013-05-21 12:41:57 +00:00
Isis Lovecruft b735333d7e
Update docstring for GPG._make_args(). 2013-05-21 12:40:45 +00:00
Isis Lovecruft 3b7734c32f
Add doctest for GPG class. 2013-05-21 12:39:01 +00:00
Isis Lovecruft 5891730de4
Add batch query limiting attribute.
* This prevents commands with excessive output from generating an unexpected
   IOError.
2013-05-21 12:35:30 +00:00
Isis Lovecruft b2b0d07c5e
Add logic for finding which PATHs to remove, store, and then re-add. 2013-05-21 12:29:31 +00:00
Isis Lovecruft a8023e7eab
Add docstring for update_path() method. 2013-05-21 12:28:14 +00:00
Isis Lovecruft f67270609f
Add remove_from_path() function for removing an entry from the system PATH.
* All removed entries should have an @atexit hook to be reinserted into the
   system PATH before the Python interpreter exits.
2013-05-21 12:26:02 +00:00
Isis Lovecruft a34fd1c423
Discover if gpg.binary resides in a directory we've purged from the path. 2013-05-21 12:25:03 +00:00
Isis Lovecruft ddce4fbc3b
Fix a bug due to a typo in the name of an Exception class. 2013-05-21 12:23:01 +00:00
Isis Lovecruft 14c48b2f09
Add docstring for GPGBase._remove_path() method. 2013-05-21 12:22:16 +00:00
Isis Lovecruft fe531bcd91
Add original encoding discovery code into GPGBase, but ensure it's lowercased. 2013-05-21 12:20:58 +00:00
Isis Lovecruft d5753278fc
Actually parse and validate user-set cipher/hash/digest preferences. 2013-05-21 12:17:47 +00:00
Isis Lovecruft bedaa0ca49
Switch to a slightly more useful output as the startup check. 2013-05-21 12:16:33 +00:00
Isis Lovecruft 691d0163d4
Rewrite GPG.__init__() to take advantage of the Meta and Base classes. 2013-05-18 17:14:26 +00:00
Isis Lovecruft a887be1a17
Update docstring for GPG. 2013-05-18 15:30:16 +00:00
Isis Lovecruft 8b154c3df5
Update result map to point to _parsers. 2013-05-18 15:29:19 +00:00
Isis Lovecruft 931713eca3
Add TODO file with ideas for future improvements. 2013-05-18 15:27:20 +00:00
Isis Lovecruft 848e410f19
Add MetaGPG and GPGBase for handling attribute/property setup.
* These classes also play a few other tricks, like the steps taken to disable
   pinentry if GPG.use_agent=False:

       1) detect if gpg-agent is running for the same EUID as python,
          and if it is then
       2) find out if the user wants us to use it, and if they don't then
       3) find if pinentry is installed, and if it is then
       4) modify the system PATH to exclude the directory where pinentry is,
          symlinking out gpg if gpg was in the same directory, and then
       5) register an _exithandler with the interpreter to replace the
          original environment when the interpreter exits.
2013-05-18 15:07:49 +00:00
Isis Lovecruft a4630e1cfb
Add InheritablePropery class for mutable, inheritable descriptors.
* This allows us to define immutable x.getter and x.setter methods in a
   parent class while still inheriting the ability to alter the descriptor in
   a child class without needing to set something like:
       @property
       def x(self):
           super(self.__class__, self)._get_x()
   as a property override for every descriptor.
2013-05-18 14:49:09 +00:00
Isis Lovecruft de8dd5ac1e
Update imports in gnupg.py with parsers->_parsers and util->_util. 2013-05-18 04:48:03 +00:00
Isis Lovecruft 9bd451d7da
Fix encoding strings and remove script directive. 2013-05-17 12:42:29 +00:00
Isis Lovecruft 891ee9e7eb
Significantly improve logging facilities for faster debugging.
* Include _ansistrm.py, which was released under new BSD license separately in
   a github gist as well as in the Python logutils module. Instead of setting
   up a src/includes/ directory, I have included this file in the currently
   flat module directory, because dealing with submodule imports in Python2.x
   is a pain. I'm not sure if this will cause problems for Debian packaging,
   but it could be changed later if so. The full text of the original license
   and copyright has been retained at the head of _ansistrm.py, clearly
   demarcated from python-gnupg's license and copyright info. The author of
   _ansistrm.py is the same as the current upstream maintainer for
   python-gnupg, Vinay Sajip, and I don't see why this person doesn't include
   _ansistrm.py in all of their packages, because it is making skimming the
   test logs for errors much faster.

 * Add _logger.py, which contains a class decorator:

       @wraps(logging.Logger)
       def create_logger(level=logging.NOTSET)
       [...]

   which autoconfigures logging functionality. By default, logging.NullHandler
   is still used, so there are no logs (neither logfiles nor piped to
   stdout). If _logger.create_logger() is called with either a LEVEL attribute
   from the logging module, or the integer equivalent, it will initialise
   logging to stdout only. In the unittest suite, extra log handling
   functionality is added to also write to a datetime-stamped logfile in the
   tests/ directory.

 * Change all "logger.<level>" statements to "log.<level>" and add new ones for
   debugging and user information purposes.

 * Remove the import of the python standard utilities logging module from:
       src/gnupg.py
       src/parsers.py
       src/util.py

   and switch to setting a top-level attribute, util.log, which is the returned
   class from _logger.create_logger(). Everything else now does "from util
   import log".
2013-05-17 02:15:17 +00:00
Isis Lovecruft 3038e3948b
Remove relative imports of every class in parsers.py, they crowd the namespace. 2013-05-17 01:13:02 +00:00
Isis Lovecruft 41d9ab27bd
Don't point users to github, where possible.
* Github has these rather nasty tracking mechanisms through pixel cookies, as
   well as hardware fingerprinting (potentially deanonymising) through HTML5
   canvases.
 * I suck at configuring gitweb + lighttpd. I cannot get pretty URLs for the
   repos, but it's still better than the pixel cookies. If anyone can point me
   at something for fixing this, much obliged. I wasn't sure if I should point
   explicitly to a LEAP server.
2013-05-17 00:54:48 +00:00
Isis Lovecruft e462cf42ed
Call parsers._check_preferences() to set default_preference_list. 2013-05-13 02:39:19 +00:00
Isis Lovecruft c5a7ccb572
Update module level docstring. 2013-05-13 00:46:58 +00:00
Isis Lovecruft c97b51fec5
Add versioneer and restructure the repo into a src/ dir. 2013-05-12 09:32:46 +00:00