[nanny: 4/7] LinuxUsersManager: Add get_username_by_uid helper
- From: Roberto Majadas <telemaco src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nanny: 4/7] LinuxUsersManager: Add get_username_by_uid helper
- Date: Sat, 4 Jun 2011 00:37:38 +0000 (UTC)
commit 54b1d3e2066b9fe2fa5bc920961bc1a738fbd00e
Author: Roberto Majadas <roberto majadas openshine com>
Date: Sat Jun 4 02:22:28 2011 +0200
LinuxUsersManager: Add get_username_by_uid helper
daemon/src/LinuxUsersManager.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/daemon/src/LinuxUsersManager.py b/daemon/src/LinuxUsersManager.py
index 566ede0..3331b49 100644
--- a/daemon/src/LinuxUsersManager.py
+++ b/daemon/src/LinuxUsersManager.py
@@ -47,6 +47,13 @@ class LinuxUsersManager:
self.users = users
return users
+ def get_username_by_uid(self, uid):
+ for id, name, name_ext in self.get_users():
+ if int(uid) == int(id):
+ return name
+ else:
+ return ''
+
def has_changes (self):
if self.last_mdate == None :
return True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]