From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/gkeys/
Date: Wed, 31 Dec 2014 21:34:30 +0000 (UTC) [thread overview]
Message-ID: <1419975746.ffb2d93b1085c600cee9bd6fa2cf17c098c3bc2c.dolsen@gentoo.org@gentoo> (raw)
commit: ffb2d93b1085c600cee9bd6fa2cf17c098c3bc2c
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 27 21:33:07 2014 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Dec 30 21:42:26 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=ffb2d93b
gkeys: Move all GKEYS definitions to it's own file
Fix imports in other files.
---
gkeys/gkeys/actions.py | 2 +-
gkeys/gkeys/checks.py | 2 +-
gkeys/gkeys/config.py | 41 +---------------------------------
gkeys/gkeys/gkey.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++
gkeys/gkeys/seed.py | 2 +-
gkeys/gkeys/seedhandler.py | 2 +-
6 files changed, 60 insertions(+), 44 deletions(-)
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py
index be1823f..9baecaa 100644
--- a/gkeys/gkeys/actions.py
+++ b/gkeys/gkeys/actions.py
@@ -27,7 +27,7 @@ from shutil import rmtree
from gkeys.lib import GkeysGPG
from gkeys.seedhandler import SeedHandler
-from gkeys.config import GKEY
+from gkeys.gkey import GKEY
from gkeys.checks import SPECCHECK_SUMMARY, convert_pf, convert_yn
diff --git a/gkeys/gkeys/checks.py b/gkeys/gkeys/checks.py
index 69df9c4..bddad5f 100644
--- a/gkeys/gkeys/checks.py
+++ b/gkeys/gkeys/checks.py
@@ -12,7 +12,7 @@
import time
from collections import namedtuple, OrderedDict
-from gkeys.config import GKEY_CHECK
+from gkeys.gkey import GKEY_CHECK
from pyGPG.mappings import (ALGORITHM_CODES, CAPABILITY_MAP,
KEY_VERSION_FPR_LEN, VALIDITY_MAP, VALID_LIST)
diff --git a/gkeys/gkeys/config.py b/gkeys/gkeys/config.py
index 6eba2b3..8fa4c1b 100644
--- a/gkeys/gkeys/config.py
+++ b/gkeys/gkeys/config.py
@@ -6,14 +6,13 @@
Holds configuration keys and values
- @copyright: 2012 by Brian Dolbec <dol-sen@gentoo.org>
+ @copyright: 2012-2015 by Brian Dolbec <dol-sen@gentoo.org>
@license: GNU GNU GPL2, see COPYING for details.
"""
import os
from collections import OrderedDict
-from collections import namedtuple
from pyGPG.config import GPGConfig
@@ -30,16 +29,6 @@ EPREFIX = "@GENTOO_PORTAGE_EPREFIX@"
if "GENTOO_PORTAGE_EPREFIX" in EPREFIX:
EPREFIX = ''
-GKEY_STRING = ''' ----------
- Name.........: %(name)s
- Nick.........: %(nick)s
- Keydir.......: %(keydir)s
-'''
-
-GKEY_FINGERPRINTS = \
-''' Keyid........: %(keyid)s
- Fingerprint: %(fingerprint)s
-'''
MAPSEEDS = { 'dev' : 'gentoodevs.seeds', 'rel': 'gentoo.seeds' }
@@ -137,31 +126,3 @@ class GKeysConfig(GPGConfig):
else:
return super(GKeysConfig, self)._get_(key, subkey)
-
-class GKEY(namedtuple('GKEY', ['nick', 'name', 'keydir', 'fingerprint'])):
- '''Class to hold the relavent info about a key'''
-
- field_types = {'nick': str, 'name': str, 'keydir': str, 'fingerprint': list}
- __slots__ = ()
-
-
- @property
- def keyid(self):
- '''Keyid is a substring value of the fingerprint'''
- return ['0x' + x[-16:] for x in self.fingerprint]
-
-
- @property
- def pretty_print(self):
- '''Pretty printing a GKEY'''
- gkey = {'name': self.name, 'nick': self.nick, 'keydir': self.keydir}
- output = GKEY_STRING % gkey
- for f in self.fingerprint:
- fingerprint = {'fingerprint': f, 'keyid': '0x' + f[-16:]}
- output += GKEY_FINGERPRINTS % fingerprint
- return output
-
-
-class GKEY_CHECK(namedtuple('GKEY_CHECK', ['keyid', 'revoked', 'expired', 'invalid', 'sign'])):
-
- __slots__ = ()
diff --git a/gkeys/gkeys/gkey.py b/gkeys/gkeys/gkey.py
new file mode 100644
index 0000000..41c6d8b
--- /dev/null
+++ b/gkeys/gkeys/gkey.py
@@ -0,0 +1,55 @@
+#
+#-*- coding:utf-8 -*-
+
+"""
+ Gentoo-keys - gkey.py
+
+ Holds GKEY class and related values
+
+ @copyright: 2012-2015 by Brian Dolbec <dol-sen@gentoo.org>
+ @license: GNU GNU GPL2, see COPYING for details.
+"""
+
+
+from collections import namedtuple
+
+
+GKEY_STRING = ''' ----------
+ Name.........: %(name)s
+ Nick.........: %(nick)s
+ Keydir.......: %(keydir)s
+'''
+
+GKEY_FINGERPRINTS = \
+''' Keyid........: %(keyid)s
+ Fingerprint: %(fingerprint)s
+'''
+
+
+class GKEY(namedtuple('GKEY', ['nick', 'name', 'keydir', 'fingerprint'])):
+ '''Class to hold the relavent info about a key'''
+
+ field_types = {'nick': str, 'name': str, 'keydir': str, 'fingerprint': list}
+ __slots__ = ()
+
+
+ @property
+ def keyid(self):
+ '''Keyid is a substring value of the fingerprint'''
+ return ['0x' + x[-16:] for x in self.fingerprint]
+
+
+ @property
+ def pretty_print(self):
+ '''Pretty printing a GKEY'''
+ gkey = {'name': self.name, 'nick': self.nick, 'keydir': self.keydir}
+ output = GKEY_STRING % gkey
+ for f in self.fingerprint:
+ fingerprint = {'fingerprint': f, 'keyid': '0x' + f[-16:]}
+ output += GKEY_FINGERPRINTS % fingerprint
+ return output
+
+
+class GKEY_CHECK(namedtuple('GKEY_CHECK', ['keyid', 'revoked', 'expired', 'invalid', 'sign'])):
+
+ __slots__ = ()
diff --git a/gkeys/gkeys/seed.py b/gkeys/gkeys/seed.py
index 2406c1a..16fe0fd 100644
--- a/gkeys/gkeys/seed.py
+++ b/gkeys/gkeys/seed.py
@@ -20,7 +20,7 @@ import json
import os
from gkeys.log import logger
-from gkeys.config import GKEY
+from gkeys.gkey import GKEY
from gkeys.fileops import ensure_dirs
diff --git a/gkeys/gkeys/seedhandler.py b/gkeys/gkeys/seedhandler.py
index 2222bd2..33ed787 100644
--- a/gkeys/gkeys/seedhandler.py
+++ b/gkeys/gkeys/seedhandler.py
@@ -14,7 +14,7 @@ import os
import re
from json import load
-from gkeys.config import GKEY
+from gkeys.gkey import GKEY
from gkeys.seed import Seeds
from gkeys.fileops import ensure_dirs
next reply other threads:[~2014-12-31 21:34 UTC|newest]
Thread overview: 144+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-31 21:34 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-15 16:15 [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/gkeys/ Brian Dolbec
2018-08-15 1:51 Brian Dolbec
2018-08-15 1:05 Brian Dolbec
2018-07-07 15:10 Brian Dolbec
2018-07-07 15:10 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2018-07-07 5:23 Brian Dolbec
2016-12-24 9:13 [gentoo-commits] proj/gentoo-keys:gsoc-2016 " Brian Dolbec
2016-12-24 0:38 ` [gentoo-commits] proj/gentoo-keys:master " Brian Dolbec
2016-12-24 9:13 [gentoo-commits] proj/gentoo-keys:gsoc-2016 " Brian Dolbec
2016-10-27 21:49 ` [gentoo-commits] proj/gentoo-keys:master " Brian Dolbec
2016-12-24 9:13 [gentoo-commits] proj/gentoo-keys:gsoc-2016 " Brian Dolbec
2016-12-24 0:38 ` [gentoo-commits] proj/gentoo-keys:master " Brian Dolbec
2016-12-24 9:13 [gentoo-commits] proj/gentoo-keys:gsoc-2016 " Brian Dolbec
2016-10-27 18:41 ` [gentoo-commits] proj/gentoo-keys:master " Brian Dolbec
2016-12-24 4:52 Brian Dolbec
2016-06-01 15:16 Brian Dolbec
2016-06-01 15:16 Brian Dolbec
2016-01-23 23:33 Brian Dolbec
2016-01-23 23:33 Brian Dolbec
2016-01-23 19:04 Brian Dolbec
2015-12-25 17:03 Brian Dolbec
2015-12-13 0:51 Brian Dolbec
2015-08-25 14:10 Brian Dolbec
2015-08-25 14:10 Brian Dolbec
2015-08-09 22:52 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-08-09 1:09 Brian Dolbec
2015-07-25 16:45 Brian Dolbec
2015-07-25 16:45 Brian Dolbec
2015-07-25 16:45 Brian Dolbec
2015-06-22 13:41 Brian Dolbec
2015-06-01 1:56 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-05-31 5:03 Brian Dolbec
2015-03-18 15:32 Brian Dolbec
2015-03-17 19:51 Brian Dolbec
2015-03-08 15:09 Brian Dolbec
2015-03-06 21:04 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-02-11 17:37 Brian Dolbec
2015-01-09 21:07 Brian Dolbec
2015-01-09 21:07 Brian Dolbec
2015-01-09 21:07 Brian Dolbec
2015-01-09 21:07 Brian Dolbec
2015-01-09 21:07 Brian Dolbec
2015-01-09 21:07 Brian Dolbec
2015-01-09 21:07 Brian Dolbec
2015-01-08 4:13 Brian Dolbec
2015-01-07 23:39 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-05 23:12 Brian Dolbec
2015-01-01 22:32 Brian Dolbec
2015-01-01 17:44 Brian Dolbec
2015-01-01 17:44 Brian Dolbec
2015-01-01 17:44 Brian Dolbec
2015-01-01 17:44 Brian Dolbec
2015-01-01 17:44 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-31 21:34 Brian Dolbec
2014-12-26 18:37 Brian Dolbec
2014-12-26 18:37 Brian Dolbec
2014-12-26 18:37 Brian Dolbec
2014-12-26 5:02 Brian Dolbec
2014-12-26 5:02 Brian Dolbec
2014-12-26 5:02 Brian Dolbec
2014-12-25 22:07 Brian Dolbec
2014-12-25 22:07 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-25 20:43 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-24 19:59 Brian Dolbec
2014-12-23 2:50 Brian Dolbec
2014-12-23 2:50 Brian Dolbec
2014-12-23 0:13 Brian Dolbec
2014-12-22 23:11 Brian Dolbec
2014-12-22 23:11 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1419975746.ffb2d93b1085c600cee9bd6fa2cf17c098c3bc2c.dolsen@gentoo.org@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox