]> git.parisson.com Git - telecaster-client.git/commitdiff
generalize interfaces
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 15 Jun 2021 16:35:42 +0000 (18:35 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 15 Jun 2021 16:35:42 +0000 (18:35 +0200)
telecaster/context_processors.py
telecaster/tools/status.py

index ece4dd0b2204b90b201215ab67be0ddd096e09fe..649127a3066278c800204188db23256e2adfbdb9 100644 (file)
@@ -37,9 +37,7 @@ from django.conf import settings
 import socket
 import fcntl
 import struct
-
-interfaces = ['eth0', 'eth1', 'eth2', 'eth0-eth2', 'eth3', 'eth4', 'eth5', 'eth6', 'eth7', 'eth8', 'eth9',
-                  'wlan0', 'wlan1', 'wlan2', 'wlan3', 'wlan4']
+from .tools.status import interfaces
 
 
 def get_ip_address(ifname):
index 2ee33fe3a07c007959234ba51efe8127cea336cd..9ecf9139698cf54282cf9a3767b8306b753b2ba6 100644 (file)
@@ -40,13 +40,17 @@ from telecaster.tools import *
 from django.conf import settings
 
 
-class Status(object):
+interfaces = ['eth0', 'eth1', 'eth2', 'eth0-eth2', 'eth3', 'eth4', 'eth5',
+              'eth6', 'eth7', 'eth8', 'eth9', 'eno0', 'eno1',
+              'wlan0', 'wlan1', 'wlan2', 'wlan3', 'wlan4']
+
+acpi_states = {0: 'battery', 1: 'battery', 2: 'AC'}
 
-    interfaces = ['eth0', 'eth1', 'eth2', 'eth0-eth2', 'eth3', 'eth4', 'eth5',
-                  'eth6', 'eth7', 'eth8', 'eth9', 'eno0', 'eno1',
-                  'wlan0', 'wlan1', 'wlan2', 'wlan3', 'wlan4']
 
-    acpi_states = {0: 'battery', 1: 'battery', 2: 'AC'}
+class Status(object):
+
+    interfaces = interfaces
+    acpi_states = acpi_states
 
     def __init__(self):
         self.acpi = acpi.Acpi()