Retrieves the TAR info.

    Returns:
      tarfile.TARInfo: TAR info or None if it does not exist.

    Raises:
      PathSpecError: if the path specification is incorrect.
333945
def GetTARInfo(self):
    
    if not self._tar_info:
      location = getattr(self.path_spec, 'location', None)
      if location is None:
        raise errors.PathSpecError('Path specification missing location.')

      if not location.startswith(self._file_system.LOCATION_ROOT):
        raise errors.PathSpecError('Invalid location in path specification.')

      if len(location) == 1:
        return None

      tar_file = self._file_system.GetTARFile()
      try:
        self._tar_info = tar_file.getmember(location[1:])
      except KeyError:
        pass

    return self._tar_info
1211211
def GetFileEntryByPathSpec(self, path_spec):
    
    if not self.FileEntryExistsByPathSpec(path_spec):
      return None

    location = getattr(path_spec, 'location', None)

    if len(location) == 1:
      return tar_file_entry.TARFileEntry(
          self._resolver_context, self, path_spec, is_root=True,
          is_virtual=True)

    kwargs = {}
    try:
      kwargs['tar_info'] = self._tar_file.getmember(location[1:])
    except KeyError:
      kwargs['is_virtual'] = True

    return tar_file_entry.TARFileEntry(
        self._resolver_context, self, path_spec, **kwargs)
583383
def info(self):
        
        info = self.get_params()
        info.update({'term_type': self._name})
        return info
1311090
def tar_extract(cls, tar_comp_file_path):
        
        try:
            with contextlib.closing(tarfile.open(tar_comp_file_path)) as tar:
                tar.extractall()
        except tarfile.ReadError as e:
            message_format = (
                'Extract failed: '
                'tar_comp_file_path: {0}, reason: {1}'
            )
            raise InstallError(message_format.format(tar_comp_file_path, e))
441729
def detour_info(self):
        
        resource_list = self.traffic_incident()
        detour_info = namedtuple('detour_info', 'detour_info')
        if len(resource_list) == 1 and resource_list[0] is None:
            return None
        else:
            try:
                return [detour_info(resource['detour'])
                        for resource in resource_list]
            except (KeyError, TypeError):
                try:
                    return [detour_info(resource['detourInfo'])
                            for resource in resource_list]
                except KeyError:
                    return None
1207326
def GetZipInfo(self):
    
    if not self._zip_info:
      location = getattr(self.path_spec, 'location', None)
      if location is None:
        raise errors.PathSpecError('Path specification missing location.')

      if not location.startswith(self._file_system.LOCATION_ROOT):
        raise errors.PathSpecError('Invalid location in path specification.')

      if len(location) == 1:
        return None

      zip_file = self._file_system.GetZipFile()
      try:
        self._zip_info = zip_file.getinfo(location[1:])
      except KeyError:
        pass

    return self._zip_info
958871
def get_sar_info(self):
        

        try:
            test = self._sarinfo["CPU"]
            del test

        except KeyError:
            file_parsed = self.load_file()
            if file_parsed:
                return self._sarinfo
            else:
                return False

        except:
            ### DEBUG
            traceback.print_exc()
            return False

        return self._sarinfo
1168581
def get_info(self, apply_tag=None, info_dicts=False):
        
        raw_infos = self.fetcher.fetch(*self.info_files)
        raw_info = parse.merge_infos(*raw_infos, info_dicts=info_dicts)
        info = parse.parse_info(raw_info, apply_tag=apply_tag)
        return info
69868
def get_single_file_info(f_path, int_path):
    
    return { 'path'     : force_unicode(int_path),
             'created'  : os.path.getctime(f_path),
             'last_mod' : os.path.getmtime(f_path)}
117850
def infofile_path(self):
        
        return os.path.normpath(os.path.join(
            self.dest_path,
            self.config.info_file
        ))
1021197
def info(self):
        

        return (self.start_pc, self.end_pc,
                self.handler_pc, self.get_catch_type())
343763
def info_hash(self):
        
        if getattr(self, '_data', None):
            return sha1(bencode(self._data['info'])).hexdigest()
        else:
            raise exceptions.TorrentNotGeneratedException
694803
def FileEntryExistsByPathSpec(self, path_spec):
    
    location = getattr(path_spec, 'location', None)

    if (location is None or
        not location.startswith(self.LOCATION_ROOT)):
      return False

    if len(location) == 1:
      return True

    try:
      self._tar_file.getmember(location[1:])
      return True
    except KeyError:
      pass

    # Check if location could be a virtual directory.
    for name in iter(self._tar_file.getnames()):
      # The TAR info name does not have the leading path separator as
      # the location string does.
      if name.startswith(location[1:]):
        return True

    return False
1065639
def list(self, verbose=True):
        
        self._check()

        for tarinfo in self:
            if verbose:
                print(filemode(tarinfo.mode), end=' ')
                print("%s/%s" % (tarinfo.uname or tarinfo.uid,
                                 tarinfo.gname or tarinfo.gid), end=' ')
                if tarinfo.ischr() or tarinfo.isblk():
                    print("%10s" % ("%d,%d" \
                                    % (tarinfo.devmajor, tarinfo.devminor)), end=' ')
                else:
                    print("%10d" % tarinfo.size, end=' ')
                print("%d-%02d-%02d %02d:%02d:%02d" \
                      % time.localtime(tarinfo.mtime)[:6], end=' ')

            print(tarinfo.name + ("/" if tarinfo.isdir() else ""), end=' ')

            if verbose:
                if tarinfo.issym():
                    print("->", tarinfo.linkname, end=' ')
                if tarinfo.islnk():
                    print("link to", tarinfo.linkname, end=' ')
            print()
685324
def is_fifo(self):
        
        try:
            return S_ISFIFO(self.stat().st_mode)
        except OSError as e:
            if e.errno not in (ENOENT, ENOTDIR):
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
73724
def dirinfo(path, opts=None):
    '''
    
    '''
    cmd = 'mfsdirinfo'
    ret = {}
    if opts:
        cmd += ' -' + opts
    cmd += ' ' + path
    out = __salt__['cmd.run_all'](cmd, python_shell=False)

    output = out['stdout'].splitlines()
    for line in output:
        if not line:
            continue
        comps = line.split(':')
        ret[comps[0].strip()] = comps[1].strip()
    return ret
559173
def get_info(self):
        '''
        
        '''
        if not self.info:
            ci = win32pdh.GetCounterInfo(self.handle, 0)
            self.info = {
                'type': ci[0],
                'version': ci[1],
                'scale': ci[2],
                'default_scale': ci[3],
                'user_data': ci[4],
                'query_user_data': ci[5],
                'full_path': ci[6],
                'machine_name': ci[7][0],
                'object_name': ci[7][1],
                'instance_name': ci[7][2],
                'parent_instance': ci[7][3],
                'instance_index': ci[7][4],
                'counter_name': ci[7][5],
                'explain_text': ci[8]
            }
        return self.info