|
|
@ -59,9 +59,9 @@ class DomainInfoHelper(VariableInterface): |
|
|
|
""" |
|
|
|
|
|
|
|
def getUserDataInFile(self, login, filePasswd): |
|
|
|
return filter(lambda x: x[0] == login, |
|
|
|
return list(filter(lambda x: x[0] == login, |
|
|
|
map(lambda x: x.strip().split(':'), |
|
|
|
readLinesFile(filePasswd))) |
|
|
|
readLinesFile(filePasswd)))) |
|
|
|
|
|
|
|
def isDomainUser(self, userName): |
|
|
|
if userName: |
|
|
@ -93,9 +93,9 @@ class VariableUrDomainSet(ReadonlyVariable, DomainInfoHelper): |
|
|
|
type = "bool" |
|
|
|
|
|
|
|
def getUserDataInFile(self, login, file_passwd): |
|
|
|
return filter(lambda x: x[0] == login, |
|
|
|
return list(filter(lambda x: x[0] == login, |
|
|
|
map(lambda x: x.strip().split(':'), |
|
|
|
readLinesFile(file_passwd))) |
|
|
|
readLinesFile(file_passwd)))) |
|
|
|
|
|
|
|
def get(self): |
|
|
|
return "on" if self.isDomainUser(self.Get('ur_login')) else "off" |
|
|
@ -156,10 +156,10 @@ class VariableClDesktopGstData(ReadonlyVariable): |
|
|
|
if res == gst.STATE_CHANGE_SUCCESS: |
|
|
|
outdata['device_name'] = alsamixer.get_property("device-name") |
|
|
|
outdata['long_name'] = alsamixer.get_factory().get_longname() |
|
|
|
outdata['internal_name'] = filter(str.isalnum, |
|
|
|
outdata['internal_name'] = list(filter(str.isalnum, |
|
|
|
"%s (%s)" % ( |
|
|
|
outdata['device_name'], |
|
|
|
outdata['long_name'])) |
|
|
|
outdata['long_name']))) |
|
|
|
outdata['channels'] = [] |
|
|
|
for t in alsamixer.list_tracks(): |
|
|
|
if t.flags & gst.interfaces.MIXER_TRACK_OUTPUT: |
|
|
@ -265,17 +265,17 @@ class VariableClDesktopOnlineData(ReadonlyTableVariable, DomainInfoHelper): |
|
|
|
(x[2].startswith("(:") or |
|
|
|
x[1].startswith(":")), |
|
|
|
map(lambda x: listProcessing( |
|
|
|
filter(lambda y: y, x.split())), |
|
|
|
list(filter(lambda y: y, x.split()))), |
|
|
|
resWho)))), |
|
|
|
key=lambda x: x[0]), |
|
|
|
lambda x: x[0]) |
|
|
|
xData = map(lambda x: (x[0][0], x[0][1], |
|
|
|
xData = list(map(lambda x: (x[0][0], x[0][1], |
|
|
|
self.get_user_uid(x[0][0]), |
|
|
|
"on" if self.isDomainUser( |
|
|
|
x[0][0]) else "off", |
|
|
|
len(x)), |
|
|
|
map(lambda x: list(x[1]), |
|
|
|
xData)) |
|
|
|
xData))) |
|
|
|
return xData |
|
|
|
|
|
|
|
setValue = Variable.setValue |
|
|
@ -461,11 +461,10 @@ class VariableClDesktopHashFace(Variable): |
|
|
|
login = self.Get('ur_login') |
|
|
|
icon_list = self.Get('cl_desktop_face_list') |
|
|
|
if icon_list: |
|
|
|
# return path.join(self.Get('cl_desktop_face_path'), |
|
|
|
# icon_list[sum(map(lambda x: ord(x), hashlib.md5(login).digest())) % len(icon_list)]) |
|
|
|
return path.join(self.Get('cl_desktop_face_path'), |
|
|
|
icon_list[sum(map(lambda x: ord(x), |
|
|
|
hashlib.md5( |
|
|
|
login).digest())) % len( |
|
|
|
icon_list)]) |
|
|
|
icon_list[sum([x for x in hashlib.md5(login.encode("UTF-8")).digest()]) % len(icon_list)]) |
|
|
|
else: |
|
|
|
return "" |
|
|
|
|
|
|
|