Changeset 180
- Timestamp:
- 11/16/09 11:10:55 (9 months ago)
- Files:
-
- pykcs11/trunk/samples/getinfo.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pykcs11/trunk/samples/getinfo.py
r173 r180 27 27 print self.magenta + text + self.blue, arg, self.normal 28 28 29 def __init__(self, lib =None):29 def __init__(self, lib=None): 30 30 if sys.stdout.isatty() and platform.system().lower() != 'windows': 31 31 self.red = "\x1b[01;31m" … … 83 83 def getInfo(self): 84 84 info = self.pkcs11.getInfo() 85 self.colorize("Library Cryptoki Version:", "%d.%d" % info.cryptokiVersion) 85 self.colorize("Library Cryptoki Version:", 86 "%d.%d" % info.cryptokiVersion) 86 87 self.colorize("Library manufacturerID:", info.manufacturerID) 87 88 self.colorize("Library flags:", info.flags) … … 89 90 self.colorize("Library Version:", "%d.%d" % info.libraryVersion) 90 91 91 def getSessionInfo(self, slot, pin =None):92 def getSessionInfo(self, slot, pin=None): 92 93 session = self.pkcs11.openSession(slot) 93 94 s = session.getSessionInfo() … … 118 119 119 120 try: 120 opts, args = getopt.getopt(sys.argv[1:], "p:s:c:ho", ["pin=", "slot=", "lib=", "help", "opensession"]) 121 opts, args = getopt.getopt(sys.argv[1:], "p:s:c:ho", 122 ["pin=", "slot=", "lib=", "help", "opensession"]) 121 123 except getopt.GetoptError: 122 124 # print help information and exit: … … 154 156 155 157 if slot: 156 slots = [ slots[slot]]158 slots = [slots[slot]] 157 159 158 160 for slot in slots: … … 164 166 except PyKCS11.PyKCS11Error, e: 165 167 print "Error:", e 166
