MCPcopy Create free account
hub / github.com/bgrimstad/splinter / load

Function load

python/splinter/splinter.py:18–41  ·  view source on GitHub ↗
(lib_file = None)

Source from the content-addressed store, hash-verified

16# Try to load the library libFile
17# If libFile is not specified, we try to locate and load SPLINTER
18def load(lib_file = None):
19 global __handle
20 if __handle is not None:
21 out("SPLINTER is already loaded!")
22 out("If you wish to unload it you must first call unload.")
23 else:
24 if lib_file is None:
25 lib_file = __locate_splinter()
26 if lib_file is None:
27 raise Exception("Unable to automatically locate SPLINTER.\nYou can load it manually by doing splinter.load(\"/path/to/SPLINTER.so\")")
28
29 try:
30 __handle = cdll.LoadLibrary(lib_file)
31 __init()
32 out("Loaded SPLINTER from " + str(lib_file) + "!")
33
34 except Exception as e:
35 out("Error:")
36 out("Either you are trying to load a library with another architecture (32 bit/64 bit) than the Python you are using, ", True)
37 out("or the file you are trying to load (" + lib_file + ") could not be found.")
38 out("For reference your Python is " + str(8*sizeof(c_void_p)) + "bit.")
39 out("Here is the error message:")
40 out(e)
41 __handle = None
42
43
44def is_loaded():

Callers 3

__init__.pyFile · 0.85
BSplineMethod · 0.85
DataTableMethod · 0.85

Calls 4

outFunction · 0.85
__locate_splinterFunction · 0.85
ExceptionClass · 0.85
__initFunction · 0.85

Tested by

no test coverage detected