<commit_before># coding=utf-8
from __future__ import absolute_import

__author__ = "BEEVC - Electronic Systems "
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"

from octoprint.server.util.wifi_util import get_ssid_list, switch_wifi_client_mode
from octoprint.server.util.hostname_util import is_valid_hostname, update_hostname
from octoprint.server.api import api
from octoprint.server import printer, NO_CONTENT
from flask import Blueprint, jsonify, request, make_response


#~~ BVC custom API
api = Blueprint("beeapi", __name__)

@api.route("/printer", methods=["GET"])
def getConnectedPrinter():

	if printer is not None:
		printer_name = printer.get_printer_name()
	else:
		printer_name = ''

	return jsonify({
		"printer": printer_name
	})

@api.route("/wifi/list", methods=["GET"])
def getAvailableHotspots():

	networks = get_ssid_list('wlan0', '/Users/dpacheco/Desktop/wlist_scan.txt')

	return jsonify({
		"wifi_networks": networks
	})

<commit_msg>BEEWEB-30 hostname configuration<commit_after># coding=utf-8
from __future__ import absolute_import

__author__ = "BEEVC - Electronic Systems "
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"

from octoprint.server.util.wifi_util import get_ssid_list, switch_wifi_client_mode
from octoprint.server.util.hostname_util import is_valid_hostname, update_hostname
from octoprint.server.api import api
from octoprint.server import printer, NO_CONTENT
from flask import Blueprint, jsonify, request, make_response


#~~ BVC custom API
api = Blueprint("beeapi", __name__)

@api.route("/printer", methods=["GET"])
def getConnectedPrinter():

	if printer is not None:
		printer_name = printer.get_printer_name()
	else:
		printer_name = ''

	return jsonify({
		"printer": printer_name
	})

@api.route("/wifi/list", methods=["GET"])
def getAvailableHotspots():

	networks = get_ssid_list('wlan0')

	return jsonify({
		"wifi_networks": networks
	})


{'fraction_non_alphanumeric': 0.10673385249656436, 'fraction_numerical': 0.007329363261566651, 'mean_word_length': 5.825, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5381008', 'n_tokens_mistral': 759, 'n_tokens_neox': 727, 'n_words': 183}