Skip to content

Commit 1ffa03f

Browse files
committed
GPG: remove minisix usage
1 parent 6a2fdc9 commit 1ffa03f

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

plugins/GPG/plugin.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,11 @@
3939
import supybot.utils as utils
4040
import supybot.ircdb as ircdb
4141
from supybot.commands import *
42-
import supybot.utils.minisix as minisix
4342
import supybot.plugins as plugins
4443
import supybot.commands as commands
4544
import supybot.ircutils as ircutils
4645
import supybot.callbacks as callbacks
47-
if minisix.PY3:
48-
import http.client as http_client
49-
else:
50-
import httplib as http_client
46+
import http.client as http_client
5147
try:
5248
from supybot.i18n import PluginInternationalization
5349
_ = PluginInternationalization('GPG')
@@ -212,7 +208,7 @@ def gettoken(self, irc, msg, args):
212208
r'-----BEGIN PGP SIGNATURE-----\r?\n.*'
213209
r'\r?\n-----END PGP SIGNATURE-----',
214210
re.S)
215-
211+
216212
@check_gpg_available
217213
def auth(self, irc, msg, args, url):
218214
"""<url>
@@ -221,7 +217,7 @@ def auth(self, irc, msg, args, url):
221217
the key used is associated to a user."""
222218
self._expire_tokens()
223219
content = safe_getUrl(url)
224-
if minisix.PY3 and isinstance(content, bytes):
220+
if isinstance(content, bytes):
225221
content = content.decode()
226222
match = self._auth_re.search(content)
227223
if not match:

plugins/GPG/test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
# POSSIBILITY OF SUCH DAMAGE.
2828

2929
###
30+
import io
3031

3132
from supybot.test import *
32-
import supybot.utils.minisix as minisix
3333

3434
import supybot.gpg as gpg
3535

@@ -111,25 +111,25 @@ def fakeGetUrlFd(*args, **kwargs):
111111
return fd
112112
(utils.web.getUrlFd, realGetUrlFd) = (fakeGetUrlFd, utils.web.getUrlFd)
113113

114-
fd = minisix.io.StringIO()
114+
fd = io.StringIO()
115115
fd.write('foo')
116116
fd.seek(0)
117117
self.assertResponse('gpg signing auth http://foo.bar/baz.gpg',
118118
'Error: Signature or token not found.')
119119

120-
fd = minisix.io.StringIO()
120+
fd = io.StringIO()
121121
fd.write(token)
122122
fd.seek(0)
123123
self.assertResponse('gpg signing auth http://foo.bar/baz.gpg',
124124
'Error: Signature or token not found.')
125125

126-
fd = minisix.io.StringIO()
126+
fd = io.StringIO()
127127
fd.write(WRONG_TOKEN_SIGNATURE)
128128
fd.seek(0)
129129
self.assertRegexp('gpg signing auth http://foo.bar/baz.gpg',
130130
'Error: Unknown token.*')
131131

132-
fd = minisix.io.StringIO()
132+
fd = io.StringIO()
133133
fd.write(str(gpg.keyring.sign(token)))
134134
fd.seek(0)
135135
self.assertResponse('gpg signing auth http://foo.bar/baz.gpg',

0 commit comments

Comments
 (0)