""" Protocol for epoptesd.py <=> uiconnection.py communication. """ import os import sys import tempfile from twisted.internet import protocol from twisted.protocols import amp from epoptes.core import logger from epoptes.daemon import commands, exchange # stdout in epoptesd/bashplex/guiplex is handled by twisted and goes to syslog. # stderr isn't, so tell Logger to use stdout. LOG = logger.Logger(__file__, sys.stdout) class GUI(amp.AMP): """Protocol for epoptesd.py <=> uiconnection.py communication.""" def connectionMade(self): """Override BaseProtocol.connectionMade.""" super().connectionMade() exchange.known_guis.append(self) def connectionLost(self, reason): """Override AMP.connectionLost.""" super().connectionLost(reason) exchange.known_guis.remove(self) def client_connected(self, handle):
from epoptes.ui.reactor import reactor from epoptes.common.constants import * from epoptes.common import config from epoptes.core import logger, structs, wol from epoptes.ui.about import About from epoptes.ui.benchmark import Benchmark from epoptes.ui.client_information import ClientInformation from epoptes.ui.common import gettext as _ from epoptes.ui.exec_command import ExecCommand from epoptes.ui.notifications import NotifyQueue from epoptes.ui.send_message import SendMessage from gi.repository import Gdk, GdkPixbuf, GLib, Gtk LOG = logger.Logger(__file__) class EpoptesGui(object): """Epoptes GUI class.""" def __init__(self): # Initialization of general-purpose variables self.about = None self.benchmark = None self.client_information = None self.current_macs = subprocess.Popen( [ 'sh', '-c', r"""ip -oneline -family inet link show | """ r"""sed -n '/.*ether[[:space:]]*\([[:xdigit:]:]*\).*/""" r"""{s//\1/;y/abcdef-/ABCDEF:/;p;}';""" r"""echo $LTSP_CLIENT_MAC"""