Skip to content

Commit 53c33b5

Browse files
committed
Factor out constants for pywin32 submodule
1 parent 80b0661 commit 53c33b5

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

win32ctypes/pywin32/_constants.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
16+
# Library related constants
17+
LOAD_LIBRARY_AS_DATAFILE = 0x2
18+
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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
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
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_PRESERVE_CREDENTIAL_BLOB)
1717

1818

1919
def CredWrite(Credential, Flags=CRED_PRESERVE_CREDENTIAL_BLOB):

0 commit comments

Comments
 (0)