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

Function safe_bool

webapp_modern.py:3829–3847  ·  view source on GitHub ↗

Safely convert value to boolean, supporting common string inputs.

(value, default=False)

Source from the content-addressed store, hash-verified

3827 'installing': installing, 'arch': arch, 'has_prebuilt': has_prebuilt,
3828 })
3829
3830
3831@app.route('/api/sensing/install', methods=['POST'])
3832def sensing_install():
3833 """Install (or rebuild) the bundled sensing backend in the background."""
3834 global _sensing_installing
3835 with _sensing_install_lock:
3836 if _sensing_installing:
3837 return jsonify({'success': True, 'message': 'Install already in progress', 'installing': True})
3838 _sensing_installing = True
3839 rebuild = bool((request.get_json(silent=True) or {}).get('rebuild'))
3840 open(SENSING_INSTALL_LOG, 'w').close() # fresh log per run
3841 threading.Thread(target=_run_sensing_script,
3842 args=(SENSING_INSTALL_SCRIPT, '--rebuild' if rebuild else None),
3843 daemon=True, name='sensing-install').start()
3844 return jsonify({'success': True, 'message': 'Sensing backend install started', 'installing': True})
3845
3846
3847@app.route('/api/sensing/uninstall', methods=['POST'])
3848def sensing_uninstall():
3849 """Stop and remove the bundled sensing backend."""
3850 threading.Thread(target=_run_sensing_script, args=(SENSING_UNINSTALL_SCRIPT,),

Callers 5

get_system_headlessFunction · 0.85
get_statusFunction · 0.85
get_current_statusFunction · 0.85
get_dashboard_quickFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected