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
4755e7d5
Kaydet (Commit)
4755e7d5
authored
Haz 21, 1999
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Three more modules documented by Moshe!
üst
1de2a927
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
197 additions
and
0 deletions
+197
-0
lib.tex
Doc/lib/lib.tex
+3
-0
libpipes.tex
Doc/lib/libpipes.tex
+84
-0
librlcompleter.tex
Doc/lib/librlcompleter.tex
+59
-0
libstatvfs.tex
Doc/lib/libstatvfs.tex
+51
-0
No files found.
Doc/lib/lib.tex
Dosyayı görüntüle @
4755e7d5
...
...
@@ -131,6 +131,7 @@ add new extensions to Python and how to embed it in other applications.
\input
{
libdircache
}
\input
{
libstat
}
\input
{
libstatcache
}
\input
{
libstatvfs
}
\input
{
libcmp
}
\input
{
libcmpcache
}
\input
{
libtime
}
...
...
@@ -156,6 +157,7 @@ add new extensions to Python and how to embed it in other applications.
\input
{
libbsddb
}
\input
{
libzlib
}
\input
{
libgzip
}
\input
{
librlcompleter
}
\input
{
libunix
}
% UNIX Specific Services
\input
{
libposix
}
...
...
@@ -166,6 +168,7 @@ add new extensions to Python and how to embed it in other applications.
\input
{
libgdbm
}
\input
{
libtermios
}
\input
{
libfcntl
}
\input
{
libpipes
}
\input
{
libposixfile
}
\input
{
libresource
}
\input
{
libsyslog
}
...
...
Doc/lib/libpipes.tex
0 → 100644
Dosyayı görüntüle @
4755e7d5
\section
{
\module
{
pipes
}
---
Interface to shell pipelines
}
\declaremodule
{
standard
}{
pipes
}
\platform
{
Unix
}
\sectionauthor
{
Moshe Zadka
}{
mzadka@geocities.com
}
\modulesynopsis
{
A Python interface to
\UNIX
{}
shell pipelines.
}
The
\module
{
pipes
}
module defines a class to abstract the concept of
a
\emph
{
pipeline
}
--- a sequence of convertors from one file to
another.
Because the module uses
\program
{
/bin/sh
}
command lines, a
\POSIX
{}
or
compatible shell for
\function
{
os.system()
}
and
\function
{
os.popen()
}
is required.
The
\module
{
pipes
}
module defines the following class:
\begin{classdesc}
{
Template
}{}
An abstraction of a pipeline.
\end{funcdesc}
Example:
\begin{verbatim}
>>> import pipes
>>> t=pipes.Template()
>>> t.append('tr a-z A-Z', '--')
>>> f=t.open('/tmp/1', 'w')
>>> f.write('hello world')
>>> f.close()
>>> open('/tmp/1').read()
'HELLO WORLD'
\end{verbatim}
\subsection
{
Template Objects
\label
{
template-objects
}}
Template objects following methods:
\begin{methoddesc}
{
reset
}{}
Restore a pipeline template to its initial state.
\end{methoddesc}
\begin{methoddesc}
{
clone
}{}
Return a new, equivalent, pipeline template.
\end{methoddesc}
\begin{methoddesc}
{
debug
}{
flag
}
If
\var
{
flag
}
is true, turn debugging on. Otherwise, turn debugging
off. When debugging is on, commands to be executed are printed, and
the shell is given
\code
{
set -x
}
command to be more verbose.
\end{methoddesc}
\begin{methoddesc}
{
append
}{
cmd, kind
}
Append a new action at the end. The
\var
{
cmd
}
variable must be a valid
bourne shell command. The
\var
{
kind
}
variable consists of two letters.
The first letter can be either of
\code
{
'-'
}
(which means the command
reads its standard input),
\code
{
'f'
}
(which means the commands reads
a given file on the command line) or
\code
{
'.'
}
(which means the commands
reads no input, and hence must be first.)
Similarily, the second letter can be either of
\code
{
'-'
}
(which means
the command writes to standard output),
\code
{
'f'
}
(which means the
command writes a file on the command line) or
\code
{
'.'
}
(which means
the command does not write anything, and hence must be last.)
\end{methoddesc}
\begin{methoddesc}
{
prepend
}{
cmd, kind
}
Add a new action at the beginning. See
\method
{
append()
}
for explanations
of the arguments.
\end{methoddesc}
\begin{methoddesc}
{
open
}{
file, mode
}
Return a file-like object, open to
\var
{
file
}
, but read from or
written to by the pipeline. Note that only one of
\code
{
'r'
}
,
\code
{
'w'
}
may be given.
\end{methoddesc}
\begin{methoddesc}
{
copy
}{
infile, outfile
}
Copy
\var
{
infile
}
to
\var
{
outfile
}
through the pipe.
\end{methoddesc}
Doc/lib/librlcompleter.tex
0 → 100644
Dosyayı görüntüle @
4755e7d5
\section
{
\module
{
rlcompleter
}
---
Completion function for readline
}
\declaremodule
{
standard
}{
rlcompleter
}
\sectionauthor
{
Moshe Zadka
}{
mzadka@geocities.com
}
\modulesynopsis
{
Python identifier completion in the readline library.
}
The
\module
{
rlcompleter
}
module defines a completion function for
the
\module
{
readline
}
module by completing valid Python identifiers and
keyword.
The
\module
{
rlcompleter
}
module defines the
\class
{
Completer
}
class.
Example:
\begin{verbatim}
>>> import rlcompleter
>>> import readline
>>> readline.parse
_
and
_
bind("tab: complete")
>>> readline. <TAB PRESSED>
readline.
__
doc
__
readline.get
_
line
_
buffer readline.read
_
init
_
file
readline.
__
file
__
readline.insert
_
text readline.set
_
completer
readline.
__
name
__
readline.parse
_
and
_
bind
>>> readline.
\end{verbatim}
The
\module
{
rlcompleter
}
module is designed for use with Python's
interactive mode. A user can add the following lines to his or her
initialization file (identified by the
\envvar
{
PYTHONSTARTUP
}
environment variable) to get automatic
\kbd
{
Tab
}
completion:
\begin{verbatim}
try:
import readline
except ImportError:
print "Module readline not available."
else:
import rlcompleter
readline.parse
_
and
_
bind("tab: complete")
\end{verbatim}
\subsection
{
Completer Objects
\label
{
completer-objects
}}
Completer objects have the following method:
\begin{methoddesc}
[Completer]
{
complete
}{
text, state
}
Return the
\var
{
state
}
th completion for
\var
{
text
}
.
If called for
\var
{
text
}
that doesn't includea period character
(
\character
{
.
}
), it will complete from names currently defined in
\refmodule
{__
main
__}
,
\refmodule
{__
builtin
__}
and keywords (as defined
by the
\refmodule
{
keyword
}
module).
If called for a dotted name, it will try to evaluate anything without
obvious side-effects (i.e., functions will not be evaluated, but it
can generate calls to
\method
{__
getattr
__
()
}
) upto the last part, and
find matches for the rest via the
\function
{
dir()
}
function.
\end{methoddesc}
Doc/lib/libstatvfs.tex
0 → 100644
Dosyayı görüntüle @
4755e7d5
\section
{
\module
{
statvfs
}
---
Constants used with
\function
{
os.statvfs()
}}
\declaremodule
{
standard
}{
statvfs
}
% LaTeX'ed from comments in module
\sectionauthor
{
Moshe Zadka
}{
mzadka@geocities.com
}
\modulesynopsis
{
Constants for interpreting the result of
\function
{
os.statvfs()
}
.
}
The
\module
{
statvfs
}
module defines constants so interpreting the result
if
\function
{
os.statvfs()
}
, which returns a tuple, can be made without
remembering ``magic numbers.'' Each of the constants defined in this
module is the
\emph
{
index
}
of the entry in the tuple returned by
\function
{
os.statvfs()
}
that contains the specified information.
\begin{datadesc}
{
F
_
BSIZE
}
Preferred file system block size.
\end{datadesc}
\begin{datadesc}
{
F
_
FRSIZE
}
Fundamental file system block size.
\end{datadesc}
\begin{datadesc}
{
F
_
BFREE
}
Total number of free blocks.
\end{datadesc}
\begin{datadesc}
{
F
_
BAVAIL
}
Free blocks available to non-super user.
\end{datadesc}
\begin{datadesc}
{
F
_
FILES
}
Total number of file nodes.
\end{datadesc}
\begin{datadesc}
{
F
_
FFREE
}
Total number of free file nodes.
\end{datadesc}
\begin{datadesc}
{
F
_
FAVAIL
}
Free nodes available to non-superuser.
\end{datadesc}
\begin{datadesc}
{
F
_
FLAG
}
Flags. System dependant: see
\cfunction
{
statvfs()
}
man page.
\end{datadesc}
\begin{datadesc}
{
F
_
NAMEMAX
}
Maximum file name length.
\end{datadesc}
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