[Python-modules-commits] r12357 - in packages/python-keyring/trunk/debian (15 files)

chaica-guest at users.alioth.debian.org chaica-guest at users.alioth.debian.org
Tue Mar 23 22:19:42 UTC 2010


    Date: Tuesday, March 23, 2010 @ 22:19:41
  Author: chaica-guest
Revision: 12357

  * Added the debian/clvault directory to provide CLVault
  * Added debian/clvault/get_password.py
  * Added debian/clvault/set_password.py
  * Added debian/clvault/passwordlist.py
  * Added debian/clvault/clvault directory
  * Added debian/clvault/clvault/passwordlist.py
  * debian/control
    - Changed Maintainer to DPMT.
    - Changed Uploaders to Carl Chenet.
    - Bump Standards-Version to 8.3.4. No changes needed.
  * debian/copyright
    - Switched the debian packaging to PSF license.
    - Added the CLVault license.
  * debian/rules
    - Use overrides to create links to clvault executables.
    - Overrides dh_auto_install to install CLVault files.

Added:
  packages/python-keyring/trunk/debian/clvault/
  packages/python-keyring/trunk/debian/clvault/clvault-get.1
  packages/python-keyring/trunk/debian/clvault/clvault-list.1
  packages/python-keyring/trunk/debian/clvault/clvault-set.1
  packages/python-keyring/trunk/debian/clvault/clvault/
  packages/python-keyring/trunk/debian/clvault/clvault/passwordlist.py
  packages/python-keyring/trunk/debian/clvault/get_password.py
  packages/python-keyring/trunk/debian/clvault/print_password.py
  packages/python-keyring/trunk/debian/clvault/set_password.py
  packages/python-keyring/trunk/debian/python-keyring.manpages
Modified:
  packages/python-keyring/trunk/debian/changelog
  packages/python-keyring/trunk/debian/control
  packages/python-keyring/trunk/debian/copyright
  packages/python-keyring/trunk/debian/python-keyring.install
  packages/python-keyring/trunk/debian/rules

Modified: packages/python-keyring/trunk/debian/changelog
===================================================================
--- packages/python-keyring/trunk/debian/changelog	2010-03-23 22:11:06 UTC (rev 12356)
+++ packages/python-keyring/trunk/debian/changelog	2010-03-23 22:19:41 UTC (rev 12357)
@@ -1,3 +1,24 @@
+python-keyring (0.2-4) unstable; urgency=low
+
+  * Added the debian/clvault directory to provide CLVault
+  * Added debian/clvault/get_password.py
+  * Added debian/clvault/set_password.py
+  * Added debian/clvault/passwordlist.py
+  * Added debian/clvault/clvault directory
+  * Added debian/clvault/clvault/passwordlist.py
+  * debian/control
+    - Changed Maintainer to DPMT.
+    - Changed Uploaders to Carl Chenet.
+    - Bump Standards-Version to 8.3.4. No changes needed.
+  * debian/copyright
+    - Switched the debian packaging to PSF license.
+    - Added the CLVault license. 
+  * debian/rules
+    - Use overrides to create links to clvault executables.
+    - Overrides dh_auto_install to install CLVault files.
+
+ -- Carl Chenet <chaica at ohmytux.com>  Tue, 23 Mar 2010 23:23:17 +0100
+
 python-keyring (0.2-3) unstable; urgency=low
 
   * debian/rules

Added: packages/python-keyring/trunk/debian/clvault/clvault/passwordlist.py
===================================================================
--- packages/python-keyring/trunk/debian/clvault/clvault/passwordlist.py	                        (rev 0)
+++ packages/python-keyring/trunk/debian/clvault/clvault/passwordlist.py	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,27 @@
+import os
+from ConfigParser import ConfigParser
+
+# propose that expanduser takes several params
+_SERVICE_CFG = os.path.expanduser(os.path.join('~', '.clvault'))
+
+def get_services():
+    config = ConfigParser()
+    if os.path.exists(_SERVICE_CFG):
+        config.read(_SERVICE_CFG)
+    else:
+        print('No password saved.')
+        return
+
+    print('Registered services:')
+    for service, description in config.items('clvault'):
+        print('\t%s\t%s' % (service, description))
+
+def add_service(name, description):
+    config = ConfigParser()
+    if os.path.exists(_SERVICE_CFG):
+        config.read(_SERVICE_CFG)
+    if not config.has_section('clvault'):
+        config.add_section('clvault')
+    config.set('clvault', name, description)
+    config.write(open(_SERVICE_CFG, 'w'))
+

Added: packages/python-keyring/trunk/debian/clvault/clvault-get.1
===================================================================
--- packages/python-keyring/trunk/debian/clvault/clvault-get.1	                        (rev 0)
+++ packages/python-keyring/trunk/debian/clvault/clvault-get.1	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,35 @@
+'\" t
+.\"     Title: clvault-get
+.\"    Author: [see the "AUTHOR" section]
+.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
+.\"      Date: 02/17/2010
+.\"  Language: English
+.\"
+.TH "CLVAULT\-GET" "1" "02/17/2010"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+clvault-get \- copy the password for a given service in your clipboard
+.SH "SYNOPSIS"
+.sp
+clvault\-get SERVICE
+.SH "DESCRIPTION"
+.sp
+clvault\-get copy the password for a given service in your clipboard\&.
+.SH "AUTHOR"
+.sp
+This manual page was written by Carl Chenet <carl\&.chenet at ohmytux\&.com>
+.SH "RESSOURCES"
+.sp
+CLVault homepage : http://pypi\&.python\&.org/pypi/CLVault
+.SH "LICENSE"
+.sp
+The clvault\-get manual page is distributed under the terms of the Python Software License\&.

Added: packages/python-keyring/trunk/debian/clvault/clvault-list.1
===================================================================
--- packages/python-keyring/trunk/debian/clvault/clvault-list.1	                        (rev 0)
+++ packages/python-keyring/trunk/debian/clvault/clvault-list.1	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,35 @@
+'\" t
+.\"     Title: clvault-list
+.\"    Author: [see the "AUTHOR" section]
+.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
+.\"      Date: 02/17/2010
+.\"  Language: English
+.\"
+.TH "CLVAULT\-LIST" "1" "02/17/2010"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+clvault-list \- lists all registered services
+.SH "SYNOPSIS"
+.sp
+clvault\-list SERVICE
+.SH "DESCRIPTION"
+.sp
+lists all registered services, with their description when given\&.
+.SH "AUTHOR"
+.sp
+This manual page was written by Carl Chenet <carl\&.chenet at ohmytux\&.com>
+.SH "RESSOURCES"
+.sp
+CLVault homepage : http://pypi\&.python\&.org/pypi/CLVault
+.SH "LICENSE"
+.sp
+The clvault\-list manual page is distributed under the terms of the Python Software License\&.

Added: packages/python-keyring/trunk/debian/clvault/clvault-set.1
===================================================================
--- packages/python-keyring/trunk/debian/clvault/clvault-set.1	                        (rev 0)
+++ packages/python-keyring/trunk/debian/clvault/clvault-set.1	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,35 @@
+'\" t
+.\"     Title: clvault-set
+.\"    Author: [see the "AUTHOR" section]
+.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
+.\"      Date: 02/17/2010
+.\"  Language: English
+.\"
+.TH "CLVAULT\-SET" "1" "02/17/2010"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+clvault-set \- takes a service name then prompt you for a password
+.SH "SYNOPSIS"
+.sp
+clvault\-set SERVICE
+.SH "DESCRIPTION"
+.sp
+clvault\-set takes a service name then prompt you for a password\&.
+.SH "AUTHOR"
+.sp
+This manual page was written by Carl Chenet <carl\&.chenet at ohmytux\&.com>
+.SH "RESSOURCES"
+.sp
+CLVault homepage : http://pypi\&.python\&.org/pypi/CLVault
+.SH "LICENSE"
+.sp
+The clvault\-set manual page is distributed under the terms of the Python Software License\&.

Added: packages/python-keyring/trunk/debian/clvault/get_password.py
===================================================================
--- packages/python-keyring/trunk/debian/clvault/get_password.py	                        (rev 0)
+++ packages/python-keyring/trunk/debian/clvault/get_password.py	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,102 @@
+#!/usr/bin/env python
+import sys
+import os
+import subprocess
+from distutils.spawn import find_executable
+from keyring import get_password
+
+class Clipboard(object):
+
+    def _read_win32(self):
+        try:
+            import win32clipboard as clipboard
+            import win32con
+        except ImportError:
+            return
+        clipboard.OpenClipboard()
+        try:
+            return clipboard.GetClipboardData(win32con.CF_TEXT)
+        finally:
+            clipboard.CloseClipboard()
+
+    def _read_darwin(self):
+        proc = subprocess.Popen('/usr/bin/pbpaste', shell=True,
+                                stdout=subprocess.PIPE)
+        return proc.stdout.read()
+
+    def _read_linux2(self):
+        if os.environ.get('DISPLAY') is not None:
+            xsel = find_executable('xsel')
+            if xsel is not None:
+                return os.popen(xsel).read()
+            xclip = find_executable('xclip')
+            if xclip is not None:
+                return os.popen('%s -o' % xclip).read()
+
+    def read(self):
+        meth = '_read_%s' % sys.platform
+        if hasattr(self, meth):
+            return getattr(self, meth)()
+        else:
+            return self._read_linux2()
+
+    def _write_process(self, cmd, value):
+        proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE)
+        proc.stdin.write(value)
+
+    def _write_win32(self, value):
+        try:
+            import win32clipboard as clipboard
+            import win32con
+        except ImportError:
+            return None
+
+        clipboard.OpenClipboard()
+        try:
+            clipboard.EmptyClipboard()
+            clipboard.SetClipboardText(value)
+        finally:
+            clipboard.CloseClipboard()
+
+    def _write_darwin(self, value):
+        self._write_process('/usr/bin/pbcopy', value)
+
+    def _write_linux2(self, value):
+        if os.environ.get('DISPLAY') is not None:
+            xsel = find_executable('xsel')
+            if xsel is not None:
+                self._write_process(xsel, value)
+            xclip = find_executable('xclip')
+            if xclip is not None:
+                self._write_process('%s -i' % xclip, value)
+
+    def write(self, value):
+        meth = '_write_%s' % sys.platform
+        if hasattr(self, meth):
+            getattr(self, meth)(value)
+        else:
+            # default
+            self._write_linux2(value)
+
+
+def main():
+    if len(sys.argv) != 2:
+        print('Usage: clvault-get service')
+        sys.exit(1)
+    service = sys.argv[1]
+    res = get_password(service, 'clvault-password')
+    if res is None:
+        print('No password')
+    else:
+        if ':::' in res:
+            username, password = res.split(':::')
+            print('The username is "%s"' % username)
+        else:
+            password = res
+        clip = Clipboard()
+        clip.write(password)
+        print('The password has been copied in your clipboard')
+
+if __name__ == '__main__':
+    main()
+


Property changes on: packages/python-keyring/trunk/debian/clvault/get_password.py
___________________________________________________________________
Added: svn:executable
   + *

Added: packages/python-keyring/trunk/debian/clvault/print_password.py
===================================================================
--- packages/python-keyring/trunk/debian/clvault/print_password.py	                        (rev 0)
+++ packages/python-keyring/trunk/debian/clvault/print_password.py	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+from clvault.passwordlist import get_services
+
+if __name__ == '__main__':
+    get_services()


Property changes on: packages/python-keyring/trunk/debian/clvault/print_password.py
___________________________________________________________________
Added: svn:executable
   + *

Added: packages/python-keyring/trunk/debian/clvault/set_password.py
===================================================================
--- packages/python-keyring/trunk/debian/clvault/set_password.py	                        (rev 0)
+++ packages/python-keyring/trunk/debian/clvault/set_password.py	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+from keyring import set_password
+from getpass import getpass
+import sys
+
+from clvault.passwordlist import add_service
+
+def _main(service, password=None):
+    if password is None:
+        password = getpass('Set your password: ')
+    username = raw_input('Set the associated username (can be blank): ')
+    username = username.strip()
+    if username != '':
+        password = '%s:::%s' % (username, password)
+    description = raw_input('Set a description (can be blank): ')
+    description = description.strip()
+    add_service(service, description)
+    set_password(service, 'clvault-password', password)
+    print('Password set.')
+
+def main():
+    if len(sys.argv) not in (2, 3):
+        print('Usage: clvault-set service')
+        sys.exit(1)
+
+    _main(*sys.argv[1:])
+
+
+if __name__ == '__main__':
+    main()
+


Property changes on: packages/python-keyring/trunk/debian/clvault/set_password.py
___________________________________________________________________
Added: svn:executable
   + *

Modified: packages/python-keyring/trunk/debian/control
===================================================================
--- packages/python-keyring/trunk/debian/control	2010-03-23 22:11:06 UTC (rev 12356)
+++ packages/python-keyring/trunk/debian/control	2010-03-23 22:19:41 UTC (rev 12357)
@@ -2,10 +2,10 @@
 Priority: optional
 Section: python
 XS-Python-Version: >= 2.5
-Maintainer: Carl Chenet <chaica at ohmytux.com>
-Uploaders: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Uploaders: Carl Chenet <chaica at ohmytux.com>
 Build-Depends: debhelper (>= 7.0.50~), python(>= 2.5), python-support, python-all-dev, pkg-config, libdbus-1-dev, libglib2.0-dev, libgnome-keyring-dev, kdelibs5-dev, kdelibs-bin, libqt4-dev
-Standards-Version: 3.8.3
+Standards-Version: 3.8.4
 Homepage: http://pypi.python.org/pypi/keyring
 Vcs-Svn: svn://svn.debian.org/svn/python-modules/packages/python-keyring/trunk/
 Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/python-keyring/trunk/

Modified: packages/python-keyring/trunk/debian/copyright
===================================================================
--- packages/python-keyring/trunk/debian/copyright	2010-03-23 22:11:06 UTC (rev 12356)
+++ packages/python-keyring/trunk/debian/copyright	2010-03-23 22:19:41 UTC (rev 12357)
@@ -275,10 +275,26 @@
     ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
     OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-The Debian packaging is:
+The following files:
+debian/clvault/get_password.py
+debian/clvault/set_password.py
+debian/clvault/clvault/passwordlist.py
 
+They were downloaded from http://pypi.python.org/pypi/CLVault
+
+Upstream Author:
+
+    Tarek Ziadé <tarek at ziade.org>
+
+Copyright:
+
+    Copyright © 2010 Tarek Ziadé
+
+ClVault files also use the PSF licence, described above.
+
+The Debian packaging and the remnant files in debian/clvault are:
+
     Copyright © 2009 Carl Chenet <chaica at ohmytux.com>
 
-and is licensed under the GPL version 3, 
-see `/usr/share/common-licenses/GPL-3'.
+and also use the PSF license, describe above.
 

Modified: packages/python-keyring/trunk/debian/python-keyring.install
===================================================================
--- packages/python-keyring/trunk/debian/python-keyring.install	2010-03-23 22:11:06 UTC (rev 12356)
+++ packages/python-keyring/trunk/debian/python-keyring.install	2010-03-23 22:19:41 UTC (rev 12357)
@@ -1,2 +1,8 @@
 usr/lib/python*/*-packages/keyring/*.py
 usr/lib/python*/*-packages/keyring-*.egg-info
+usr/lib/clvault/clvault-get
+usr/lib/clvault/clvault-set
+usr/lib/clvault/clvault-list
+usr/lib/clvault/clvault/passwordlist.py
+usr/lib/clvault/clvault/__init__.py
+

Added: packages/python-keyring/trunk/debian/python-keyring.manpages
===================================================================
--- packages/python-keyring/trunk/debian/python-keyring.manpages	                        (rev 0)
+++ packages/python-keyring/trunk/debian/python-keyring.manpages	2010-03-23 22:19:41 UTC (rev 12357)
@@ -0,0 +1,3 @@
+debian/clvault/clvault-set.1
+debian/clvault/clvault-get.1
+debian/clvault/clvault-list.1

Modified: packages/python-keyring/trunk/debian/rules
===================================================================
--- packages/python-keyring/trunk/debian/rules	2010-03-23 22:11:06 UTC (rev 12356)
+++ packages/python-keyring/trunk/debian/rules	2010-03-23 22:19:41 UTC (rev 12357)
@@ -11,3 +11,22 @@
 override_dh_auto_build:
 	mkdir -p $(HOME)
 	dh_auto_build
+
+override_dh_auto_install:
+	dh_auto_install
+	mkdir -p usr/lib/clvault/clvault/
+	cp -f debian/clvault/get_password.py usr/lib/clvault/clvault-get
+	chmod 755 usr/lib/clvault/clvault-get
+	cp -f debian/clvault/set_password.py usr/lib/clvault/clvault-set
+	chmod 755 usr/lib/clvault/clvault-set
+	cp -f debian/clvault/print_password.py usr/lib/clvault/clvault-list
+	chmod 755 usr/lib/clvault/clvault-list
+	cp -f debian/clvault/clvault/passwordlist.py usr/lib/clvault/clvault/passwordlist.py
+	touch usr/lib/clvault/clvault/__init__.py
+
+override_dh_link:
+	dh_link usr/lib/clvault/clvault-get usr/bin/clvault-get
+	dh_link usr/lib/clvault/clvault-set usr/bin/clvault-set
+	dh_link usr/lib/clvault/clvault-list usr/bin/clvault-list
+	dh_link 
+




More information about the Python-modules-commits mailing list