Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(26)  |  Call(20)  |  Derive(0)  |  Import(6)

src/p/y/pymacadmin-HEAD/bin/airport-update.py   pymacadmin(Download)
import sys
import os
from PyMacAdmin.Security.Keychain import Keychain
 
 
 
    if os.getuid() == 0:
        keychain = Keychain("/Library/Keychains/System.keychain")
    else:
        keychain = Keychain()

src/p/y/PyMacAdmin-1.0/bin/airport-update.py   PyMacAdmin(Download)
import sys
import os
from PyMacAdmin.Security.Keychain import Keychain
 
 
 
    if os.getuid() == 0:
        keychain = Keychain("/Library/Keychains/System.keychain")
    else:
        keychain = Keychain()

src/p/y/pymacadmin-HEAD/bin/keychain-delete.py   pymacadmin(Download)
"""
 
from PyMacAdmin.Security.Keychain import Keychain
import os
import sys
 
    try:
        keychain = Keychain(options.keychain)
        item = keychain.find_generic_password(
            service_name=options.service,

src/p/y/PyMacAdmin-1.0/bin/keychain-delete.py   PyMacAdmin(Download)
"""
 
from PyMacAdmin.Security.Keychain import Keychain
import os
import sys
 
    try:
        keychain = Keychain(options.keychain)
        item = keychain.find_generic_password(
            service_name=options.service,

src/p/y/pymacadmin-HEAD/lib/PyMacAdmin/Security/tests/test_Keychain.py   pymacadmin(Download)
import sys
import unittest
from PyMacAdmin.Security.Keychain import Keychain, GenericPassword, InternetPassword
 
class KeychainTests(unittest.TestCase):
    def test_load_default_keychain(self):
        k = Keychain()
        self.failIfEqual(k, None)
 
    def test_load_system_keychain(self):
        k = Keychain('/Library/Keychains/System.keychain')
        self.failIfEqual(k, None)
 
    def test_find_airport_password(self):
        system_keychain = Keychain("/Library/Keychains/System.keychain")
    def test_find_nonexistent_generic_password(self):
        import uuid
        system_keychain = Keychain("/Library/Keychains/System.keychain")
        self.assertRaises(KeyError, system_keychain.find_generic_password, **{ 'account_name': "NonExistantGenericPassword-%s" % uuid.uuid4() })
 

src/l/u/LuggagePackages-HEAD/CrankdInstaller/PyMacAdmin/Security/tests/test_Keychain.py   LuggagePackages(Download)
import sys
import unittest
from PyMacAdmin.Security.Keychain import Keychain, GenericPassword, InternetPassword
 
class KeychainTests(unittest.TestCase):
    def test_load_default_keychain(self):
        k = Keychain()
        self.failIfEqual(k, None)
 
    def test_load_system_keychain(self):
        k = Keychain('/Library/Keychains/System.keychain')
        self.failIfEqual(k, None)
 
    def test_find_airport_password(self):
        system_keychain = Keychain("/Library/Keychains/System.keychain")
    def test_find_nonexistent_generic_password(self):
        import uuid
        system_keychain = Keychain("/Library/Keychains/System.keychain")
        self.assertRaises(KeyError, system_keychain.find_generic_password, **{ 'account_name': "NonExistantGenericPassword-%s" % uuid.uuid4() })