X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-afs.git/blobdiff_plain/7afe2ded9d39d80d43ce35af017d042c176f66cb..5a7fc7f433837c0fec1d26568d42710d1f1e9bd5:/afs/_pts.pyx diff --git a/afs/_pts.pyx b/afs/_pts.pyx index 83fa010..8a8937c 100644 --- a/afs/_pts.pyx +++ b/afs/_pts.pyx @@ -212,6 +212,17 @@ cdef class PTS: ubik_ClientDestroy(self.client) rx_Finalize() + def NameOrId(self, ident): + """ + Given an identifier, convert it to a PTS ID by looking up the + name if it's a string, or otherwise just converting it to an + integer. + """ + if isinstance(ident, (str, unicode)): + return self.NameToId(ident) + else: + return int(ident) + def NameToId(self, name): """ Converts a user or group to an AFS ID.