示例#1
0
    def show_general_sys_info(self, header=1):
        if header: print(UTIL.section_divider('general', hchar='-'))

        def tostr(some_tuple):
            if type(some_tuple) == str: return some_tuple
            tlist = [t for t in list(some_tuple) if type(t) == str]
            return ' '.join(tlist)

        print('architecture:         %s' % tostr(platform.architecture()))
        print('system:               %s' % platform.system())
        print('release:              %s' % platform.release())
        print('version:              %s' % platform.version())

        # check distributions by type
        checkdist = 0
        dstr = ''
        if self.system == 'Linux':
            try:
                dstr = tostr(platform.linux_distribution())
            except:
                checkdist = 1
        elif self.system == 'Darwin':
            try:
                dstr = tostr(platform.mac_ver())
            except:
                checkdist = 1
        else:
            checkdist = 1
        if checkdist: dstr = tostr(platform.dist())
        self.os_dist = dstr  # save result
        print('distribution:         %s' % dstr)

        print('number of CPUs:       %s' % self.get_cpu_count())

        # note shell, and if we are not in login shell
        logshell = UTIL.get_login_shell()
        curshell = UTIL.get_current_shell()
        if logshell == curshell: note = ''
        else: note = '  (current shell is %s)' % curshell

        if logshell not in ['csh', 'tcsh']:
            self.comments.append("login shell '%s', trusting user to translate" \
                                 " from 'tcsh'" % logshell)

        print('apparent login shell: %s%s' % (logshell, note))

        self.cur_shell = curshell
        self.login_shell = logshell

        self.set_shell_rc_file([logshell, curshell])
        if self.home_file_exists(self.rc_file): fstr = 'exists'
        else: fstr = 'does not exist'
        print('shell RC file:        %s (%s)' % (self.rc_file, fstr))
        print('')
示例#2
0
   def show_general_sys_info(self, header=1):
      if header: print UTIL.section_divider('general', hchar='-')

      def tostr(some_tuple):
         if type(some_tuple) == str: return some_tuple
         tlist = [t for t in list(some_tuple) if type(t) == str]
         return ' '.join(tlist)

      print 'architecture:         %s' % tostr(platform.architecture())
      print 'system:               %s' % platform.system()
      print 'release:              %s' % platform.release()
      print 'version:              %s' % platform.version()

      # check distributions by type
      checkdist = 0
      dstr = ''
      if   self.system == 'Linux':
         try:    dstr = tostr(platform.linux_distribution())
         except: checkdist = 1
      elif self.system == 'Darwin':
         try: dstr = tostr(platform.mac_ver())
         except: checkdist = 1
      else: checkdist = 1
      if checkdist: dstr = tostr(platform.dist())
      self.os_dist = dstr       # save result
      print 'distribution:         %s' % dstr
         
      print 'number of CPUs:       %s' % self.get_cpu_count()

      # note shell, and if we are not in login shell
      logshell = UTIL.get_login_shell()
      curshell = UTIL.get_current_shell()
      if logshell == curshell: note = ''
      else:                    note = '  (current shell is %s)' % curshell

      if logshell not in ['csh', 'tcsh']:
         self.comments.append("login shell '%s', trusting user to translate" \
                              " from 'tcsh'" % logshell)

      print 'apparent login shell: %s%s' % (logshell, note)

      self.set_shell_rc_file([logshell, curshell])
      if self.home_file_exists(self.rc_file): fstr = 'exists'
      else:                                   fstr = 'does not exist'
      print 'shell RC file:        %s (%s)' % (self.rc_file, fstr)
      print
示例#3
0
    def show_general_sys_info(self, header=1):
        if header: print UTIL.section_divider('general', hchar='-')

        def tostr(some_tuple):
            if type(some_tuple) == str: return some_tuple
            tlist = [t for t in list(some_tuple) if type(t) == str]
            return ' '.join(tlist)

        print 'architecture:         %s' % tostr(platform.architecture())
        print 'system:               %s' % platform.system()
        print 'release:              %s' % platform.release()
        print 'version:              %s' % platform.version()

        # check distributions by type
        checkdist = 0
        dstr = ''
        if self.system == 'Linux':
            try:
                dstr = tostr(platform.linux_distribution())
            except:
                checkdist = 1
        elif self.system == 'Darwin':
            try:
                dstr = tostr(platform.mac_ver())
            except:
                checkdist = 1
        else:
            checkdist = 1
        if checkdist: dstr = tostr(platform.dist())
        self.os_dist = dstr  # save result
        print 'distribution:         %s' % dstr

        print 'number of CPUs:       %s' % self.get_cpu_count()

        # note shell, and if we are not in login shell
        logshell = UTIL.get_login_shell()
        curshell = UTIL.get_current_shell()
        if logshell == curshell: note = ''
        else: note = '  (current shell is %s)' % curshell

        print 'apparent login shell: %s%s' % (logshell, note)
        print
示例#4
0
   def show_general_sys_info(self, header=1):
      if header: print UTIL.section_divider('general', hchar='-')

      def tostr(some_tuple):
         if type(some_tuple) == str: return some_tuple
         tlist = [t for t in list(some_tuple) if type(t) == str]
         return ' '.join(tlist)

      print 'architecture:         %s' % tostr(platform.architecture())
      print 'system:               %s' % platform.system()
      print 'release:              %s' % platform.release()
      print 'version:              %s' % platform.version()

      # check distributions by type
      checkdist = 0
      dstr = ''
      if   self.system == 'Linux':
         try:    dstr = tostr(platform.linux_distribution())
         except: checkdist = 1
      elif self.system == 'Darwin':
         try: dstr = tostr(platform.mac_ver())
         except: checkdist = 1
      else: checkdist = 1
      if checkdist: dstr = tostr(platform.dist())
      self.os_dist = dstr       # save result
      print 'distribution:         %s' % dstr
         
      print 'number of CPUs:       %s' % self.get_cpu_count()

      # note shell, and if we are not in login shell
      logshell = UTIL.get_login_shell()
      curshell = UTIL.get_current_shell()
      if logshell == curshell: note = ''
      else:                    note = '  (current shell is %s)' % curshell

      print 'apparent login shell: %s%s' % (logshell, note)
      print