MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _run_sensing_script

Function _run_sensing_script

webapp_modern.py:1624–1641  ·  view source on GitHub ↗

Run an install/uninstall script in the background, logging to SENSING_INSTALL_LOG.

(script_path, arg=None)

Source from the content-addressed store, hash-verified

1622 def cross(o, a, b):
1623 return (a['x']-o['x'])*(b['y']-o['y']) - (a['y']-o['y'])*(b['x']-o['x'])
1624 lower = []
1625 for q in p:
1626 while len(lower) >= 2 and cross(lower[-2], lower[-1], q) <= 0:
1627 lower.pop()
1628 lower.append(q)
1629 upper = []
1630 for q in reversed(p):
1631 while len(upper) >= 2 and cross(upper[-2], upper[-1], q) <= 0:
1632 upper.pop()
1633 upper.append(q)
1634 return lower[:-1] + upper[:-1]
1635
1636
1637def _gf_point_in_polygon(pt, poly):
1638 if not poly or len(poly) < 3:
1639 return False
1640 inside = False
1641 j = len(poly) - 1
1642 for i in range(len(poly)):
1643 xi, yi = poly[i]['x'], poly[i]['y']
1644 xj, yj = poly[j]['x'], poly[j]['y']

Callers

nothing calls this directly

Calls 4

appendMethod · 0.80
errorMethod · 0.80
writeMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected