aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerry Chia <terrycwk1994@gmail.com>2015-06-19 15:45:39 +0800
committerTerry Chia <terrycwk1994@gmail.com>2015-06-19 15:45:39 +0800
commit52c416b2ea6a6b99e543476df663566c86433762 (patch)
tree224d809f3ffe5a7e74e6fe08996f9dc7351a5487
parent9e1103e878218cca79ccd7e037f5becc5b159db2 (diff)
downloadcryptography-52c416b2ea6a6b99e543476df663566c86433762.tar.gz
cryptography-52c416b2ea6a6b99e543476df663566c86433762.tar.bz2
cryptography-52c416b2ea6a6b99e543476df663566c86433762.zip
Change ' to ".
-rw-r--r--src/cryptography/hazmat/primitives/twofactor/hotp.py4
-rw-r--r--src/cryptography/hazmat/primitives/twofactor/totp.py4
-rw-r--r--src/cryptography/hazmat/primitives/twofactor/utils.py16
3 files changed, 12 insertions, 12 deletions
diff --git a/src/cryptography/hazmat/primitives/twofactor/hotp.py b/src/cryptography/hazmat/primitives/twofactor/hotp.py
index 8c0cec14..12bc7661 100644
--- a/src/cryptography/hazmat/primitives/twofactor/hotp.py
+++ b/src/cryptography/hazmat/primitives/twofactor/hotp.py
@@ -62,6 +62,6 @@ class HOTP(object):
return struct.unpack(">I", p)[0] & 0x7fffffff
def get_provisioning_uri(self, account_name, counter, issuer):
- return _generate_uri(self, 'hotp', account_name, issuer, [
- ('counter', int(counter)),
+ return _generate_uri(self, "hotp", account_name, issuer, [
+ ("counter", int(counter)),
])
diff --git a/src/cryptography/hazmat/primitives/twofactor/totp.py b/src/cryptography/hazmat/primitives/twofactor/totp.py
index 98493b6d..60705901 100644
--- a/src/cryptography/hazmat/primitives/twofactor/totp.py
+++ b/src/cryptography/hazmat/primitives/twofactor/totp.py
@@ -34,6 +34,6 @@ class TOTP(object):
raise InvalidToken("Supplied TOTP value does not match.")
def get_provisioning_uri(self, account_name, issuer):
- return _generate_uri(self._hotp, 'totp', account_name, issuer, [
- ('period', int(self._time_step)),
+ return _generate_uri(self._hotp, "totp", account_name, issuer, [
+ ("period", int(self._time_step)),
])
diff --git a/src/cryptography/hazmat/primitives/twofactor/utils.py b/src/cryptography/hazmat/primitives/twofactor/utils.py
index 91d2e148..0ed8c4c8 100644
--- a/src/cryptography/hazmat/primitives/twofactor/utils.py
+++ b/src/cryptography/hazmat/primitives/twofactor/utils.py
@@ -11,20 +11,20 @@ from six.moves.urllib.parse import quote, urlencode
def _generate_uri(hotp, type_name, account_name, issuer, extra_parameters):
parameters = [
- ('digits', hotp._length),
- ('secret', base64.b32encode(hotp._key)),
- ('algorithm', hotp._algorithm.name.upper()),
+ ("digits", hotp._length),
+ ("secret", base64.b32encode(hotp._key)),
+ ("algorithm", hotp._algorithm.name.upper()),
]
if issuer is not None:
- parameters.append(('issuer', issuer))
+ parameters.append(("issuer", issuer))
parameters.extend(extra_parameters)
uriparts = {
- 'type': type_name,
- 'label': ('%s:%s' % (quote(issuer), quote(account_name)) if issuer
+ "type": type_name,
+ "label": ("%s:%s" % (quote(issuer), quote(account_name)) if issuer
else quote(account_name)),
- 'parameters': urlencode(parameters),
+ "parameters": urlencode(parameters),
}
- return 'otpauth://{type}/{label}?{parameters}'.format(**uriparts)
+ return "otpauth://{type}/{label}?{parameters}".format(**uriparts)