[Python-modules-commits] [python-keyring] 01/02: Import python-keyring_5.6.orig.tar.gz
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Mon Oct 12 11:11:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch master
in repository python-keyring.
commit 4829eb5723579b26f723d483a6a132d489f2f35f
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date: Mon Oct 12 14:10:20 2015 +0300
Import python-keyring_5.6.orig.tar.gz
---
.hgtags | 3 +++
.travis.yml | 1 -
CHANGES.rst | 21 +++++++++++++++++++++
PKG-INFO | 23 ++++++++++++++++++++++-
keyring.egg-info/PKG-INFO | 23 ++++++++++++++++++++++-
keyring.egg-info/SOURCES.txt | 1 +
keyring/__main__.py | 3 +++
keyring/backends/Gnome.py | 8 ++++----
keyring/backends/pyfs.py | 32 ++++++++++++++++++++++++++------
keyring/tests/backends/test_OS_X.py | 5 -----
keyring/tests/backends/test_pyfs.py | 9 ++-------
keyring/tests/test_core.py | 2 --
setup.cfg | 4 ++--
13 files changed, 106 insertions(+), 29 deletions(-)
diff --git a/.hgtags b/.hgtags
index 1d55f32..8e7cbfc 100644
--- a/.hgtags
+++ b/.hgtags
@@ -78,3 +78,6 @@ b2e88501a6a9bc7f1c7c230a6431ac0860ff4e50 5.1
4059d5c6c76cb43d9c79dd2f5b849a57ac33bcd5 5.2.1
ec350f6cd8328edc404e6cbfd489b657cf7a2dea 5.3
6d6aa6b6b030f1ea900ab59e7496e8eb105e9af3 5.4
+25fc5b1f44a2a5acf5f314f47b4df1486dae767a 5.5
+41a4a8009d2336bfebe221e735a642d0740651e6 5.5.1
+155b7078a68c14f4a8158e1154fd5c050acbcf2a 5.6
diff --git a/.travis.yml b/.travis.yml
index d64037d..49eae14 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,6 @@
os:
- linux
- - osx
language: python
diff --git a/CHANGES.rst b/CHANGES.rst
index 1ee55f8..2e573f7 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -3,6 +3,27 @@ CHANGES
=======
---
+5.6
+---
+
+* Allow keyring to be invoked from command-line with
+ ``python -m keyring``.
+
+-----
+5.5.1
+-----
+
+* Issue #156: Fixed test failures in ``pyfs`` keyring related to
+ 0.5 release.
+
+---
+5.5
+---
+
+* Pull Request #176: Use recommended mechanism for checking
+ GnomeKeyring version.
+
+---
5.4
---
diff --git a/PKG-INFO b/PKG-INFO
index 0486957..d638a9e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: keyring
-Version: 5.4
+Version: 5.6
Summary: Store and access your passwords safely.
Home-page: http://bitbucket.org/kang/python-keyring-lib
Author: Jason R. Coombs
@@ -285,6 +285,27 @@ Description: =======================================
=======
---
+ 5.6
+ ---
+
+ * Allow keyring to be invoked from command-line with
+ ``python -m keyring``.
+
+ -----
+ 5.5.1
+ -----
+
+ * Issue #156: Fixed test failures in ``pyfs`` keyring related to
+ 0.5 release.
+
+ ---
+ 5.5
+ ---
+
+ * Pull Request #176: Use recommended mechanism for checking
+ GnomeKeyring version.
+
+ ---
5.4
---
diff --git a/keyring.egg-info/PKG-INFO b/keyring.egg-info/PKG-INFO
index 0486957..d638a9e 100644
--- a/keyring.egg-info/PKG-INFO
+++ b/keyring.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: keyring
-Version: 5.4
+Version: 5.6
Summary: Store and access your passwords safely.
Home-page: http://bitbucket.org/kang/python-keyring-lib
Author: Jason R. Coombs
@@ -285,6 +285,27 @@ Description: =======================================
=======
---
+ 5.6
+ ---
+
+ * Allow keyring to be invoked from command-line with
+ ``python -m keyring``.
+
+ -----
+ 5.5.1
+ -----
+
+ * Issue #156: Fixed test failures in ``pyfs`` keyring related to
+ 0.5 release.
+
+ ---
+ 5.5
+ ---
+
+ * Pull Request #176: Use recommended mechanism for checking
+ GnomeKeyring version.
+
+ ---
5.4
---
diff --git a/keyring.egg-info/SOURCES.txt b/keyring.egg-info/SOURCES.txt
index 133776f..b265771 100644
--- a/keyring.egg-info/SOURCES.txt
+++ b/keyring.egg-info/SOURCES.txt
@@ -10,6 +10,7 @@ pytest.ini
setup.cfg
setup.py
keyring/__init__.py
+keyring/__main__.py
keyring/backend.py
keyring/cli.py
keyring/core.py
diff --git a/keyring/__main__.py b/keyring/__main__.py
new file mode 100644
index 0000000..4317360
--- /dev/null
+++ b/keyring/__main__.py
@@ -0,0 +1,3 @@
+if __name__ == '__main__':
+ from keyring import cli
+ cli.main()
diff --git a/keyring/backends/Gnome.py b/keyring/backends/Gnome.py
index 7cce245..5264e99 100644
--- a/keyring/backends/Gnome.py
+++ b/keyring/backends/Gnome.py
@@ -1,10 +1,10 @@
import os
try:
- from gi import Repository
- if Repository.get_default().enumerate_versions('GnomeKeyring'):
- from gi.repository import GnomeKeyring
-except ImportError:
+ import gi
+ gi.require_version('GnomeKeyring', '1.0')
+ from gi.repository import GnomeKeyring
+except (ImportError, ValueError):
pass
from ..backend import KeyringBackend
diff --git a/keyring/backends/pyfs.py b/keyring/backends/pyfs.py
index 142cd14..6776a72 100644
--- a/keyring/backends/pyfs.py
+++ b/keyring/backends/pyfs.py
@@ -1,5 +1,6 @@
import os
import base64
+import sys
from ..py27compat import configparser
@@ -46,9 +47,8 @@ class BasicKeyring(KeyringBackend):
cache_timeout=None):
super(BasicKeyring, self).__init__()
self._crypter = crypter
- self._filename = (filename or
- os.path.join(platform_.data_root(),
- self.__class__._filename))
+ def_fn = os.path.join(platform_.data_root(), self.__class__._filename)
+ self._filename = filename or def_fn
self._can_create = can_create
self._cache_timeout = cache_timeout
@@ -80,7 +80,7 @@ class BasicKeyring(KeyringBackend):
return password_encrypted or b''
return self._crypter.decrypt(password_encrypted)
- def _open(self, mode='rb'):
+ def _open(self, mode='r'):
"""Open the password file in the specified mode
"""
open_file = None
@@ -198,7 +198,7 @@ class BasicKeyring(KeyringBackend):
if not self.config.has_section(service):
self.config.add_section(service)
self.config.set(service, username, password_base64)
- config_file = self._open('w')
+ config_file = UnicodeWriterAdapter(self._open('w'))
self.config.write(config_file)
config_file.close()
@@ -210,7 +210,7 @@ class BasicKeyring(KeyringBackend):
self.config.remove_option(service, username)
except configparser.NoSectionError:
raise errors.PasswordDeleteError('Password not found')
- config_file = self._open('w')
+ config_file = UnicodeWriterAdapter(self._open('w'))
self.config.write(config_file)
config_file.close()
@@ -221,6 +221,26 @@ class BasicKeyring(KeyringBackend):
raise RuntimeError("pyfs required")
return 2
+class UnicodeWriterAdapter(object):
+ """
+ Wrap an object with a .write method to accept 'str' on Python 2
+ and make it a Unicode string.
+ """
+ def __init__(self, orig):
+ self._orig = orig
+
+ def __getattr__(self, *args, **kwargs):
+ return getattr(self._orig, *args, **kwargs)
+
+ def write(self, value):
+ if isinstance(value, str):
+ value = value.decode('ascii')
+ return self._orig.write(value)
+
+if sys.version_info > (3,):
+ UnicodeWriterAdapter = lambda x: x
+
+
class PlaintextKeyring(BasicKeyring):
"""Unencrypted Pyfilesystem Keyring
"""
diff --git a/keyring/tests/backends/test_OS_X.py b/keyring/tests/backends/test_OS_X.py
index 28eccc7..e054b74 100644
--- a/keyring/tests/backends/test_OS_X.py
+++ b/keyring/tests/backends/test_OS_X.py
@@ -14,11 +14,6 @@ class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
- @unittest.expectedFailure
- def test_delete_present(self):
- """Not implemented"""
- super(OSXKeychainTestCase, self).test_delete_present()
-
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
diff --git a/keyring/tests/backends/test_pyfs.py b/keyring/tests/backends/test_pyfs.py
index 90a7227..c01aac4 100644
--- a/keyring/tests/backends/test_pyfs.py
+++ b/keyring/tests/backends/test_pyfs.py
@@ -1,11 +1,11 @@
+from __future__ import unicode_literals
+
import os
import tempfile
import textwrap
from ..py30compat import unittest
-import pytest
-
import keyring.backend
from keyring.backends import pyfs
from ..test_backend import BackendBasicTests, random_string
@@ -37,9 +37,6 @@ class PyfilesystemKeyringTests(BackendBasicTests):
self.assertEqual(password, self.keyring.decrypt(encrypted))
-issue156 = pytest.mark.xfail(reason="pyfs 0.5 breaks everything. Ref #156")
-
- at issue156
@unittest.skipUnless(pyfs.BasicKeyring.viable, "Need Pyfilesystem")
class UnencryptedMemoryPyfilesystemKeyringNoSubDirTestCase(
PyfilesystemKeyringTests, unittest.TestCase):
@@ -52,7 +49,6 @@ class UnencryptedMemoryPyfilesystemKeyringNoSubDirTestCase(
filename=self.keyring_filename)
- at issue156
@unittest.skipUnless(pyfs.BasicKeyring.viable, "Need Pyfilesystem")
class UnencryptedMemoryPyfilesystemKeyringSubDirTestCase(
PyfilesystemKeyringTests, unittest.TestCase):
@@ -65,7 +61,6 @@ class UnencryptedMemoryPyfilesystemKeyringSubDirTestCase(
filename=self.keyring_filename)
- at issue156
@unittest.skipUnless(pyfs.BasicKeyring.viable, "Need Pyfilesystem")
class UnencryptedLocalPyfilesystemKeyringNoSubDirTestCase(
PyfilesystemKeyringTests, unittest.TestCase):
diff --git a/keyring/tests/test_core.py b/keyring/tests/test_core.py
index 3328ce0..242a3b9 100644
--- a/keyring/tests/test_core.py
+++ b/keyring/tests/test_core.py
@@ -7,8 +7,6 @@ Created by Kang Zhang on 2009-08-09
from __future__ import with_statement
import os
-import tempfile
-import shutil
import mock
import pytest
diff --git a/setup.cfg b/setup.cfg
index 94dbf93..80eb663 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -3,7 +3,7 @@ release = sdist upload
test = pytest
[egg_info]
-tag_build =
-tag_svn_revision = 0
tag_date = 0
+tag_svn_revision = 0
+tag_build =
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-keyring.git
More information about the Python-modules-commits
mailing list