Skip to content

Commit 22a319d

Browse files
committed
Factor out constants for pywin32 submodule
1 parent bd3429a commit 22a319d

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

win32ctypes/pywin32/_constants.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# (C) Copyright 2014 Enthought, Inc., Austin, TX
3+
# All right reserved.
4+
#
5+
# This file is open source software distributed according to the terms in
6+
# LICENSE.txt
7+
#
8+
9+
# Credential related constants
10+
CRED_TYPE_GENERIC = 0x1
11+
CRED_PERSIST_SESSION = 0x1
12+
CRED_PERSIST_LOCAL_MACHINE = 0x2
13+
CRED_PERSIST_ENTERPRISE = 0x3
14+
CRED_PRESERVE_CREDENTIAL_BLOB = 0
15+
CRED_ENUMERATE_ALL_CREDENTIALS = 0x1
16+
17+
# Library related constants
18+
LOAD_LIBRARY_AS_DATAFILE = 0x2
19+
LANG_NEUTRAL = 0x00

win32ctypes/pywin32/win32api.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
""" A module, encapsulating the Windows Win32 API. """
99
from win32ctypes.core import (
1010
_common, _dll, _resource, _system_information, _backend, _time)
11-
from win32ctypes.pywin32.pywintypes import pywin32error as _pywin32error
12-
13-
LOAD_LIBRARY_AS_DATAFILE = 0x2
14-
LANG_NEUTRAL = 0x00
11+
from .pywintypes import pywin32error as _pywin32error
12+
from ._constants import LOAD_LIBRARY_AS_DATAFILE, LANG_NEUTRAL
1513

1614

1715
def LoadLibraryEx(fileName, handle, flags):

win32ctypes/pywin32/win32cred.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
#
88
""" Interface to credentials management functions. """
99
from win32ctypes.core import _authentication, _common, _backend
10-
from win32ctypes.pywin32.pywintypes import pywin32error as _pywin32error
11-
12-
CRED_TYPE_GENERIC = 0x1
13-
CRED_PERSIST_SESSION = 0x1
14-
CRED_PERSIST_LOCAL_MACHINE = 0x2
15-
CRED_PERSIST_ENTERPRISE = 0x3
16-
CRED_PRESERVE_CREDENTIAL_BLOB = 0
17-
CRED_ENUMERATE_ALL_CREDENTIALS = 0x1
10+
from .pywintypes import pywin32error as _pywin32error
11+
from ._constants import (
12+
CRED_TYPE_GENERIC,
13+
CRED_PERSIST_SESSION,
14+
CRED_PERSIST_LOCAL_MACHINE,
15+
CRED_PERSIST_ENTERPRISE,
16+
CRED_ENUMERATE_ALL_CREDENTIALS,
17+
CRED_PRESERVE_CREDENTIAL_BLOB)
1818

1919

2020
def CredWrite(Credential, Flags=CRED_PRESERVE_CREDENTIAL_BLOB):

0 commit comments

Comments
 (0)