Skip to content

Commit 01eca6b

Browse files
committed
Document low-level utilities
This commit documents lowl-level utilities and miscellanious classes. Part of #9
1 parent 7737a57 commit 01eca6b

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

gssapi/raw/cython_converters.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from gssapi.raw.types import MechType, NameType
55

66

77
cdef OID c_make_oid(gss_OID oid):
8+
"""Create an OID from a C OID struct pointer"""
89
cdef OID res = OID()
910
res.raw_oid = oid[0]
1011
return res

gssapi/raw/exceptions.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ from gssapi.raw.cython_types cimport OM_uint32
22

33
from gssapi.raw.misc import GSSError
44

5+
"""Specific exceptions for GSSAPI errors"""
6+
57

68
cdef extern from "gssapi.h":
79
# calling errors

gssapi/raw/mech_krb5.pyx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ from gssapi.raw.cython_converters cimport c_make_oid
55

66
from gssapi.raw import types as gsstypes
77

8+
"""Kerberos-specific constants
9+
10+
Upon import, this module will populate
11+
Kerberos-specific constants into NameType
12+
and MechType.
13+
"""
14+
815

916
cdef extern from "gssapi/gssapi_krb5.h":
1017
gss_OID gss_mech_krb5

gssapi/raw/types.pyx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ class MechType(object):
108108

109109

110110
class GenericFlagSet(collections.MutableSet):
111+
"""A set backed by a 32-bit integer
112+
113+
This is a set backed by a 32 bit integer.
114+
the members are integers where only one
115+
bit is set.
116+
117+
The class supports normal set operations,
118+
as well as traditional "flag set" operations,
119+
such as bitwise AND, OR, and XOR.
120+
"""
121+
111122
__slots__ = '_val'
112123
MAX_VAL = 1 << 31
113124

@@ -201,6 +212,15 @@ class GenericFlagSet(collections.MutableSet):
201212

202213

203214
class IntEnumFlagSet(GenericFlagSet):
215+
"""A set backed by a 32-bit integer with enum members
216+
217+
This class is a :class:`GenericFlagSet` where the returned
218+
members are values in an :class:`IntEnum`.
219+
220+
It functions exactly like a `GenericFlagSet`, except that
221+
it also supports bitwise operations with the enum values.
222+
"""
223+
204224
__slots__ = ('_val', '_enum')
205225

206226
def __init__(self, enum, flags=None):

0 commit comments

Comments
 (0)