Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ecreall/master
Port to Python 3
- Loading branch information
Showing
20 changed files
with
227 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,4 @@ local/ | |
# Test data | ||
datakey.dat | ||
kek.dat | ||
sample.cert | ||
sample.key | ||
source-cache.log | ||
source-cache.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
language: python | ||
python: | ||
- 2.7 | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
install: | ||
- python bootstrap.py | ||
- bin/buildout | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/bin/sh | ||
openssl genrsa 1024 > sample.key | ||
openssl req -new -x509 -nodes -sha1 -days 3650 -key sample.key > sample.cert | ||
cat sample.cert sample.key > sample.pem | ||
rm sample.key sample.cert | ||
|
||
openssl req -new -x509 -nodes -sha256 -days 3650 -key sample.key > sample.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIICXQIBAAKBgQDK17rB/KVaK8MVjiEkvA4ZncOOIC3nStZ/erXM+qwkghPM4Tfr | ||
2FTUiTgwwdLdu/ht74oWnppttfaTQ+sVz2rFXnPgfqKTGoJTwWFiuNuZhSRDVssG | ||
VnL/RatZW6wns8UNf+W4hUe6/vGQP6obNTe2T4R+t2hXP51OkOy4BMcq0QIDAQAB | ||
AoGAHcDJDx1M784NfoLrj6TZ+J3wik9kDFIo5mgMdLWsPGqsFthOSJTh1I8QI+66 | ||
THX++bkyKyE2i7MuKOnEeN2Ezo2jAThF7XoWhm6/+pSXhSqmL1jKr/1CZRaR9jv0 | ||
cCVJc3mTuAGH+yFVeGpWNvDaCmOUlD5M48xTROJXteDQ0TECQQDuDM9pmQdqkGIp | ||
dvbIviS8donYn0kJ0TKS14pMtb/C63lcld513rHS43ru3FRY9baR/q5vV9vW5RhH | ||
S7w4cYvVAkEA2iNLsFEAkY88oZJYbdyybeKxZdReyes1/zPe4RYzRdbDHRNAa+zk | ||
mZIZDI820E0Y+DeoT+q3nXkXiiOS/iRNDQJBAKdAvOH2sO1AcJetjArS/cCkkIlw | ||
sMKDB0OAyRzIfekXxPc2HU03oD0Jsy/sAh9W1GWTST/VvRIpeHtvTNljfdkCQF5T | ||
UuBcNoW6zXoEYU6oV1Oi6hjhW1eu6PuAv4jPY754XoiNEZdZqYQqo8BFkWtDW1/C | ||
GXrtQRbMDPzD40UYB2UCQQCmJpJp+u2lHj7zuZikHIHQBNyXyoGnzgNs6XUj1Bs6 | ||
Y4vjue8w6RkRLZ1YGP+xqsngVqb9IRygyLDpEgwEnOT4 | ||
-----END RSA PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
############################################################################## | ||
# | ||
# Copyright (c) 2013 Zope Foundation and Contributors. | ||
# All Rights Reserved. | ||
# | ||
# This software is subject to the provisions of the Zope Public License, | ||
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | ||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | ||
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | ||
# FOR A PARTICULAR PURPOSE | ||
# | ||
############################################################################## | ||
import sys | ||
from six import PY3 | ||
|
||
# This code was copied from ZODB/_compat.py | ||
|
||
if not PY3: | ||
# Python 2.x | ||
# PyPy's cPickle doesn't have noload, and noload is broken in Python 2.7, | ||
# so we need zodbpickle. | ||
# Get the fastest working version we can (PyPy has no fastpickle) | ||
try: | ||
import zodbpickle.fastpickle as cPickle | ||
except ImportError: | ||
import zodbpickle.pickle as cPickle | ||
Pickler = cPickle.Pickler | ||
Unpickler = cPickle.Unpickler | ||
else: | ||
# Python 3.x: can't use stdlib's pickle because | ||
# http://bugs.python.org/issue6784 | ||
import zodbpickle.pickle | ||
|
||
class Pickler(zodbpickle.pickle.Pickler): | ||
def __init__(self, f, protocol=None): | ||
super(Pickler, self).__init__(f, protocol) | ||
|
||
class Unpickler(zodbpickle.pickle.Unpickler): | ||
def __init__(self, f): | ||
super(Unpickler, self).__init__(f) | ||
|
||
# Py3: Python 3 doesn't allow assignments to find_global, | ||
# instead, find_class can be overridden | ||
|
||
find_global = None | ||
|
||
def find_class(self, modulename, name): | ||
if self.find_global is None: | ||
return super(Unpickler, self).find_class(modulename, name) | ||
return self.find_global(modulename, name) | ||
|
||
|
||
try: | ||
# XXX: why not just import BytesIO from io? | ||
from cStringIO import StringIO as BytesIO | ||
except ImportError: | ||
# Python 3.x | ||
from io import BytesIO |
Oops, something went wrong.