From 50d25844f8ef589eb81ff7f3e338cdc42da930cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Thu, 24 Nov 2016 17:16:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D1=83=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D0=B5=D0=B9=20=D0=B2=20xfce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/desktop/variables/desktop.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pym/desktop/variables/desktop.py b/pym/desktop/variables/desktop.py index 959cbbc..3a6afd7 100644 --- a/pym/desktop/variables/desktop.py +++ b/pym/desktop/variables/desktop.py @@ -25,9 +25,10 @@ from calculate.lib.datavars import (Variable, VariableError, ReadonlyVariable, from calculate.lib.utils.common import getValueFromConfig from calculate.lib.variables import user from calculate.lib.utils.files import (readLinesFile, process, - listDirectory) + listDirectory, readFile) from calculate.desktop._cl_keys import getKey from itertools import * +import glob from calculate.lib.cl_template import templateFunction from calculate.lib.cl_ini_parser import iniParser import hashlib @@ -202,6 +203,23 @@ class VariableClDesktopXfceMixer(ReadonlyVariable): self.Get('cl_desktop_gst_data').get('channels', []))) +class VariableClDesktopXfcePointers(ReadonlyVariable): + """ + Список устройств-указателей для xfce + """ + type = "list" + + def get(self): + def generate(): + for name_fn in sorted( + glob.glob("/sys/class/input/mouse*/device/name")): + data = readFile(name_fn) + if data: + yield data.strip().replace(" ", "_") + + return list(generate()) + + class VariableClDesktopOnlineData(ReadonlyTableVariable, DomainInfoHelper): """ Information about online users