Return the TarInfo's attributes as a dictionary.
(self)
| 1002 | return result |
| 1003 | |
| 1004 | def get_info(self): |
| 1005 | """Return the TarInfo's attributes as a dictionary. |
| 1006 | """ |
| 1007 | if self.mode is None: |
| 1008 | mode = None |
| 1009 | else: |
| 1010 | mode = self.mode & 0o7777 |
| 1011 | info = { |
| 1012 | "name": self.name, |
| 1013 | "mode": mode, |
| 1014 | "uid": self.uid, |
| 1015 | "gid": self.gid, |
| 1016 | "size": self.size, |
| 1017 | "mtime": self.mtime, |
| 1018 | "chksum": self.chksum, |
| 1019 | "type": self.type, |
| 1020 | "linkname": self.linkname, |
| 1021 | "uname": self.uname, |
| 1022 | "gname": self.gname, |
| 1023 | "devmajor": self.devmajor, |
| 1024 | "devminor": self.devminor |
| 1025 | } |
| 1026 | |
| 1027 | if info["type"] == DIRTYPE and not info["name"].endswith("/"): |
| 1028 | info["name"] += "/" |
| 1029 | |
| 1030 | return info |
| 1031 | |
| 1032 | def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape"): |
| 1033 | """Return a tar header as a string of 512 byte blocks. |