From: san Date: Wed, 12 Apr 2006 13:52:24 +0000 (+0000) Subject: Win32 correction X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=45c7ba9be18b67b72800e92e8d0a779093b70390;p=modules%2Fkernel.git Win32 correction --- diff --git a/src/Utils/Utils_Identity.py b/src/Utils/Utils_Identity.py index e73a5f596..abe780415 100644 --- a/src/Utils/Utils_Identity.py +++ b/src/Utils/Utils_Identity.py @@ -31,7 +31,10 @@ import sys import os import socket -import pwd + +if not sys.platform == "win32": + import pwd + import time import string @@ -52,8 +55,12 @@ class Identity: self._machine = socket.gethostname() self._adip = socket.gethostbyname(self._machine) # IP adress self._uid = os.getuid() - list = pwd.getpwuid(self._uid) - self._pwname = list[0] # user name + if sys.platform == "win32": + self._pwname = os.environ["USER"] + else: + 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()