← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~ed.so/duplicity/gpginterface into lp:duplicity

 

edso has proposed merging lp:~ed.so/duplicity/gpginterface into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~ed.so/duplicity/gpginterface/+merge/129723

refactor GnuPGInterface to gpginterface.py
reasoning can be found in README
-- 
https://code.launchpad.net/~ed.so/duplicity/gpginterface/+merge/129723
Your team duplicity-team is requested to review the proposed merge of lp:~ed.so/duplicity/gpginterface into lp:duplicity.
=== modified file 'CHANGELOG'
--- CHANGELOG	2012-10-07 12:35:43 +0000
+++ CHANGELOG	2012-10-15 17:20:26 +0000
@@ -1,3 +1,8 @@
+[not to be removed until the end of 2013]
+Dear package maintainer! If you are packaging duplicity for some distribution
+and used to remove GnuPGInterface.py please note this: 
+We really need our _own_ patched GnuPGInterface. See README for details.
+
 New in v0.6.20 (2012/??/??)
 ---------------------------
 Enhancements:

=== modified file 'README'
--- README	2012-05-18 11:15:02 +0000
+++ README	2012-10-15 17:20:26 +0000
@@ -49,18 +49,24 @@
 task and freeing it's resources in a timely manner.  This does not
 affect the operation of duplicity, merely frees resources on time.
 
-Why the note?  Some distro's remove duplicity's GnuPGInterface in
-error, thinking that this change is not important.  So, if you have
-the problem where lots of GPG tasks are hanging around, check to see
-if this has been done in your distro, then, report the bug to the
-distro's maintainer and/or package manager.
+Why the note?  Some package maintainers remove duplicity's GnuPGInterface
+in error, obviously unkowing of this issue and patch duplicity to use 
+the original unmaintained unpatched GnuPGInterface interface again.
+So, if you have the problem that lots of GPG tasks are hanging around, 
+check and see if this has been done in your distro, then, report the bug 
+to the distro or package maintainer.
+
+As of october 2012 we pull the handbrake and refactor and rename our 
+gpginterface in the hope that package maintainers will stumble over it and
+stop this problematic effort for good.
 
 
 HELP:
 
 For more information see the duplicity home page at:
 
-    http://www.nongnu.org/duplicity
+  http://www.nongnu.org/duplicity
 
 or post to the mailing list at
-http://mail.nongnu.org/mailman/listinfo/duplicity-talk/.
+  
+  http://mail.nongnu.org/mailman/listinfo/duplicity-talk/.

=== modified file 'duplicity/gpg.py'
--- duplicity/gpg.py	2012-10-07 12:21:52 +0000
+++ duplicity/gpg.py	2012-10-15 17:20:26 +0000
@@ -21,13 +21,15 @@
 
 """
 duplicity's gpg interface, builds upon Frank Tobin's GnuPGInterface
+which is now patched with some code for iterative threaded execution
+see duplicity's README for details
 """
 
 import os, types, tempfile, re, gzip
 
 from duplicity import misc
 from duplicity import globals
-from duplicity import GnuPGInterface
+from duplicity import gpginterface
 from duplicity import tempdir
 
 try:
@@ -100,7 +102,7 @@
         self.byte_count = 0
 
         # Start GPG process - copied from GnuPGInterface docstring.
-        gnupg = GnuPGInterface.GnuPG()
+        gnupg = gpginterface.GnuPG()
         gnupg.options.meta_interactive = 0
         gnupg.options.extra_args.append('--no-secmem-warning')
         if globals.use_agent:

=== renamed file 'duplicity/GnuPGInterface.py' => 'duplicity/gpginterface.py'
--- duplicity/GnuPGInterface.py	2011-06-28 22:28:32 +0000
+++ duplicity/gpginterface.py	2012-10-15 17:20:26 +0000
@@ -1,6 +1,10 @@
 """Interface to GNU Privacy Guard (GnuPG)
 
-GnuPGInterface is a Python module to interface with GnuPG.
+!!! This was renamed to gpginterface.py.
+    Please refer to duplicity's README for the reason. !!!
+
+gpginterface is a Python module to interface with GnuPG which based on 
+GnuPGInterface by Frank J. Tobin.
 It concentrates on interacting with GnuPG via filehandles,
 providing access to control GnuPG via versatile and extensible means.
 
@@ -15,12 +19,12 @@
 
 Example code:
 
->>> import GnuPGInterface
+>>> import gpginterface
 >>>
 >>> plaintext  = "Three blind mice"
 >>> passphrase = "This is the passphrase"
 >>>
->>> gnupg = GnuPGInterface.GnuPG()
+>>> gnupg = gpginterface.GnuPG()
 >>> gnupg.options.armor = 1
 >>> gnupg.options.meta_interactive = 0
 >>> gnupg.options.extra_args.append('--no-secmem-warning')
@@ -122,16 +126,16 @@
 gnupg.options.recipients = [ 'bob@xxxxxxxxxx' ]
 gnupg.run( ['--sign', '--encrypt'], create_fhs=..., attach_fhs=...)
 
-Here is an example of subclassing GnuPGInterface.GnuPG,
+Here is an example of subclassing gpginterface.GnuPG,
 so that it has an encrypt_string() method that returns
 ciphertext.
 
->>> import GnuPGInterface
+>>> import gpginterface
 >>>
->>> class MyGnuPG(GnuPGInterface.GnuPG):
+>>> class MyGnuPG(gpginterface.GnuPG):
 ...
 ...     def __init__(self):
-...         GnuPGInterface.GnuPG.__init__(self)
+...         gpginterface.GnuPG.__init__(self)
 ...         self.setup_my_options()
 ...
 ...     def setup_my_options(self):
@@ -162,8 +166,8 @@
            "What GnuPG gave back is not a string!"
 
 Here is an example of generating a key:
->>> import GnuPGInterface
->>> gnupg = GnuPGInterface.GnuPG()
+>>> import gpginterface
+>>> gnupg = gpginterface.GnuPG()
 >>> gnupg.options.meta_interactive = 0
 >>>
 >>> # We will be creative and use the logger filehandle to capture
@@ -271,7 +275,7 @@
       then GnuPG instnace will take care of sending the passphrase to
       GnuPG, the executable instead of having the user sent it in manually.
 
-    * options -- Object of type GnuPGInterface.Options.
+    * options -- Object of type gpginterface.Options.
       Attribute-setting in options determines
       the command-line options used when calling GnuPG.
     """
@@ -286,7 +290,7 @@
         complete with prefixing dashes.
         For example, gnupg_commands could be
         '["--sign", "--encrypt"]'
-        Returns a GnuPGInterface.Process object.
+        Returns a gpginterface.Process object.
 
         args is an optional list of GnuPG command arguments (not options),
         such as keyID's to export, filenames to process, etc.
@@ -524,9 +528,9 @@
     extra_args -- Extra option arguments may be passed in
     via the attribute extra_args, a list.
 
-    >>> import GnuPGInterface
+    >>> import gpginterface
     >>>
-    >>> gnupg = GnuPGInterface.GnuPG()
+    >>> gnupg = gpginterface.GnuPG()
     >>> gnupg.options.armor = 1
     >>> gnupg.options.recipients = ['Alice', 'Bob']
     >>> gnupg.options.extra_args = ['--no-secmem-warning']
@@ -673,7 +677,7 @@
 
 
 def _run_doctests():
-    import doctest, GnuPGInterface #@UnresolvedImport
+    import doctest, gpginterface #@UnresolvedImport
     return doctest.testmod(GnuPGInterface)
 
 # deprecated

=== modified file 'testing/tests/GnuPGInterfacetest.py'
--- testing/tests/GnuPGInterfacetest.py	2012-02-28 22:04:22 +0000
+++ testing/tests/GnuPGInterfacetest.py	2012-10-15 17:20:26 +0000
@@ -27,7 +27,7 @@
 import tempfile
 import sys
 
-from duplicity import GnuPGInterface
+from duplicity import gpginterface
 
 __author__   = "Frank J. Tobin, ftobin@xxxxxxxxxxxxxxx"
 __version__  = "0.2.2"
@@ -37,7 +37,7 @@
     """an initializer superclass"""
 
     def __init__(self, methodName=None):
-        self.gnupg = GnuPGInterface.GnuPG()
+        self.gnupg = gpginterface.GnuPG()
         unittest.TestCase.__init__(self, methodName)
 
 
@@ -152,7 +152,7 @@
         self.reset_options()
 
     def reset_options(self):
-        self.gnupg.options = GnuPGInterface.Options()
+        self.gnupg.options = gpginterface.Options()
 
     def option_to_arg(self, option):
         return '--' + option.replace('_', '-')
@@ -229,7 +229,7 @@
     """Tests for Pipes class"""
 
     def test_constructor(self):
-        self.pipe = GnuPGInterface.Pipe(1, 2, 0)
+        self.pipe = gpginterface.Pipe(1, 2, 0)
         assert self.pipe.parent == 1
         assert self.pipe.child  == 2
         assert not self.pipe.direct


Follow ups