Back to index

salome-kernel  6.5.0
Classes | Functions
Utils_Identity Namespace Reference

Module to get information about user and version. More...

Classes

class  Identity

Functions

def getShortHostName
def getapplipath
def version

Detailed Description

Module to get information about user and version.


Function Documentation

  Gives short application path (the complete path is $HOME/$APPLI)

Definition at line 72 of file Utils_Identity.py.

00072 
00073 def getapplipath():
00074     """
00075       Gives short application path (the complete path is $HOME/$APPLI)
00076     """
00077     return os.environ.get("APPLI",".salome_"+versnb)
00078 
00079 try:
00080   file = open(os.path.join(os.environ["KERNEL_ROOT_DIR"],"bin","salome","VERSION"), "r")
00081   s = file.readline()
00082   versnb = string.strip(string.split(s, ":")[1])
00083   dirname=".salome_"+versnb
00084 except:
00085   versnb = ""
00086   dirname=".salome"

Here is the caller graph for this function:

gives Hostname without domain extension.

SALOME naming service needs short Hostnames (without domain extension).
HOSTNAME is not allways defined in environment,
socket.gethostname() gives short or complete Hostname, depending on
defined aliases.

Definition at line 43 of file Utils_Identity.py.

00043 
00044 def getShortHostName():
00045     """
00046     gives Hostname without domain extension.
00047 
00048     SALOME naming service needs short Hostnames (without domain extension).
00049     HOSTNAME is not allways defined in environment,
00050     socket.gethostname() gives short or complete Hostname, depending on
00051     defined aliases.
00052     """
00053     return string.split(socket.gethostname(),'.')[0]

Here is the caller graph for this function:

  Gives salome version number

Definition at line 87 of file Utils_Identity.py.

00087 
00088 def version():
00089     """
00090       Gives salome version number
00091     """
00092     return versnb