Salome HOME
projects
/
modules
/
kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CCAR:
[modules/kernel.git]
/
src
/
Utils
/
Utils_Identity.py
diff --git
a/src/Utils/Utils_Identity.py
b/src/Utils/Utils_Identity.py
index 908ce585bae8cb5e84b28b59d15cc382cd1a1063..26d5a21eeb62ca21f4eecfe42a2b0f20f44aeffe 100644
(file)
--- a/
src/Utils/Utils_Identity.py
+++ b/
src/Utils/Utils_Identity.py
@@
-37,11
+37,6
@@
import socket
if not sys.platform == "win32":
import pwd
if not sys.platform == "win32":
import pwd
- def getUserName(uid):
- return pwd.getpwuid(uid)[0]
-else:
- def getUserName(uid):
- return os.environ["USER"]
import time
import string
import time
import string
@@
-63,8
+58,14
@@
class Identity:
self._pid = os.getpid()
self._machine = socket.gethostname()
self._adip = socket.gethostbyname(self._machine) # IP adress
self._pid = os.getpid()
self._machine = socket.gethostname()
self._adip = socket.gethostbyname(self._machine) # IP adress
- self._uid = os.getpid()
- self._pwname = getUserName(self._uid)
+ if sys.platform == "win32":
+ self._uid = os.getpid()
+ self._pwname = os.environ["USER"]
+ else:
+ self._uid = os.getuid()
+ list = pwd.getpwuid(self._uid)
+ self._pwname = list[0] # user name
+
self._tc_start = time.time()
self._cstart = time.ctime(self._tc_start)
self._cdir = os.getcwd()
self._tc_start = time.time()
self._cstart = time.ctime(self._tc_start)
self._cdir = os.getcwd()