Skip to content

Commit a9fdb43

Browse files
committed
Move constants to a top level module
1 parent 22a319d commit a9fdb43

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

win32ctypes/pywin32/_constants.py renamed to win32ctypes/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
CRED_PERSIST_SESSION = 0x1
1212
CRED_PERSIST_LOCAL_MACHINE = 0x2
1313
CRED_PERSIST_ENTERPRISE = 0x3
14-
CRED_PRESERVE_CREDENTIAL_BLOB = 0
1514
CRED_ENUMERATE_ALL_CREDENTIALS = 0x1
15+
CRED_PRESERVE_CREDENTIAL_BLOB = 0x1
1616

1717
# Library related constants
1818
LOAD_LIBRARY_AS_DATAFILE = 0x2

win32ctypes/pywin32/win32cred.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
88
""" Interface to credentials management functions. """
99
from win32ctypes.core import _authentication, _common, _backend
1010
from .pywintypes import pywin32error as _pywin32error
11-
from ._constants import (
11+
12+
# Bring constants into namespace
13+
from win32ctypes.constants import (
1214
CRED_TYPE_GENERIC,
1315
CRED_PERSIST_SESSION,
1416
CRED_PERSIST_LOCAL_MACHINE,
1517
CRED_PERSIST_ENTERPRISE,
1618
CRED_ENUMERATE_ALL_CREDENTIALS,
17-
CRED_PRESERVE_CREDENTIAL_BLOB)
19+
CRED_PERSIST_ENTERPRISE) # noqa
1820

1921

20-
def CredWrite(Credential, Flags=CRED_PRESERVE_CREDENTIAL_BLOB):
22+
def CredWrite(Credential, Flags=0):
2123
""" Creates or updates a stored credential.
2224
2325
Parameters
@@ -26,7 +28,7 @@ def CredWrite(Credential, Flags=CRED_PRESERVE_CREDENTIAL_BLOB):
2628
A dictionary corresponding to the PyWin32 ``PyCREDENTIAL``
2729
structure.
2830
Flags : int
29-
Always pass ``CRED_PRESERVE_CREDENTIAL_BLOB`` (i.e. 0).
31+
``CRED_PRESERVE_CREDENTIAL_BLOB`` or 0. Default is 0.
3032
3133
"""
3234
c_creds = _authentication.CREDENTIAL.fromdict(Credential, Flags)

0 commit comments

Comments
 (0)