X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Farchitecture.py;h=7d66a03d96c31fca332b525691f28987e1561ecc;hb=46f6029af905d76f63468622e56ddcb8fa4a8c59;hp=0662509bc803fcdceebf108951b46c0cf34351c2;hpb=053f74ae71391412911b076c434b00811d449586;p=tools%2Fsat.git diff --git a/src/architecture.py b/src/architecture.py index 0662509..7d66a03 100644 --- a/src/architecture.py +++ b/src/architecture.py @@ -35,18 +35,17 @@ def get_user(): :rtype: str ''' - # In windows case, the USERNAME environment variable has to be set - if is_windows(): - if not 'USERNAME' in os.environ: - raise Exception('USERNAME environment variable not set') - return os.environ['USERNAME'] - else: # linux - import pwd - return pwd.getpwuid(os.getuid())[0] + try : + if is_windows(): + # In windows case, the USERNAME environment variable has to be set + user_name=os.environ['USERNAME'] + else: # linux + import pwd + user_name=pwd.getpwuid(os.getuid())[0] + except : + user_name="Unknown" + return user_name -def get_windows_os_label(): - '''returns the SAT convention used for Windows labeling ''' - return "W" # in order to fulfill the 8196 length constraint! def get_distribution(codes): '''Gets the code for the distribution @@ -57,7 +56,7 @@ def get_distribution(codes): :rtype: str ''' if is_windows(): - return get_windows_os_label() + return "W" # else get linux distribution description from platform, and encode it with code lin_distrib = platform.dist()[0].lower()