[ctypes-commit] ctypes/ctypes _loader.py,1.1.2.6,1.1.2.7
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-01-26 07:14:30
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8156 Modified Files: Tag: branch_1_0 _loader.py Log Message: Remove register_library_alias. It doesn't belong here. IMO. Index: _loader.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/Attic/_loader.py,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** _loader.py 25 Jan 2006 21:19:44 -0000 1.1.2.6 --- _loader.py 26 Jan 2006 07:14:21 -0000 1.1.2.7 *************** *** 2,8 **** import sys, os import ctypes - from itertools import chain ! __all__ = ["register_library_alias", "LibraryLoader"] if os.name in ("nt", "ce"): --- 2,7 ---- import sys, os import ctypes ! __all__ = ["LibraryLoader", "RTLD_LOCAL", "RTLD_GLOBAL"] if os.name in ("nt", "ce"): *************** *** 12,38 **** from _ctypes import dlopen, RTLD_LOCAL, RTLD_GLOBAL - def register_library_alias(alias, libname, osname, platform=None): - """XXX document me""" - global _library_map - if osname is not None and osname != os.name: - return - if platform is not None and platform != sys.platform: - return - _library_map[alias] = libname - - _library_map = {} - - # XXX Find a better way to determine whether "msvcrt" or "msvcr71" - # should be used - if sys.version_info < (2, 4): - register_library_alias("c", "msvcrt", "nt") - register_library_alias("m", "msvcrt", "nt") - else: - register_library_alias("c", "msvcr71", "nt") - register_library_alias("m", "msvcr71", "nt") - - register_library_alias("c", "coredll", "ce") - register_library_alias("m", "coredll", "ce") - # _findLib(name) returns an iterable of possible names for a library. if os.name in ("nt", "ce"): --- 11,14 ---- *************** *** 193,197 **** .load_version() instead. """ ! for libname in chain(_findLib(name), [_library_map.get(name)]): try: return self.load(libname, mode) --- 169,173 ---- .load_version() instead. """ ! for libname in _findLib(name): try: return self.load(libname, mode) *************** *** 230,256 **** print cdll.load_version("crypto", "0.9.7") ! ! ## print cdll.m ! ## print cdll.find("m") ! ! ## if os.name == "nt": ! ## print cdll.load("user32") ! ## print cdll.user32 ! ## print cdll.find("user32") ! ## # does this make sense? not really... ! ## print cdll.load_version("msvcr", "71") ! ## print cdll.load_version("msvcr", "t") ! ## elif (os.name, sys.platform) == ("posix", "darwin"): ! ## print cdll.find("AGL") ! ## print cdll.find("OpenGL") ! ## print cdll.find("GLUT") ! ## elif os.name == "posix": ! ## print cdll.load("libc.so.6") ! ## print cdll.load("libGL.so", RTLD_GLOBAL) ! ## print cdll.load_version("m", "6") ! ## print cdll.m ! ## print cdll.png ! ## print cdll._a_b_c_ ! ## print cdll.xyz --- 206,223 ---- print cdll.load_version("crypto", "0.9.7") ! if os.name == "posix" and sys.platform == "darwin": ! print cdll.load("libm.dylib") ! print cdll.load("libcrypt.dylib") ! else: ! print cdll.load("libm.so") ! print cdll.load("libcrypt.so") ! if os.name == "nt": ! ## load(filename) ! print cdll.load("msvcrt") ! print cdll.find("m") ! print cdll.load_version("msvcr", "71") ! ! ## load_version(name, version) ! ## find(name) |