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
fff3a1ee
Kaydet (Commit)
fff3a1ee
authored
Nis 06, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added help() fn; use os.sep
üst
e33cb80d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
packmail.py
Lib/lib-old/packmail.py
+17
-2
packmail.py
Lib/packmail.py
+17
-2
No files found.
Lib/lib-old/packmail.py
Dosyayı görüntüle @
fff3a1ee
# Module 'packmail' -- create a shell script out of some files.
# Module 'packmail' -- create a self-unpacking shell archive.
# This module works on UNIX and on the Mac; the archives can unpack
# themselves only on UNIX.
import
os
from
stat
import
ST_MTIME
import
string
# Print help
def
help
():
print
'All fns have a file open for writing as first parameter'
print
'pack(f, fullname, name): pack fullname as name'
print
'packsome(f, directory, namelist): selected files from directory'
print
'packall(f, directory): pack all files from directory'
print
'packnotolder(f, directory, name): pack all files from directory'
print
' that are not older than a file there'
print
'packtree(f, directory): pack entire directory tree'
# Pack one file
def
pack
(
outfp
,
file
,
name
):
fp
=
open
(
file
,
'r'
)
outfp
.
write
(
'echo '
+
name
+
'
\n
'
)
outfp
.
write
(
'sed "s/^X//" >'
+
name
+
' <<"!"
\n
'
)
while
1
:
line
=
fp
.
readline
()
...
...
@@ -15,6 +29,7 @@ def pack(outfp, file, name):
line
=
line
+
'
\n
'
outfp
.
write
(
'X'
+
line
)
outfp
.
write
(
'!
\n
'
)
fp
.
close
()
# Pack some files from a directory
def
packsome
(
outfp
,
dirname
,
names
):
...
...
@@ -64,7 +79,7 @@ def packtree(outfp, dirname):
packtree
(
outfp
,
subdirname
)
def
unixfix
(
name
):
comps
=
string
.
splitfields
(
name
,
':'
)
comps
=
string
.
splitfields
(
name
,
os
.
sep
)
res
=
''
for
comp
in
comps
:
if
comp
:
...
...
Lib/packmail.py
Dosyayı görüntüle @
fff3a1ee
# Module 'packmail' -- create a shell script out of some files.
# Module 'packmail' -- create a self-unpacking shell archive.
# This module works on UNIX and on the Mac; the archives can unpack
# themselves only on UNIX.
import
os
from
stat
import
ST_MTIME
import
string
# Print help
def
help
():
print
'All fns have a file open for writing as first parameter'
print
'pack(f, fullname, name): pack fullname as name'
print
'packsome(f, directory, namelist): selected files from directory'
print
'packall(f, directory): pack all files from directory'
print
'packnotolder(f, directory, name): pack all files from directory'
print
' that are not older than a file there'
print
'packtree(f, directory): pack entire directory tree'
# Pack one file
def
pack
(
outfp
,
file
,
name
):
fp
=
open
(
file
,
'r'
)
outfp
.
write
(
'echo '
+
name
+
'
\n
'
)
outfp
.
write
(
'sed "s/^X//" >'
+
name
+
' <<"!"
\n
'
)
while
1
:
line
=
fp
.
readline
()
...
...
@@ -15,6 +29,7 @@ def pack(outfp, file, name):
line
=
line
+
'
\n
'
outfp
.
write
(
'X'
+
line
)
outfp
.
write
(
'!
\n
'
)
fp
.
close
()
# Pack some files from a directory
def
packsome
(
outfp
,
dirname
,
names
):
...
...
@@ -64,7 +79,7 @@ def packtree(outfp, dirname):
packtree
(
outfp
,
subdirname
)
def
unixfix
(
name
):
comps
=
string
.
splitfields
(
name
,
':'
)
comps
=
string
.
splitfields
(
name
,
os
.
sep
)
res
=
''
for
comp
in
comps
:
if
comp
:
...
...
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