mergeall 2.2, with os.scandir() speed optimization

2015-09-26 Thread Mark Lutz
There's a new version of the mergeall folder tree synchronization tool, which
uses Python 3.5's os.scandir(), if available, to radically speed up its trees
comparison phase.  In testing on Windows 7 and 10, the new call speeds mergeall
comparisons by a factor of 5 to 10, depending on devices.  This is due entirely
to the elimination of system calls that os.scandir() affords.

The savings is especially significant for large archives.  For a 78G target use
case of 50k files in 3k folders, comparison runtime fell from  40 to 7 seconds 
on a fast USB stick (6x); from 112 to 16 seconds on a slower stick (7x); and 
from 600 to 60 seconds on an ancient single-core machine (10x). 

Also note that the scandir() call is standard in the os module in 3.5, but can
also be had for older Python releases, including 2.7 and older 3.X, via a PyPI
package.  mergeall uses either form if present, and falls back on the original 
os.listdir() scheme as a last resort to continue supporting older Pythons 
(though a scandir() is now strongly recommended, for obvious reasons!).

All of which seems proof that language improvement and backward compatibility 
are not necessarily mutually exclusive.  The details:

2.2 changes:
http://learning-python.com/mergeall/docs/Usage-Overview.html#optimizations

Main README: 
http://learning-python.com/mergeall/Readme.html

Usage guide:
http://learning-python.com/mergeall/docs/Usage-Overview.html

GUI screenshot:
http://learning-python.com/mergeall/examples/Screenshots/main-quit-help.png

Download the package:
http://learning-python.com/downloads/mergeall.zip

Cheers,
--M. Lutz (http://www.rmi.net/~lutz | http://learning-python.com)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.21

2015-09-26 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.21

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

$ md5sum python-ldap-2.4.21.tar.gz
1ce26617e066f412fd5ba95bfba4ba5a
$ sha1sum python-ldap-2.4.21.tar.gz
35ed5913d804f14e952bec414c569e140feb889d
$ sha256sum python-ldap-2.4.21.tar.gz
2a3ce606465d2d5fbd0a620516b6648ffd85c343d9305d49a2a1f7d338b8bbd4

Ciao, Michael.


Released 2.4.21 2015-09-25

Changes since 2.4.20:

Lib/
* LDAPObject.read_s() now returns None instead of raising
  ldap.NO_SUCH_OBJECT in case the search operation returned emtpy result.
* ldap.resiter.ResultProcessor.allresults() now takes new key-word
  argument add_ctrls which is internally passed to LDAPObject.result4()
  and lets the method also return response control along with the search
  results.
* Added ldap.controls.deref implementing support for dereference control

Tests/
* Unit tests for module ldif (thanks to Petr Viktorin)

--
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: A new version (0.3.8) of python-gnupg has been released.

2015-09-26 Thread Vinay Sajip
A new version of the Python module which wraps GnuPG has been

released. 

What Changed? 
= 
This is an enhancement and bug-fix release, and all users are encouraged to 
upgrade.
See the project website [1] for more information.

Brief summary: 


* Fixed #22: handled PROGRESS messages during verification and signing. 

* Fixed #26: handled PINENTRY_LAUNCHED messages during verification, 
  decryption and key generation. 

* Fixed #28: Allowed a default Name-Email to be computed even when neither of 
  LOGNAME and USERNAME are in the environment. 

* Fixed #29: Included test files missing from the tarball in previous versions. 

* Fixed #39: On Python 3.x, passing a text instead of a binary stream caused
  file decryption to hang due to a UnicodeDecodeError. This has now been
  correctly handled: The decryption fails with a "no data" status. 

* Fixed #41: Handled Unicode filenames correctly by encoding them on 2.x using
  the file system encoding.

* Fixed #43: handled PINENTRY_LAUNCHED messages during key export. Thanks to
  Ian Denhardt for looking into this. 

* Hide the console window which appears on Windows when gpg is spawned.
  Thanks to Kévin Bernard-Allies for the patch. 

* Subkey fingerprints are now captured. 

* The returned value from the list_keys method now has a new attribute,
  key_map, which is a dictionary mapping key and subkey fingerprints to
  the corresponding key's dictionary. With this change, you don't need to
  iterate over the (potentially large) returned list to search for a key with
  a given fingerprint - the key_map dict will take you straight to the key
  info, whether the fingerprint you have is for a key or a subkey. Thanks to
  Nick Daly for the initial suggestion. 

This release [2] has been signed with my code signing key: 

Vinay Sajip (CODE SIGNING KEY)  
Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 


However, due to some error the signature for the source distribution (.tar.gz)
didn't get uploaded. To rectify this, I have pasted it into the PyPI page for
the release [2].
What Does It Do? 
 
The gnupg module allows Python programs to make use of the 
functionality provided by the Gnu Privacy Guard (abbreviated GPG or 
GnuPG). Using this module, Python programs can encrypt and decrypt 
data, digitally sign documents and verify digital signatures, manage 
(generate, list and delete) encryption keys, using proven Public Key 
Infrastructure (PKI) encryption technology based on OpenPGP. 

This module is expected to be used with Python versions >= 2.4, as it 
makes use of the subprocess module which appeared in that version of 
Python. This module is a newer version derived from earlier work by 
Andrew Kuchling, Richard Jones and Steve Traugott. 

A test suite using unittest is included with the source distribution. 

Simple usage: 

>>> import gnupg 
>>> gpg = gnupg.GPG(gnupghome='/path/to/keyring/directory') 
>>> gpg.list_keys() 

[{ 
... 
'fingerprint': 'F819EE7705497D73E3CCEE65197D5DAC68F1AAB2', 
'keyid': '197D5DAC68F1AAB2', 
'length': '1024', 
'type': 'pub', 
'uids': ['', 'Gary Gross (A test user) ']}, 
{ 
... 
'fingerprint': '37F24DD4B918CC264D4F31D60C5FEFA7A921FC4A', 
'keyid': '0C5FEFA7A921FC4A', 
'length': '1024', 
... 
'uids': ['', 'Danny Davis (A test user) ']}] 
>>> encrypted = gpg.encrypt("Hello, world!", ['0C5FEFA7A921FC4A']) 
>>> str(encrypted) 

'-BEGIN PGP MESSAGE-\nVersion: GnuPG v1.4.9 (GNU/Linux)\n 
\nhQIOA/6NHMDTXUwcEAf 
. 
-END PGP MESSAGE-\n' 
>>> decrypted = gpg.decrypt(str(encrypted), passphrase='secret') 
>>> str(decrypted) 

'Hello, world!' 
>>> signed = gpg.sign("Goodbye, world!", passphrase='secret') 
>>> verified = gpg.verify(str(signed)) 
>>> print "Verified" if verified else "Not verified" 

'Verified' 

As always, your feedback is most welcome (especially bug reports [3], 
patches and suggestions for improvement, or any other points via the 
mailing list/discussion group [4]). 

Enjoy! 

Cheers 

Vinay Sajip 
Red Dove Consultants Ltd. 

[1] https://bitbucket.org/vinay.sajip/python-gnupg 
[2] https://pypi.python.org/pypi/python-gnupg/0.3.8 
[3] https://bitbucket.org/vinay.sajip/python-gnupg/issues 
[4] https://groups.google.com/forum/#!forum/python-gnupg
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/