Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
autopep8.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrusdaboo committed Aug 26, 2016
1 parent 7e435b2 commit e8c1adf
Show file tree
Hide file tree
Showing 614 changed files with 3,318 additions and 13,825 deletions.
24 changes: 10 additions & 14 deletions bin/keychain_init.py
Expand Up @@ -28,6 +28,7 @@
identity_file = "./twistedcaldav/test/data/server.pem"
certificate_file = "./twistedcaldav/test/data/cert.pem"


def identityExists():
child = Popen(
args=[
Expand All @@ -51,7 +52,6 @@ def identityExists():
return True



def identityCreate():
child = Popen(
args=[
Expand All @@ -70,7 +70,6 @@ def identityCreate():
return True



def certificateExists():
child = Popen(
args=[
Expand All @@ -90,7 +89,6 @@ def certificateExists():
return True



def certificateImport(importFile):
child = Popen(
args=[
Expand All @@ -110,7 +108,6 @@ def certificateImport(importFile):
return True



def certificateTrust():
child = Popen(
args=[
Expand All @@ -130,20 +127,19 @@ def certificateTrust():
return True



def checkCertificate():

# Validate identity
error = OpenSSL.crypto.check_keychain_identity(identity_preference, allowInteraction=True)
if error:
raise RuntimeError(
"The configured TLS Keychain Identity ({cert}) cannot be used: {reason}".format(
cert=identity_preference,
reason=error
)
error = OpenSSL.crypto.check_keychain_identity(identity_preference, allowInteraction=True)
if error:
raise RuntimeError(
"The configured TLS Keychain Identity ({cert}) cannot be used: {reason}".format(
cert=identity_preference,
reason=error
)
else:
print("Certificate/key can be used.")
)
else:
print("Certificate/key can be used.")


if __name__ == '__main__':
Expand Down
3 changes: 1 addition & 2 deletions bin/keychain_unlock.py
Expand Up @@ -21,6 +21,7 @@

password_file = os.path.expanduser("~/.keychain")


def isKeychainUnlocked():

child = Popen(
Expand All @@ -39,7 +40,6 @@ def isKeychainUnlocked():
return True



def unlockKeychain():

if not os.path.isfile(password_file):
Expand All @@ -65,7 +65,6 @@ def unlockKeychain():
return True



if __name__ == '__main__':

if os.path.isfile("/usr/bin/security"):
Expand Down

0 comments on commit e8c1adf

Please sign in to comment.