Return a deep copy of self with the given attributes replaced.
(self, *,
name=_KEEP, mtime=_KEEP, mode=_KEEP, linkname=_KEEP,
uid=_KEEP, gid=_KEEP, uname=_KEEP, gname=_KEEP,
deep=True, _KEEP=_KEEP)
| 923 | return "<%s %r at %#x>" % (self.__class__.__name__,self.name,id(self)) |
| 924 | |
| 925 | def replace(self, *, |
| 926 | name=_KEEP, mtime=_KEEP, mode=_KEEP, linkname=_KEEP, |
| 927 | uid=_KEEP, gid=_KEEP, uname=_KEEP, gname=_KEEP, |
| 928 | deep=True, _KEEP=_KEEP): |
| 929 | """Return a deep copy of self with the given attributes replaced. |
| 930 | """ |
| 931 | if deep: |
| 932 | result = copy.deepcopy(self) |
| 933 | else: |
| 934 | result = copy.copy(self) |
| 935 | if name is not _KEEP: |
| 936 | result.name = name |
| 937 | if mtime is not _KEEP: |
| 938 | result.mtime = mtime |
| 939 | if mode is not _KEEP: |
| 940 | result.mode = mode |
| 941 | if linkname is not _KEEP: |
| 942 | result.linkname = linkname |
| 943 | if uid is not _KEEP: |
| 944 | result.uid = uid |
| 945 | if gid is not _KEEP: |
| 946 | result.gid = gid |
| 947 | if uname is not _KEEP: |
| 948 | result.uname = uname |
| 949 | if gname is not _KEEP: |
| 950 | result.gname = gname |
| 951 | return result |
| 952 | |
| 953 | def get_info(self): |
| 954 | """Return the TarInfo's attributes as a dictionary. |
no test coverage detected