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
e7f19200
Kaydet (Commit)
e7f19200
authored
Agu 26, 1999
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Doco update from Sjoerd Mullender.
üst
b35d6846
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
23 deletions
+29
-23
libchunk.tex
Doc/lib/libchunk.tex
+16
-8
libxmllib.tex
Doc/lib/libxmllib.tex
+13
-15
No files found.
Doc/lib/libchunk.tex
Dosyayı görüntüle @
e7f19200
...
@@ -13,16 +13,15 @@ chunks.\footnote{``EA IFF 85'' Standard for Interchange Format Files,
...
@@ -13,16 +13,15 @@ chunks.\footnote{``EA IFF 85'' Standard for Interchange Format Files,
Jerry Morrison, Electronic Arts, January 1985.
}
This format is used
Jerry Morrison, Electronic Arts, January 1985.
}
This format is used
in at least the Audio
\index
{
Audio Interchange File
in at least the Audio
\index
{
Audio Interchange File
Format
}
\index
{
AIFF
}
\index
{
AIFF-C
}
Interchange File Format
Format
}
\index
{
AIFF
}
\index
{
AIFF-C
}
Interchange File Format
(AIFF/AIFF-C), the Real
\index
{
Real Media File Format
}
Media File
(AIFF/AIFF-C) and the Real
\index
{
Real Media File Format
}
Media File
Format
\index
{
RMFF
}
(RMFF), and the
Format
\index
{
RMFF
}
(RMFF). The WAVE audio file format is closely
Tagged
\index
{
Tagged Image File Format
}
Image File Format
\index
{
TIFF
}
related and can also be read using this module.
(TIFF).
A chunk has the following structure:
A chunk has the following structure:
\begin{tableiii}
{
c|c|l
}{
textrm
}{
Offset
}{
Length
}{
Contents
}
\begin{tableiii}
{
c|c|l
}{
textrm
}{
Offset
}{
Length
}{
Contents
}
\lineiii
{
0
}{
4
}{
Chunk ID
}
\lineiii
{
0
}{
4
}{
Chunk ID
}
\lineiii
{
4
}{
4
}{
Size of chunk in big-endian byte order, including the
\lineiii
{
4
}{
4
}{
Size of chunk in big-endian byte order,
not
including the
header
}
header
}
\lineiii
{
8
}{
\var
{
n
}}{
Data bytes, where
\var
{
n
}
is the size given in
\lineiii
{
8
}{
\var
{
n
}}{
Data bytes, where
\var
{
n
}
is the size given in
the preceeding field
}
the preceeding field
}
...
@@ -33,7 +32,7 @@ A chunk has the following structure:
...
@@ -33,7 +32,7 @@ A chunk has the following structure:
The ID is a 4-byte string which identifies the type of chunk.
The ID is a 4-byte string which identifies the type of chunk.
The size field (a 32-bit value, encoded using big-endian byte order)
The size field (a 32-bit value, encoded using big-endian byte order)
gives the size of the
whole chunk,
including the 8-byte header.
gives the size of the
chunk data, not
including the 8-byte header.
Usually an IFF-type file consists of one or more chunks. The proposed
Usually an IFF-type file consists of one or more chunks. The proposed
usage of the
\class
{
Chunk
}
class defined here is to instantiate an
usage of the
\class
{
Chunk
}
class defined here is to instantiate an
...
@@ -42,7 +41,7 @@ it reaches the end, after which a new instance can be instantiated.
...
@@ -42,7 +41,7 @@ it reaches the end, after which a new instance can be instantiated.
At the end of the file, creating a new instance will fail with a
At the end of the file, creating a new instance will fail with a
\exception
{
EOFError
}
exception.
\exception
{
EOFError
}
exception.
\begin{classdesc}
{
Chunk
}{
file
\optional
{
, align
}}
\begin{classdesc}
{
Chunk
}{
file
\optional
{
, align
, bigendian, inclheader
}}
Class which represents a chunk. The
\var
{
file
}
argument is expected
Class which represents a chunk. The
\var
{
file
}
argument is expected
to be a file-like object. An instance of this class is specifically
to be a file-like object. An instance of this class is specifically
allowed. The only method that is needed is
\method
{
read()
}
. If the
allowed. The only method that is needed is
\method
{
read()
}
. If the
...
@@ -51,7 +50,12 @@ raise an exception, they are also used. If these methods are present
...
@@ -51,7 +50,12 @@ raise an exception, they are also used. If these methods are present
and raise an exception, they are expected to not have altered the
and raise an exception, they are expected to not have altered the
object. If the optional argument
\var
{
align
}
is true, chunks are
object. If the optional argument
\var
{
align
}
is true, chunks are
assumed to be aligned on 2-byte boundaries. If
\var
{
align
}
is
assumed to be aligned on 2-byte boundaries. If
\var
{
align
}
is
false, no alignment is assumed. The default value is true.
false, no alignment is assumed. The default value is true. If the
optional argument
\var
{
bigendian
}
is false, the chunk size is assumed
to be in little-endian order. This is needed for WAVE audio files.
The default value is true. If the optional argument
\var
{
inclheader
}
is true, the size given in the chunk header includes the size of the
header. The default value is false.
\end{classdesc}
\end{classdesc}
A
\class
{
Chunk
}
object supports the following methods:
A
\class
{
Chunk
}
object supports the following methods:
...
@@ -61,6 +65,10 @@ Returns the name (ID) of the chunk. This is the first 4 bytes of the
...
@@ -61,6 +65,10 @@ Returns the name (ID) of the chunk. This is the first 4 bytes of the
chunk.
chunk.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
getsize
}{}
Returns the size of the chunk.
\end{methoddesc}
\begin{methoddesc}
{
close
}{}
\begin{methoddesc}
{
close
}{}
Close and skip to the end of the chunk. This does not close the
Close and skip to the end of the chunk. This does not close the
underlying file.
underlying file.
...
...
Doc/lib/libxmllib.tex
Dosyayı görüntüle @
e7f19200
...
@@ -16,7 +16,18 @@ This module defines a class \class{XMLParser} which serves as the basis
...
@@ -16,7 +16,18 @@ This module defines a class \class{XMLParser} which serves as the basis
for parsing text files formatted in XML (Extensible Markup Language).
for parsing text files formatted in XML (Extensible Markup Language).
\begin{classdesc}
{
XMLParser
}{}
\begin{classdesc}
{
XMLParser
}{}
The
\class
{
XMLParser
}
class must be instantiated without arguments.
The
\class
{
XMLParser
}
class must be instantiated without
arguments.
\footnote
{
Actually, a number of keyword arguments are
recognized which influence the parser to accept certain non-standard
constructs. The following keyword arguments are currently
recognized. The defaults for all of these is
\code
{
0
}
(false).
\var
{
accept
_
unquoted
_
attributes
}
(accept certain attribute values
without requiring quotes),
\var
{
accept
_
missing
_
endtag
_
name
}
(accept
end tags that look like
\code
{
</>
}
),
\var
{
map
_
case
}
(map upper case to
lower case in tags and attributes),
\var
{
accept
_
utf8
}
(allow UTF-8
characters in input; this is required according to the XML standard,
but Python does not as yet deal properly with these characters, so
this is not the default).
}
\end{classdesc}
\end{classdesc}
This class provides the following interface methods and instance variables:
This class provides the following interface methods and instance variables:
...
@@ -140,19 +151,6 @@ subclass must override this method to provide support for character
...
@@ -140,19 +151,6 @@ subclass must override this method to provide support for character
references outside of the
\ASCII
{}
range.
references outside of the
\ASCII
{}
range.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
handle
_
entityref
}{
ref
}
This method is called to process a general entity reference of the
form
\samp
{
\&\var
{
ref
}
;
}
where
\var
{
ref
}
is an general entity
reference. It looks for
\var
{
ref
}
in the instance (or class)
variable
\member
{
entitydefs
}
which should be a mapping from entity
names to corresponding translations.
If a translation is found, it calls the method
\method
{
handle
_
data()
}
with the translation; otherwise, it calls the method
\code
{
unknown
_
entityref(
\var
{
ref
}
)
}
. The default
\member
{
entitydefs
}
defines translations for
\code
{
\&
amp;
}
,
\code
{
\&
apos
}
,
\code
{
\&
gt;
}
,
\code
{
\&
lt;
}
, and
\code
{
\&
quot;
}
.
\end{methoddesc}
\begin{methoddesc}
{
handle
_
comment
}{
comment
}
\begin{methoddesc}
{
handle
_
comment
}{
comment
}
This method is called when a comment is encountered. The
This method is called when a comment is encountered. The
\var
{
comment
}
argument is a string containing the text between the
\var
{
comment
}
argument is a string containing the text between the
...
@@ -223,7 +221,7 @@ base class implementation does nothing.
...
@@ -223,7 +221,7 @@ base class implementation does nothing.
\begin{methoddesc}
{
unknown
_
entityref
}{
ref
}
\begin{methoddesc}
{
unknown
_
entityref
}{
ref
}
This method is called to process an unknown entity reference. It is
This method is called to process an unknown entity reference. It is
intended to be overridden by a derived class; the base class
intended to be overridden by a derived class; the base class
implementation
does nothing
.
implementation
calls
\method
{
syntax
_
error()
}
to signal an error
.
\end{methoddesc}
\end{methoddesc}
...
...
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