-
Notifications
You must be signed in to change notification settings - Fork 0
/
robin.py
50 lines (40 loc) · 1.21 KB
/
robin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import imp, string, sys, os.path, __builtin__
from griffin import uname, arch, soext, sopre, platspec, pyspec, vpath
def here(file):
import os
if file.endswith(".pyc") and os.path.isfile(file[:-1]):
file = file[:-1]
return os.path.dirname(os.path.realpath(file))
def locate(thisfile, target):
import os
libpath = [here(thisfile)] + sys.path
if libdir: libpath[:0] = [os.path.join(libdir, vpath)]
for ldir in libpath:
libfile = os.path.join(ldir, target)
if os.path.isfile(libfile):
return libfile
else:
raise ImportError, "%s could not be found" % target
libdir = None
ver = "1.0"
target = "%(sopre)srobin_pyfe%(platspec)s-%(ver)s%(pyspec)s%(soext)s" % vars()
libfile = locate(__file__, target)
__pyfile__ = __file__
imp.load_dynamic(__name__, libfile)
__file__ = __pyfile__
__builtin__.double = double
__builtin__.char = char
__builtin__.longlong = longlong
__builtin__.ulong = ulong
__builtin__.uint = uint
__builtin__.uchar = uchar
__builtin__.ulonglong = ulonglong
__builtin__.schar = schar
ldinfo = { 'm': arch, 'so': soext, \
'suffix': "", 'confdir': "." }
def implement(tp):
import warnings
warnings.warn("robin.implement is deprecated")
return tp
# Cleanup
del imp, os, target, __builtin__