* 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
14 years ago
0 | python-keyring (0.2-4) unstable; urgency=low | |
1 | ||
2 | * Added the debian/clvault directory to provide CLVault | |
3 | * Added debian/clvault/get_password.py | |
4 | * Added debian/clvault/set_password.py | |
5 | * Added debian/clvault/passwordlist.py | |
6 | * Added debian/clvault/clvault directory | |
7 | * Added debian/clvault/clvault/passwordlist.py | |
8 | * debian/control | |
9 | - Changed Maintainer to DPMT. | |
10 | - Changed Uploaders to Carl Chenet. | |
11 | - Bump Standards-Version to 8.3.4. No changes needed. | |
12 | * debian/copyright | |
13 | - Switched the debian packaging to PSF license. | |
14 | - Added the CLVault license. | |
15 | * debian/rules | |
16 | - Use overrides to create links to clvault executables. | |
17 | - Overrides dh_auto_install to install CLVault files. | |
18 | ||
19 | -- Carl Chenet <chaica@ohmytux.com> Tue, 23 Mar 2010 23:23:17 +0100 | |
20 | ||
0 | 21 | python-keyring (0.2-3) unstable; urgency=low |
1 | 22 | |
2 | 23 | * debian/rules |
0 | import os | |
1 | from ConfigParser import ConfigParser | |
2 | ||
3 | # propose that expanduser takes several params | |
4 | _SERVICE_CFG = os.path.expanduser(os.path.join('~', '.clvault')) | |
5 | ||
6 | def get_services(): | |
7 | config = ConfigParser() | |
8 | if os.path.exists(_SERVICE_CFG): | |
9 | config.read(_SERVICE_CFG) | |
10 | else: | |
11 | print('No password saved.') | |
12 | return | |
13 | ||
14 | print('Registered services:') | |
15 | for service, description in config.items('clvault'): | |
16 | print('\t%s\t%s' % (service, description)) | |
17 | ||
18 | def add_service(name, description): | |
19 | config = ConfigParser() | |
20 | if os.path.exists(_SERVICE_CFG): | |
21 | config.read(_SERVICE_CFG) | |
22 | if not config.has_section('clvault'): | |
23 | config.add_section('clvault') | |
24 | config.set('clvault', name, description) | |
25 | config.write(open(_SERVICE_CFG, 'w')) | |
26 |
0 | '\" t | |
1 | .\" Title: clvault-get | |
2 | .\" Author: [see the "AUTHOR" section] | |
3 | .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/> | |
4 | .\" Date: 02/17/2010 | |
5 | .\" Language: English | |
6 | .\" | |
7 | .TH "CLVAULT\-GET" "1" "02/17/2010" | |
8 | .\" ----------------------------------------------------------------- | |
9 | .\" * set default formatting | |
10 | .\" ----------------------------------------------------------------- | |
11 | .\" disable hyphenation | |
12 | .nh | |
13 | .\" disable justification (adjust text to left margin only) | |
14 | .ad l | |
15 | .\" ----------------------------------------------------------------- | |
16 | .\" * MAIN CONTENT STARTS HERE * | |
17 | .\" ----------------------------------------------------------------- | |
18 | .SH "NAME" | |
19 | clvault-get \- copy the password for a given service in your clipboard | |
20 | .SH "SYNOPSIS" | |
21 | .sp | |
22 | clvault\-get SERVICE | |
23 | .SH "DESCRIPTION" | |
24 | .sp | |
25 | clvault\-get copy the password for a given service in your clipboard\&. | |
26 | .SH "AUTHOR" | |
27 | .sp | |
28 | This manual page was written by Carl Chenet <carl\&.chenet@ohmytux\&.com> | |
29 | .SH "RESSOURCES" | |
30 | .sp | |
31 | CLVault homepage : http://pypi\&.python\&.org/pypi/CLVault | |
32 | .SH "LICENSE" | |
33 | .sp | |
34 | The clvault\-get manual page is distributed under the terms of the Python Software License\&. |
0 | '\" t | |
1 | .\" Title: clvault-list | |
2 | .\" Author: [see the "AUTHOR" section] | |
3 | .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/> | |
4 | .\" Date: 02/17/2010 | |
5 | .\" Language: English | |
6 | .\" | |
7 | .TH "CLVAULT\-LIST" "1" "02/17/2010" | |
8 | .\" ----------------------------------------------------------------- | |
9 | .\" * set default formatting | |
10 | .\" ----------------------------------------------------------------- | |
11 | .\" disable hyphenation | |
12 | .nh | |
13 | .\" disable justification (adjust text to left margin only) | |
14 | .ad l | |
15 | .\" ----------------------------------------------------------------- | |
16 | .\" * MAIN CONTENT STARTS HERE * | |
17 | .\" ----------------------------------------------------------------- | |
18 | .SH "NAME" | |
19 | clvault-list \- lists all registered services | |
20 | .SH "SYNOPSIS" | |
21 | .sp | |
22 | clvault\-list SERVICE | |
23 | .SH "DESCRIPTION" | |
24 | .sp | |
25 | lists all registered services, with their description when given\&. | |
26 | .SH "AUTHOR" | |
27 | .sp | |
28 | This manual page was written by Carl Chenet <carl\&.chenet@ohmytux\&.com> | |
29 | .SH "RESSOURCES" | |
30 | .sp | |
31 | CLVault homepage : http://pypi\&.python\&.org/pypi/CLVault | |
32 | .SH "LICENSE" | |
33 | .sp | |
34 | The clvault\-list manual page is distributed under the terms of the Python Software License\&. |
0 | '\" t | |
1 | .\" Title: clvault-set | |
2 | .\" Author: [see the "AUTHOR" section] | |
3 | .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/> | |
4 | .\" Date: 02/17/2010 | |
5 | .\" Language: English | |
6 | .\" | |
7 | .TH "CLVAULT\-SET" "1" "02/17/2010" | |
8 | .\" ----------------------------------------------------------------- | |
9 | .\" * set default formatting | |
10 | .\" ----------------------------------------------------------------- | |
11 | .\" disable hyphenation | |
12 | .nh | |
13 | .\" disable justification (adjust text to left margin only) | |
14 | .ad l | |
15 | .\" ----------------------------------------------------------------- | |
16 | .\" * MAIN CONTENT STARTS HERE * | |
17 | .\" ----------------------------------------------------------------- | |
18 | .SH "NAME" | |
19 | clvault-set \- takes a service name then prompt you for a password | |
20 | .SH "SYNOPSIS" | |
21 | .sp | |
22 | clvault\-set SERVICE | |
23 | .SH "DESCRIPTION" | |
24 | .sp | |
25 | clvault\-set takes a service name then prompt you for a password\&. | |
26 | .SH "AUTHOR" | |
27 | .sp | |
28 | This manual page was written by Carl Chenet <carl\&.chenet@ohmytux\&.com> | |
29 | .SH "RESSOURCES" | |
30 | .sp | |
31 | CLVault homepage : http://pypi\&.python\&.org/pypi/CLVault | |
32 | .SH "LICENSE" | |
33 | .sp | |
34 | The clvault\-set manual page is distributed under the terms of the Python Software License\&. |
0 | #!/usr/bin/env python | |
1 | import sys | |
2 | import os | |
3 | import subprocess | |
4 | from distutils.spawn import find_executable | |
5 | from keyring import get_password | |
6 | ||
7 | class Clipboard(object): | |
8 | ||
9 | def _read_win32(self): | |
10 | try: | |
11 | import win32clipboard as clipboard | |
12 | import win32con | |
13 | except ImportError: | |
14 | return | |
15 | clipboard.OpenClipboard() | |
16 | try: | |
17 | return clipboard.GetClipboardData(win32con.CF_TEXT) | |
18 | finally: | |
19 | clipboard.CloseClipboard() | |
20 | ||
21 | def _read_darwin(self): | |
22 | proc = subprocess.Popen('/usr/bin/pbpaste', shell=True, | |
23 | stdout=subprocess.PIPE) | |
24 | return proc.stdout.read() | |
25 | ||
26 | def _read_linux2(self): | |
27 | if os.environ.get('DISPLAY') is not None: | |
28 | xsel = find_executable('xsel') | |
29 | if xsel is not None: | |
30 | return os.popen(xsel).read() | |
31 | xclip = find_executable('xclip') | |
32 | if xclip is not None: | |
33 | return os.popen('%s -o' % xclip).read() | |
34 | ||
35 | def read(self): | |
36 | meth = '_read_%s' % sys.platform | |
37 | if hasattr(self, meth): | |
38 | return getattr(self, meth)() | |
39 | else: | |
40 | return self._read_linux2() | |
41 | ||
42 | def _write_process(self, cmd, value): | |
43 | proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE) | |
44 | proc.stdin.write(value) | |
45 | ||
46 | def _write_win32(self, value): | |
47 | try: | |
48 | import win32clipboard as clipboard | |
49 | import win32con | |
50 | except ImportError: | |
51 | return None | |
52 | ||
53 | clipboard.OpenClipboard() | |
54 | try: | |
55 | clipboard.EmptyClipboard() | |
56 | clipboard.SetClipboardText(value) | |
57 | finally: | |
58 | clipboard.CloseClipboard() | |
59 | ||
60 | def _write_darwin(self, value): | |
61 | self._write_process('/usr/bin/pbcopy', value) | |
62 | ||
63 | def _write_linux2(self, value): | |
64 | if os.environ.get('DISPLAY') is not None: | |
65 | xsel = find_executable('xsel') | |
66 | if xsel is not None: | |
67 | self._write_process(xsel, value) | |
68 | xclip = find_executable('xclip') | |
69 | if xclip is not None: | |
70 | self._write_process('%s -i' % xclip, value) | |
71 | ||
72 | def write(self, value): | |
73 | meth = '_write_%s' % sys.platform | |
74 | if hasattr(self, meth): | |
75 | getattr(self, meth)(value) | |
76 | else: | |
77 | # default | |
78 | self._write_linux2(value) | |
79 | ||
80 | ||
81 | def main(): | |
82 | if len(sys.argv) != 2: | |
83 | print('Usage: clvault-get service') | |
84 | sys.exit(1) | |
85 | service = sys.argv[1] | |
86 | res = get_password(service, 'clvault-password') | |
87 | if res is None: | |
88 | print('No password') | |
89 | else: | |
90 | if ':::' in res: | |
91 | username, password = res.split(':::') | |
92 | print('The username is "%s"' % username) | |
93 | else: | |
94 | password = res | |
95 | clip = Clipboard() | |
96 | clip.write(password) | |
97 | print('The password has been copied in your clipboard') | |
98 | ||
99 | if __name__ == '__main__': | |
100 | main() | |
101 |
0 | #!/usr/bin/env python | |
1 | ||
2 | from clvault.passwordlist import get_services | |
3 | ||
4 | if __name__ == '__main__': | |
5 | get_services() |
0 | #!/usr/bin/env python | |
1 | from keyring import set_password | |
2 | from getpass import getpass | |
3 | import sys | |
4 | ||
5 | from clvault.passwordlist import add_service | |
6 | ||
7 | def _main(service, password=None): | |
8 | if password is None: | |
9 | password = getpass('Set your password: ') | |
10 | username = raw_input('Set the associated username (can be blank): ') | |
11 | username = username.strip() | |
12 | if username != '': | |
13 | password = '%s:::%s' % (username, password) | |
14 | description = raw_input('Set a description (can be blank): ') | |
15 | description = description.strip() | |
16 | add_service(service, description) | |
17 | set_password(service, 'clvault-password', password) | |
18 | print('Password set.') | |
19 | ||
20 | def main(): | |
21 | if len(sys.argv) not in (2, 3): | |
22 | print('Usage: clvault-set service') | |
23 | sys.exit(1) | |
24 | ||
25 | _main(*sys.argv[1:]) | |
26 | ||
27 | ||
28 | if __name__ == '__main__': | |
29 | main() | |
30 |
1 | 1 | Priority: optional |
2 | 2 | Section: python |
3 | 3 | XS-Python-Version: >= 2.5 |
4 | Maintainer: Carl Chenet <chaica@ohmytux.com> | |
5 | Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> | |
4 | Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> | |
5 | Uploaders: Carl Chenet <chaica@ohmytux.com> | |
6 | 6 | 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 |
7 | Standards-Version: 3.8.3 | |
7 | Standards-Version: 3.8.4 | |
8 | 8 | Homepage: http://pypi.python.org/pypi/keyring |
9 | 9 | Vcs-Svn: svn://svn.debian.org/svn/python-modules/packages/python-keyring/trunk/ |
10 | 10 | Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/python-keyring/trunk/ |
274 | 274 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
275 | 275 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
276 | 276 | |
277 | The Debian packaging is: | |
277 | The following files: | |
278 | debian/clvault/get_password.py | |
279 | debian/clvault/set_password.py | |
280 | debian/clvault/clvault/passwordlist.py | |
281 | ||
282 | They were downloaded from http://pypi.python.org/pypi/CLVault | |
283 | ||
284 | Upstream Author: | |
285 | ||
286 | Tarek Ziadé <tarek@ziade.org> | |
287 | ||
288 | Copyright: | |
289 | ||
290 | Copyright © 2010 Tarek Ziadé | |
291 | ||
292 | ClVault files also use the PSF licence, described above. | |
293 | ||
294 | The Debian packaging and the remnant files in debian/clvault are: | |
278 | 295 | |
279 | 296 | Copyright © 2009 Carl Chenet <chaica@ohmytux.com> |
280 | 297 | |
281 | and is licensed under the GPL version 3, | |
282 | see `/usr/share/common-licenses/GPL-3'. | |
283 | ||
298 | and also use the PSF license, describe above. | |
299 |
0 | 0 | usr/lib/python*/*-packages/keyring/*.py |
1 | 1 | usr/lib/python*/*-packages/keyring-*.egg-info |
2 | usr/lib/clvault/clvault-get | |
3 | usr/lib/clvault/clvault-set | |
4 | usr/lib/clvault/clvault-list | |
5 | usr/lib/clvault/clvault/passwordlist.py | |
6 | usr/lib/clvault/clvault/__init__.py | |
7 |
10 | 10 | override_dh_auto_build: |
11 | 11 | mkdir -p $(HOME) |
12 | 12 | dh_auto_build |
13 | ||
14 | override_dh_auto_install: | |
15 | dh_auto_install | |
16 | mkdir -p usr/lib/clvault/clvault/ | |
17 | cp -f debian/clvault/get_password.py usr/lib/clvault/clvault-get | |
18 | chmod 755 usr/lib/clvault/clvault-get | |
19 | cp -f debian/clvault/set_password.py usr/lib/clvault/clvault-set | |
20 | chmod 755 usr/lib/clvault/clvault-set | |
21 | cp -f debian/clvault/print_password.py usr/lib/clvault/clvault-list | |
22 | chmod 755 usr/lib/clvault/clvault-list | |
23 | cp -f debian/clvault/clvault/passwordlist.py usr/lib/clvault/clvault/passwordlist.py | |
24 | touch usr/lib/clvault/clvault/__init__.py | |
25 | ||
26 | override_dh_link: | |
27 | dh_link usr/lib/clvault/clvault-get usr/bin/clvault-get | |
28 | dh_link usr/lib/clvault/clvault-set usr/bin/clvault-set | |
29 | dh_link usr/lib/clvault/clvault-list usr/bin/clvault-list | |
30 | dh_link | |
31 |