diff --git a/upribox_interface/lib/info.py b/upribox_interface/lib/info.py index f7d50792..11512e67 100644 --- a/upribox_interface/lib/info.py +++ b/upribox_interface/lib/info.py @@ -1,5 +1,6 @@ import subprocess import json +import os class HardwareInfo: @@ -65,6 +66,30 @@ def __str__(self): return '\n'.join((self.model, str(self.wifi_devices))) +class ModelInfo: + + MODEL_PATH = '/proc/device-tree/model' + + def __init__(self): + self.model = self.get_model_str() + + def get_model_str(self): + if not os.path.exists(self.MODEL_PATH): + return None + + with open(self.MODEL_PATH) as model_file: + model = model_file.read().strip() + return model + + def runs_on_pi3(self): + if not self.model: + return False + elif u'Pi 3' in self.model: + return True + else: + return False + + class UpdateStatus: ANSIBLE_PULL_LOG_FILE = '/var/tmp/log/ansible-pull.log' diff --git a/upribox_interface/wlan/locale/en/LC_MESSAGES/django.mo b/upribox_interface/wlan/locale/en/LC_MESSAGES/django.mo index 81ae33cf..c9662e19 100644 Binary files a/upribox_interface/wlan/locale/en/LC_MESSAGES/django.mo and b/upribox_interface/wlan/locale/en/LC_MESSAGES/django.mo differ diff --git a/upribox_interface/wlan/locale/en/LC_MESSAGES/django.po b/upribox_interface/wlan/locale/en/LC_MESSAGES/django.po index e6a351c4..236a5ee5 100644 --- a/upribox_interface/wlan/locale/en/LC_MESSAGES/django.po +++ b/upribox_interface/wlan/locale/en/LC_MESSAGES/django.po @@ -133,7 +133,7 @@ msgstr "" #: wlan/templates/ninja.html:39 msgid "Das Ninja WiFi kann auf dem Raspberry Pi 3 nicht aktiviert werden." -msgstr "The Ninja WiFi can not be aktived on the Raspberry Pi 3." +msgstr "The Ninja WiFi can not be activated on the Raspberry Pi 3." #: wlan/templates/ninja.html:54 wlan/templates/silent.html:18 msgid "Ein-/Ausschalten" diff --git a/upribox_interface/wlan/templates/ninja.html b/upribox_interface/wlan/templates/ninja.html index 89d9be71..64b969e2 100644 --- a/upribox_interface/wlan/templates/ninja.html +++ b/upribox_interface/wlan/templates/ninja.html @@ -16,34 +16,15 @@