|
|
@ -15,6 +15,7 @@
|
|
|
|
# limitations under the License.
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
from posixpath import split
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
from os import path
|
|
|
|
from os import path
|
|
|
@ -59,9 +60,8 @@ class DomainInfoHelper(VariableInterface):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def getUserDataInFile(self, login, filePasswd):
|
|
|
|
def getUserDataInFile(self, login, filePasswd):
|
|
|
|
return list(filter(lambda x: x[0] == login,
|
|
|
|
return [x for x in (y.strip().split(':') for y
|
|
|
|
map(lambda x: x.strip().split(':'),
|
|
|
|
in readLinesFile(filePasswd)) if x[0] == login]
|
|
|
|
readLinesFile(filePasswd))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def isDomainUser(self, userName):
|
|
|
|
def isDomainUser(self, userName):
|
|
|
|
if userName:
|
|
|
|
if userName:
|
|
|
@ -93,9 +93,8 @@ class VariableUrDomainSet(ReadonlyVariable, DomainInfoHelper):
|
|
|
|
type = "bool"
|
|
|
|
type = "bool"
|
|
|
|
|
|
|
|
|
|
|
|
def getUserDataInFile(self, login, file_passwd):
|
|
|
|
def getUserDataInFile(self, login, file_passwd):
|
|
|
|
return list(filter(lambda x: x[0] == login,
|
|
|
|
return [x for x in (y.strip().split(':') for y
|
|
|
|
map(lambda x: x.strip().split(':'),
|
|
|
|
in readLinesFile(file_passwd)) if x[0] == login]
|
|
|
|
readLinesFile(file_passwd))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
return "on" if self.isDomainUser(self.Get('ur_login')) else "off"
|
|
|
|
return "on" if self.isDomainUser(self.Get('ur_login')) else "off"
|
|
|
@ -156,10 +155,9 @@ class VariableClDesktopGstData(ReadonlyVariable):
|
|
|
|
if res == gst.STATE_CHANGE_SUCCESS:
|
|
|
|
if res == gst.STATE_CHANGE_SUCCESS:
|
|
|
|
outdata['device_name'] = alsamixer.get_property("device-name")
|
|
|
|
outdata['device_name'] = alsamixer.get_property("device-name")
|
|
|
|
outdata['long_name'] = alsamixer.get_factory().get_longname()
|
|
|
|
outdata['long_name'] = alsamixer.get_factory().get_longname()
|
|
|
|
outdata['internal_name'] = list(filter(str.isalnum,
|
|
|
|
outdata['internal_name'] = [x for x
|
|
|
|
"%s (%s)" % (
|
|
|
|
in "%s (%s)" % (outdata['device_name'],outdata['long_name'])
|
|
|
|
outdata['device_name'],
|
|
|
|
if str.isalnum(x)]
|
|
|
|
outdata['long_name'])))
|
|
|
|
|
|
|
|
outdata['channels'] = []
|
|
|
|
outdata['channels'] = []
|
|
|
|
for t in alsamixer.list_tracks():
|
|
|
|
for t in alsamixer.list_tracks():
|
|
|
|
if t.flags & gst.interfaces.MIXER_TRACK_OUTPUT:
|
|
|
|
if t.flags & gst.interfaces.MIXER_TRACK_OUTPUT:
|
|
|
@ -200,9 +198,8 @@ class VariableClDesktopXfceMixer(ReadonlyVariable):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
return "\n".join(
|
|
|
|
return "\n".join((' <value type="string" value="%s" />' % x for x
|
|
|
|
map(lambda x: ' <value type="string" value="%s" />' % x,
|
|
|
|
in self.Get('cl_desktop_gst_data').get('channels', [])))
|
|
|
|
self.Get('cl_desktop_gst_data').get('channels', [])))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClDesktopXfcePointers(ReadonlyVariable):
|
|
|
|
class VariableClDesktopXfcePointers(ReadonlyVariable):
|
|
|
@ -257,25 +254,32 @@ class VariableClDesktopOnlineData(ReadonlyTableVariable, DomainInfoHelper):
|
|
|
|
if resWho.success():
|
|
|
|
if resWho.success():
|
|
|
|
listProcessing = lambda x: (x[0], x[1], x[-1]) \
|
|
|
|
listProcessing = lambda x: (x[0], x[1], x[-1]) \
|
|
|
|
if len(x) >= 5 else []
|
|
|
|
if len(x) >= 5 else []
|
|
|
|
|
|
|
|
# xData = groupby(
|
|
|
|
|
|
|
|
# sorted(
|
|
|
|
|
|
|
|
# filter(lambda x: x[0] != "root",
|
|
|
|
|
|
|
|
# map(lambda x: (x[0], self._getDisplay(x[1], x[2])),
|
|
|
|
|
|
|
|
# filter(lambda x: x and \
|
|
|
|
|
|
|
|
# (x[2].startswith("(:") or
|
|
|
|
|
|
|
|
# x[1].startswith(":")),
|
|
|
|
|
|
|
|
# map(lambda x: listProcessing(
|
|
|
|
|
|
|
|
# list(filter(lambda y: y, x.split()))),
|
|
|
|
|
|
|
|
# resWho)))),
|
|
|
|
|
|
|
|
# key=lambda x: x[0]),
|
|
|
|
|
|
|
|
# lambda x: x[0])
|
|
|
|
|
|
|
|
|
|
|
|
xData = groupby(
|
|
|
|
xData = groupby(
|
|
|
|
sorted(
|
|
|
|
sorted((x for x in ((y[0], self._getDisplay(y[1], y[2])) for y
|
|
|
|
filter(lambda x: x[0] != "root",
|
|
|
|
in (listProcessing([o for o in z.split() if o]) for z
|
|
|
|
map(lambda x: (x[0], self._getDisplay(x[1], x[2])),
|
|
|
|
in resWho)
|
|
|
|
filter(lambda x: x and \
|
|
|
|
if y and (y[2].startswith("(:") or y[1].startswith(":")))
|
|
|
|
(x[2].startswith("(:") or
|
|
|
|
if x[0] != "root"),
|
|
|
|
x[1].startswith(":")),
|
|
|
|
|
|
|
|
map(lambda x: listProcessing(
|
|
|
|
|
|
|
|
list(filter(lambda y: y, x.split()))),
|
|
|
|
|
|
|
|
resWho)))),
|
|
|
|
|
|
|
|
key=lambda x: x[0]),
|
|
|
|
key=lambda x: x[0]),
|
|
|
|
lambda x: x[0])
|
|
|
|
lambda x: x[0])
|
|
|
|
xData = list(map(lambda x: (x[0][0], x[0][1],
|
|
|
|
|
|
|
|
self.get_user_uid(x[0][0]),
|
|
|
|
|
|
|
|
"on" if self.isDomainUser(
|
|
|
|
xData = [(x[0][0], x[0][1], self.get_user_uid(x[0][0]), "on"
|
|
|
|
x[0][0]) else "off",
|
|
|
|
if self.isDomainUser(x[0][0]) else "off", len(x)) for x
|
|
|
|
len(x)),
|
|
|
|
in (list(y[1]) for y in xData)]
|
|
|
|
map(lambda x: list(x[1]),
|
|
|
|
|
|
|
|
xData)))
|
|
|
|
|
|
|
|
return xData
|
|
|
|
return xData
|
|
|
|
|
|
|
|
|
|
|
|
setValue = Variable.setValue
|
|
|
|
setValue = Variable.setValue
|
|
|
@ -367,13 +371,14 @@ class VariableUrMountDirs(ReadonlyVariable):
|
|
|
|
mountProfileDir = path.join(dirStart, ".%s" % dirEnd)
|
|
|
|
mountProfileDir = path.join(dirStart, ".%s" % dirEnd)
|
|
|
|
mountRemoteProfileDir = path.join(dirStart, ".%s.remote" % dirEnd)
|
|
|
|
mountRemoteProfileDir = path.join(dirStart, ".%s.remote" % dirEnd)
|
|
|
|
|
|
|
|
|
|
|
|
directories = filter(lambda x: x != homeDir,
|
|
|
|
directories = (x for x
|
|
|
|
filter(lambda x: (x.startswith(homeDir) or
|
|
|
|
in (y for y
|
|
|
|
x.startswith(mountProfileDir) or
|
|
|
|
in (z.split(" ")[1] for z
|
|
|
|
x.startswith(
|
|
|
|
in readLinesFile('/proc/mounts'))
|
|
|
|
mountRemoteProfileDir)),
|
|
|
|
if (y.startswith(homeDir)
|
|
|
|
map(lambda x: x.split(" ")[1],
|
|
|
|
or y.startswith(mountProfileDir)
|
|
|
|
readLinesFile('/proc/mounts'))))
|
|
|
|
or y.startswith(mountRemoteProfileDir)))
|
|
|
|
|
|
|
|
if x != homeDir)
|
|
|
|
# if isMount(homeDir):
|
|
|
|
# if isMount(homeDir):
|
|
|
|
# directories.append(homeDir)
|
|
|
|
# directories.append(homeDir)
|
|
|
|
return sorted(directories, reverse=True)
|
|
|
|
return sorted(directories, reverse=True)
|
|
|
@ -446,9 +451,8 @@ class VariableClDesktopFaceList(Variable):
|
|
|
|
type = "list"
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
return sorted(
|
|
|
|
return sorted((x for x in listDirectory(self.Get('cl_desktop_face_path'))
|
|
|
|
filter(lambda x: x.endswith('.png'),
|
|
|
|
if x.endswith('.png')))
|
|
|
|
listDirectory(self.Get('cl_desktop_face_path'))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClDesktopHashFace(Variable):
|
|
|
|
class VariableClDesktopHashFace(Variable):
|
|
|
|