Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a694f239
Unverified
Kaydet (Commit)
a694f239
authored
Mar 27, 2019
tarafından
Raymond Hettinger
Kaydeden (comit)
GitHub
Mar 27, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add missing docstrings for TarInfo objects (#12555)
üst
d929f183
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
9 deletions
+48
-9
pydoc.py
Lib/pydoc.py
+2
-2
tarfile.py
Lib/tarfile.py
+46
-7
No files found.
Lib/pydoc.py
Dosyayı görüntüle @
a694f239
...
...
@@ -997,8 +997,8 @@ class HTMLDoc(Doc):
if
name
:
push
(
'<dl><dt><strong>
%
s</strong></dt>
\n
'
%
name
)
if
object
.
__doc__
is
not
None
:
doc
=
self
.
markup
(
getdoc
(
object
),
self
.
preformat
)
doc
=
self
.
markup
(
getdoc
(
object
),
self
.
preformat
)
if
doc
:
push
(
'<dd><tt>
%
s</tt></dd>
\n
'
%
doc
)
push
(
'</dl>
\n
'
)
...
...
Lib/tarfile.py
Dosyayı görüntüle @
a694f239
...
...
@@ -717,11 +717,32 @@ class TarInfo(object):
usually created internally.
"""
__slots__
=
(
"name"
,
"mode"
,
"uid"
,
"gid"
,
"size"
,
"mtime"
,
"chksum"
,
"type"
,
"linkname"
,
"uname"
,
"gname"
,
"devmajor"
,
"devminor"
,
"offset"
,
"offset_data"
,
"pax_headers"
,
"sparse"
,
"tarfile"
,
"_sparse_structs"
,
"_link_target"
)
__slots__
=
dict
(
name
=
'Name of the archive member.'
,
mode
=
'Permission bits.'
,
uid
=
'User ID of the user who originally stored this member.'
,
gid
=
'Group ID of the user who originally stored this member.'
,
size
=
'Size in bytes.'
,
mtime
=
'Time of last modification.'
,
chksum
=
'Header checksum.'
,
type
=
(
'File type. type is usually one of these constants: '
'REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, '
'CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.'
),
linkname
=
(
'Name of the target file name, which is only present '
'in TarInfo objects of type LNKTYPE and SYMTYPE.'
),
uname
=
'User name.'
,
gname
=
'Group name.'
,
devmajor
=
'Device major number.'
,
devminor
=
'Device minor number.'
,
offset
=
'The tar header starts here.'
,
offset_data
=
"The file's data starts here."
,
pax_headers
=
(
'A dictionary containing key-value pairs of an '
'associated pax extended header.'
),
sparse
=
'Sparse member information.'
,
tarfile
=
None
,
_sparse_structs
=
None
,
_link_target
=
None
,
)
def
__init__
(
self
,
name
=
""
):
"""Construct a TarInfo object. name is the optional name
...
...
@@ -747,10 +768,9 @@ class TarInfo(object):
self
.
sparse
=
None
# sparse member information
self
.
pax_headers
=
{}
# pax header information
# In pax headers the "name" and "linkname" field are called
# "path" and "linkpath".
@property
def
path
(
self
):
'In pax headers, "name" is called "path".'
return
self
.
name
@path.setter
...
...
@@ -759,6 +779,7 @@ class TarInfo(object):
@property
def
linkpath
(
self
):
'In pax headers, "linkname" is called "linkpath".'
return
self
.
linkname
@linkpath.setter
...
...
@@ -1350,24 +1371,42 @@ class TarInfo(object):
return
blocks
*
BLOCKSIZE
def
isreg
(
self
):
'Return True if the Tarinfo object is a regular file.'
return
self
.
type
in
REGULAR_TYPES
def
isfile
(
self
):
'Return True if the Tarinfo object is a regular file.'
return
self
.
isreg
()
def
isdir
(
self
):
'Return True if it is a directory.'
return
self
.
type
==
DIRTYPE
def
issym
(
self
):
'Return True if it is a symbolic link.'
return
self
.
type
==
SYMTYPE
def
islnk
(
self
):
'Return True if it is a hard link.'
return
self
.
type
==
LNKTYPE
def
ischr
(
self
):
'Return True if it is a character device.'
return
self
.
type
==
CHRTYPE
def
isblk
(
self
):
'Return True if it is a block device.'
return
self
.
type
==
BLKTYPE
def
isfifo
(
self
):
'Return True if it is a FIFO.'
return
self
.
type
==
FIFOTYPE
def
issparse
(
self
):
return
self
.
sparse
is
not
None
def
isdev
(
self
):
'Return True if it is one of character device, block device or FIFO.'
return
self
.
type
in
(
CHRTYPE
,
BLKTYPE
,
FIFOTYPE
)
# class TarInfo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment