diff options
author | Dan Buch <daniel.buch@gmail.com> | 2010-05-06 13:53:52 -0400 |
---|---|---|
committer | Dan Buch <daniel.buch@gmail.com> | 2010-05-06 13:53:52 -0400 |
commit | 51cba079b6bc443b3b7004e07df8e838d7133c11 (patch) | |
tree | d4ada02a527567819aefcbace79a03a720bc3ae7 | |
parent | bc0d65b71946dceabac263e3b8f64b9c2164ad53 (diff) | |
download | hg_sshsign-51cba079b6bc443b3b7004e07df8e838d7133c11.tar.bz2 hg_sshsign-51cba079b6bc443b3b7004e07df8e838d7133c11.tar.xz hg_sshsign-51cba079b6bc443b3b7004e07df8e838d7133c11.zip |
updates to get the package into an installable state
- failed unless M2Crypto was already installed
- no package or module was actually installed because
the setup metadata included neither a `packages` nor
a `py_modules` argument
-rw-r--r-- | .hgignore | 3 | ||||
-rw-r--r-- | hgsshsign/__init__.py | 14 | ||||
-rw-r--r-- | hgsshsign/_meta.py | 17 | ||||
-rw-r--r-- | hgsshsign/keys.py | 2 | ||||
-rwxr-xr-x | setup.py | 28 |
5 files changed, 42 insertions, 22 deletions
@@ -1,2 +1 @@ | |||
1 | syntax:glob | ^.*\.(pyc|egg-info)$ | |
2 | *.pyc | ||
diff --git a/hgsshsign/__init__.py b/hgsshsign/__init__.py index 7134ca9..e2cb8c1 100644 --- a/hgsshsign/__init__.py +++ b/hgsshsign/__init__.py | |||
@@ -1,4 +1,4 @@ | |||
1 | # vim: set filencoding=utf8 | 1 | # vim: set filencoding=utf-8 |
2 | """ | 2 | """ |
3 | SSH Key Signing | 3 | SSH Key Signing |
4 | 4 | ||
@@ -7,15 +7,12 @@ SSH Key Signing | |||
7 | @date: May 03, 2010 | 7 | @date: May 03, 2010 |
8 | """ | 8 | """ |
9 | 9 | ||
10 | __version__ = "0.0.1dev" | ||
11 | |||
12 | 10 | ||
13 | import os | 11 | import os |
14 | import binascii | 12 | import binascii |
15 | 13 | ||
16 | import keys | 14 | from hgsshsign._meta import __version__ |
17 | from keymanifest import KeyManifest | 15 | from hgsshsign.sshagent import SSHAgent |
18 | from sshagent import SSHAgent | ||
19 | 16 | ||
20 | from mercurial.i18n import _ | 17 | from mercurial.i18n import _ |
21 | from mercurial import util, commands, match | 18 | from mercurial import util, commands, match |
@@ -26,6 +23,9 @@ class SSHAuthority(object): | |||
26 | 23 | ||
27 | @classmethod | 24 | @classmethod |
28 | def from_ui(cls, ui): | 25 | def from_ui(cls, ui): |
26 | import hgsshsign.keys as keys | ||
27 | from hgsshsign.keymanifest import KeyManifest | ||
28 | |||
29 | public_key = absolute_path(ui.config("sshsign", "public_key")) | 29 | public_key = absolute_path(ui.config("sshsign", "public_key")) |
30 | public_key = keys.PublicKey.from_file(public_key) | 30 | public_key = keys.PublicKey.from_file(public_key) |
31 | 31 | ||
@@ -62,6 +62,8 @@ class SSHAuthority(object): | |||
62 | return key.verify(data, signature) | 62 | return key.verify(data, signature) |
63 | 63 | ||
64 | def sign(self, data): | 64 | def sign(self, data): |
65 | import hgsshsign.keys as keys | ||
66 | |||
65 | return keys.sign_like_agent(data, self.private_key) | 67 | return keys.sign_like_agent(data, self.private_key) |
66 | 68 | ||
67 | 69 | ||
diff --git a/hgsshsign/_meta.py b/hgsshsign/_meta.py new file mode 100644 index 0000000..53bc8be --- /dev/null +++ b/hgsshsign/_meta.py | |||
@@ -0,0 +1,17 @@ | |||
1 | # vim:filetype=python:fileencoding=utf-8 | ||
2 | |||
3 | __version__ = "0.1.0" | ||
4 | |||
5 | SETUP_ARGS = dict( | ||
6 | name="hg-sshsign", | ||
7 | description="ssh signing for mercurial commits", | ||
8 | author="Mike Crute", | ||
9 | author_email="mcrute@gmail.com", | ||
10 | url="http://code.google.com/p/hg-sshsign", | ||
11 | license="Apache 2.0", | ||
12 | version=__version__, | ||
13 | packages=['hgsshsign'], | ||
14 | install_requires=[ | ||
15 | "M2Crypto", | ||
16 | ], | ||
17 | ) | ||
diff --git a/hgsshsign/keys.py b/hgsshsign/keys.py index d15af08..aa291eb 100644 --- a/hgsshsign/keys.py +++ b/hgsshsign/keys.py | |||
@@ -8,10 +8,12 @@ Key Loader Functions | |||
8 | """ | 8 | """ |
9 | 9 | ||
10 | import os | 10 | import os |
11 | |||
11 | from M2Crypto import RSA, DSA | 12 | from M2Crypto import RSA, DSA |
12 | from M2Crypto.EVP import MessageDigest | 13 | from M2Crypto.EVP import MessageDigest |
13 | from M2Crypto.RSA import RSAError | 14 | from M2Crypto.RSA import RSAError |
14 | from M2Crypto.DSA import DSAError | 15 | from M2Crypto.DSA import DSAError |
16 | |||
15 | from structutils import unpack_string, get_packed_mp_ints, int_to_bytes | 17 | from structutils import unpack_string, get_packed_mp_ints, int_to_bytes |
16 | 18 | ||
17 | 19 | ||
@@ -1,15 +1,15 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # vim:filetype=python:fileencoding=utf-8 | ||
3 | import sys | ||
4 | |||
1 | from setuptools import setup | 5 | from setuptools import setup |
2 | from hgsshsign import __version__ | 6 | from hgsshsign._meta import SETUP_ARGS |
3 | 7 | ||
4 | 8 | ||
5 | setup( | 9 | def main(): |
6 | name="hg-sshsign", | 10 | setup(**SETUP_ARGS) |
7 | description="ssh signing for mercurial commits", | 11 | return 0 |
8 | author="Mike Crute", | 12 | |
9 | author_email="mcrute@gmail.com", | 13 | |
10 | url="http://code.google.com/p/hg-sshsign", | 14 | if __name__ == '__main__': |
11 | license="Apache 2.0", | 15 | sys.exit(main()) |
12 | version=__version__, | ||
13 | install_requires=[ | ||
14 | "M2Crypto", | ||
15 | ]) | ||