A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/enthought/comtypes/commit/6fb440372bb03e3acece00b35cac87f2eddf7d69 below:

Merge pull request #211 from forderud/win-ce-rm · enthought/comtypes@6fb4403 · GitHub

File tree Expand file treeCollapse file tree 7 files changed

+13

-56

lines changed

Filter options

Expand file treeCollapse file tree 7 files changed

+13

-56

lines changed Original file line number Diff line number Diff line change

@@ -148,10 +148,7 @@ def CoInitialize():

148 148 149 149

def CoInitializeEx(flags=None):

150 150

if flags is None:

151 -

if os.name == "ce":

152 -

flags = getattr(sys, "coinit_flags", COINIT_MULTITHREADED)

153 -

else:

154 -

flags = getattr(sys, "coinit_flags", COINIT_APARTMENTTHREADED)

151 +

flags = getattr(sys, "coinit_flags", COINIT_APARTMENTTHREADED)

155 152

logger.debug("CoInitializeEx(None, %s)", flags)

156 153

_ole32.CoInitializeEx(None, flags)

157 154 Original file line number Diff line number Diff line change

@@ -275,12 +275,8 @@ class Vtbl(Structure):

275 275

################################################################

276 276 277 277

try:

278 -

if os.name == "ce":

279 -

_InterlockedIncrement = windll.coredll.InterlockedIncrement

280 -

_InterlockedDecrement = windll.coredll.InterlockedDecrement

281 -

else:

282 -

_InterlockedIncrement = windll.kernel32.InterlockedIncrement

283 -

_InterlockedDecrement = windll.kernel32.InterlockedDecrement

278 +

_InterlockedIncrement = windll.kernel32.InterlockedIncrement

279 +

_InterlockedDecrement = windll.kernel32.InterlockedDecrement

284 280

except AttributeError:

285 281

import threading

286 282

_lock = threading.Lock()

Original file line number Diff line number Diff line change

@@ -74,12 +74,8 @@ def _find_gen_dir():

74 74 75 75

################################################################

76 76 77 -

if os.name == "ce":

78 -

SHGetSpecialFolderPath = ctypes.OleDLL("coredll").SHGetSpecialFolderPath

79 -

GetModuleFileName = ctypes.WinDLL("coredll").GetModuleFileNameW

80 -

else:

81 -

SHGetSpecialFolderPath = ctypes.OleDLL("shell32.dll").SHGetSpecialFolderPathW

82 -

GetModuleFileName = ctypes.WinDLL("kernel32.dll").GetModuleFileNameW

77 +

SHGetSpecialFolderPath = ctypes.OleDLL("shell32.dll").SHGetSpecialFolderPathW

78 +

GetModuleFileName = ctypes.WinDLL("kernel32.dll").GetModuleFileNameW

83 79

SHGetSpecialFolderPath.argtypes = [ctypes.c_ulong, ctypes.c_wchar_p,

84 80

ctypes.c_int, ctypes.c_int]

85 81

GetModuleFileName.restype = ctypes.c_ulong

Original file line number Diff line number Diff line change

@@ -7,13 +7,7 @@

7 7

import logging

8 8

logger = logging.getLogger(__name__)

9 9 10 -

if os.name == "ce":

11 -

# Windows CE has a hard coded PATH

12 -

# XXX Additionally there's an OEM path, plus registry settings.

13 -

# We don't currently use the latter.

14 -

PATH = ["\\Windows", "\\"]

15 -

else:

16 -

PATH = os.environ["PATH"].split(os.pathsep)

10 +

PATH = os.environ["PATH"].split(os.pathsep)

17 11 18 12

def _my_import(fullname):

19 13

# helper function to import dotted modules

Original file line number Diff line number Diff line change

@@ -25,12 +25,6 @@ def test(self):

25 25

GUID("{0002DF01-0000-0000-C000-000000000046}"))

26 26

self.failUnlessEqual(GUID("{0002DF01-0000-0000-C000-000000000046}").as_progid(),

27 27

u'InternetExplorer.Application.1')

28 -

elif os.name == "ce":

29 -

self.failUnlessEqual(GUID.from_progid("JScript"),

30 -

GUID("{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}"))

31 -

self.failUnlessEqual(GUID("{f414c260-6ac0-11cf-b6d1-00aa00bbbb58}").as_progid(),

32 -

u'JScript')

33 - 34 28 35 29

self.failIfEqual(GUID.create_new(), GUID.create_new())

36 30 Original file line number Diff line number Diff line change

@@ -39,13 +39,8 @@ def tearDown(self):

39 39 40 40

def test_script(self):

41 41

# %APPDATA%\Python\Python25\comtypes_cache

42 -

if os.name == "ce":

43 -

ma, mi = sys.version_info[:2]

44 -

path = r"%s\Python\Python%d%d\comtypes_cache" % \

45 -

(_get_appdata_dir(), ma, mi)

46 -

else:

47 -

template = r"$APPDATA\Python\Python%d%d\comtypes_cache"

48 -

path = os.path.expandvars(template % sys.version_info[:2])

42 +

template = r"$APPDATA\Python\Python%d%d\comtypes_cache"

43 +

path = os.path.expandvars(template % sys.version_info[:2])

49 44

gen_dir = comtypes.client._find_gen_dir()

50 45

self.failUnlessEqual(path, gen_dir)

51 46 Original file line number Diff line number Diff line change

@@ -511,26 +511,11 @@ def CreateTypeLib(filename, syskind=SYS_WIN32):

511 511

_oleaut32.CreateTypeLib2(syskind, c_wchar_p(filename), byref(ctlib))

512 512

return ctlib

513 513 514 -

if os.name == "ce":

515 -

# See also:

516 -

# http://blogs.msdn.com/larryosterman/archive/2006/01/09/510856.aspx

517 -

#

518 -

# windows CE does not have QueryPathOfRegTypeLib. Emulate by reading the registry:

519 -

def QueryPathOfRegTypeLib(libid, wVerMajor, wVerMinor, lcid=0):

520 -

"Return the path of a registered type library"

521 -

import _winreg

522 -

try:

523 -

hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, r"Typelib\%s\%s.%s\%x\win32" % (libid, wVerMajor, wVerMinor, lcid))

524 -

except WindowsError:

525 -

# On CE, some typelib names are not in the ..\win32 subkey:

526 -

hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, r"Typelib\%s\%s.%s\%x" % (libid, wVerMajor, wVerMinor, lcid))

527 -

return _winreg.QueryValueEx(hkey, "")[0]

528 -

else:

529 -

def QueryPathOfRegTypeLib(libid, wVerMajor, wVerMinor, lcid=0):

530 -

"Return the path of a registered type library"

531 -

pathname = BSTR()

532 -

_oleaut32.QueryPathOfRegTypeLib(byref(GUID(libid)), wVerMajor, wVerMinor, lcid, byref(pathname))

533 -

return pathname.value.split("\0")[0]

514 +

def QueryPathOfRegTypeLib(libid, wVerMajor, wVerMinor, lcid=0):

515 +

"Return the path of a registered type library"

516 +

pathname = BSTR()

517 +

_oleaut32.QueryPathOfRegTypeLib(byref(GUID(libid)), wVerMajor, wVerMinor, lcid, byref(pathname))

518 +

return pathname.value.split("\0")[0]

534 519 535 520

################################################################

536 521

# Structures

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4