]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Win32 correction
authorsan <san@opencascade.com>
Wed, 12 Apr 2006 13:52:24 +0000 (13:52 +0000)
committersan <san@opencascade.com>
Wed, 12 Apr 2006 13:52:24 +0000 (13:52 +0000)
src/Utils/Utils_Identity.py

index e73a5f59661901e271494db6c8ca2ec04055873a..abe7804157d248b18873cff710aa4e3d7f44b785 100644 (file)
 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()