parameters: (self)
return_statement: return name
docstring: The process name. The return value is cached after first call.
docstring_summary: The process name. The return value is cached after first call.
docstring_tokens: The process name . The return value is cached after first call .
function: def name(self):
          """The process name. The return value is cached after first call."""
          # Process name is only cached on Windows as on POSIX it may
          # change, see:
          # https://github.com/giampaolo/psutil/issues/692
          if WINDOWS and self._name is not None:
              return self._name
          name = self._proc.name()
          if POSIX and len(name) >= 15:
              # On UNIX the name gets truncated to the first 15 characters.
              # If it matches the first part of the cmdline we return that
              # one instead because it's usually more explicative.
              # Examples are "gnome-keyring-d" vs. "gnome-keyring-daemon".
              try:
                  cmdline = self.cmdline()
              except AccessDenied:
                  pass
              else:
                  if cmdline:
                      extended_name = os.path.basename(cmdline[0])
                      if extended_name.startswith(name):
                          name = extended_name
          self._name = name
          self._proc._name = name
          return name
function_tokens: def name ( self ) : # Process name is only cached on Windows as on POSIX it may # change, see: # https://github.com/giampaolo/psutil/issues/692 if WINDOWS and self . _name is not None : return self . _name name = self . _proc . name ( ) if POSIX and len ( name ) >= 15 : # On UNIX the name gets truncated to the first 15 characters. # If it matches the first part of the cmdline we return that # one instead because it's usually more explicative. # Examples are "gnome-keyring-d" vs. "gnome-keyring-daemon". try : cmdline = self . cmdline ( ) except AccessDenied : pass else : if cmdline : extended_name = os . path . basename ( cmdline [ 0 ] ) if extended_name . startswith ( name ) : name = extended_name self . _name = name self . _proc . _name = name return name