MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / detect_java_comm

Function detect_java_comm

src/ext/makerbot_pyserial/serialjava.py:20–29  ·  view source on GitHub ↗

try given list of modules and return that imports

(names)

Source from the content-addressed store, hash-verified

18
19
20def detect_java_comm(names):
21 """try given list of modules and return that imports"""
22 for name in names:
23 try:
24 mod = my_import(name)
25 mod.SerialPort
26 return mod
27 except (ImportError, AttributeError):
28 pass
29 raise ImportError("No Java Communications API implementation found")
30
31
32# Java Communications API implementations

Callers 1

serialjava.pyFile · 0.85

Calls 1

my_importFunction · 0.85

Tested by

no test coverage detected