From: "John Helmert III" <ajak@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/security:ajak-cvetool commit in: bin/
Date: Mon, 5 Jul 2021 20:24:17 +0000 (UTC) [thread overview]
Message-ID: <1625510318.abe128db3bf0ede3f813de854ccee897941638f1.ajak@gentoo> (raw)
commit: abe128db3bf0ede3f813de854ccee897941638f1
Author: John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 5 18:38:38 2021 +0000
Commit: John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Mon Jul 5 18:38:38 2021 +0000
URL: https://gitweb.gentoo.org/proj/security.git/commit/?id=abe128db
bin/: split CVETool class into own file
...and rename cvetool.py back to cvetool
Signed-off-by: John Helmert III <ajak <AT> gentoo.org>
bin/{cvetool.py => CVETool.py} | 33 ++-------------------------------
bin/cvetool | 33 +++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 31 deletions(-)
diff --git a/bin/cvetool.py b/bin/CVETool.py
old mode 100755
new mode 100644
similarity index 90%
rename from bin/cvetool.py
rename to bin/CVETool.py
index 557c030..c5996f6
--- a/bin/cvetool.py
+++ b/bin/CVETool.py
@@ -1,12 +1,8 @@
-#!/usr/bin/env python3
-# Copyright 2016 Alex Legler
-# Distributed under the terms of the GNU General Public License v3
-
import re
import sys
-import os
-from urllib.parse import urlencode
+
from base64 import b64encode
+from urllib.parse import urlencode
import requests
GLSAMAKER_URI = 'https://glsamaker.gentoo.org'
@@ -244,28 +240,3 @@ class CVETool:
if jsondata:
return response.json()
return response.text
-
-
-def main():
- if len(sys.argv) == 1:
- CVETool(None, 'usage', sys.argv[2:])
-
- auth = None
- authpath = os.path.join(os.path.expanduser('~'), '.config', 'cvetool_auth')
- if 'CVETOOL_AUTH' in os.environ:
- auth = os.environ['CVETOOL_AUTH']
- elif os.path.isfile(authpath):
- with open(authpath, 'r') as authfile:
- auth = authfile.readlines()[0]
- elif 'CVETOOL_AUTH' not in os.environ and not sys.argv[1] == 'pw':
- print('CVETOOL_AUTH environment variable missing. Generate its contents with the pw subcommand.')
- sys.exit(1)
-
- CVETool(auth, sys.argv[1], sys.argv[2:])
-
-
-if __name__ == "__main__":
- try:
- main()
- except KeyboardInterrupt:
- print('\n ! Exiting.')
diff --git a/bin/cvetool b/bin/cvetool
new file mode 100755
index 0000000..7e30837
--- /dev/null
+++ b/bin/cvetool
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+# Copyright 2016 Alex Legler
+# Distributed under the terms of the GNU General Public License v3
+
+import os
+import re
+import sys
+
+from CVETool import CVETool
+
+def main():
+ if len(sys.argv) == 1:
+ CVETool(None, 'usage', sys.argv[2:])
+
+ auth = None
+ authpath = os.path.join(os.path.expanduser('~'), '.config', 'cvetool_auth')
+ if 'CVETOOL_AUTH' in os.environ:
+ auth = os.environ['CVETOOL_AUTH']
+ elif os.path.isfile(authpath):
+ with open(authpath, 'r') as authfile:
+ auth = authfile.readlines()[0]
+ elif 'CVETOOL_AUTH' not in os.environ and not sys.argv[1] == 'pw':
+ print('CVETOOL_AUTH environment variable missing. Generate its contents with the pw subcommand.')
+ sys.exit(1)
+
+ CVETool(auth, sys.argv[1], sys.argv[2:])
+
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ print('\n ! Exiting.')
next reply other threads:[~2021-07-05 20:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 20:24 John Helmert III [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-07-24 3:19 [gentoo-commits] proj/security:ajak-cvetool commit in: bin/ John Helmert III
2021-07-24 3:19 John Helmert III
2021-07-19 2:55 John Helmert III
2021-07-19 2:55 John Helmert III
2021-07-07 1:06 John Helmert III
2021-07-06 2:26 John Helmert III
2021-07-06 2:03 John Helmert III
2021-07-06 2:03 John Helmert III
2021-07-05 20:24 John Helmert III
2021-07-05 17:42 John Helmert III
2021-07-05 17:42 John Helmert III
2021-07-05 17:42 John Helmert III
2021-07-04 4:43 John Helmert III
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=1625510318.abe128db3bf0ede3f813de854ccee897941638f1.ajak@gentoo \
--to=ajak@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