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
ca83f018
Kaydet (Commit)
ca83f018
authored
Kas 24, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added "-n file" option to only print files newer than the given file.
üst
e2d4dd19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
4 deletions
+37
-4
cvsfiles.py
Tools/scripts/cvsfiles.py
+37
-4
No files found.
Tools/scripts/cvsfiles.py
Dosyayı görüntüle @
ca83f018
#! /usr/bin/env python
"""Create a list of files that are mentioned in CVS directories."""
"""Print a list of files that are mentioned in CVS directories.
Usage: cvsfiles.py [-n file] [directory] ...
If the '-n file' option is given, only files under CVS that are newer
than the given file are printed; by default, all files under CVS are
printed. As a special case, if a file does not exist, it is always
printed.
"""
import
os
import
sys
import
stat
import
getopt
import
string
cutofftime
=
0
def
main
():
args
=
sys
.
argv
[
1
:]
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"n:"
)
except
getopt
.
error
,
msg
:
print
msg
print
__doc__
,
return
1
global
cutofftime
newerfile
=
None
for
o
,
a
in
opts
:
if
o
==
'-n'
:
cutofftime
=
getmtime
(
a
)
if
args
:
for
arg
in
args
:
process
(
arg
)
...
...
@@ -32,8 +54,19 @@ def process(dir):
words
=
string
.
split
(
e
,
'/'
)
if
words
[
0
]
==
''
and
words
[
1
:]:
name
=
words
[
1
]
print
os
.
path
.
join
(
dir
,
name
)
fullname
=
os
.
path
.
join
(
dir
,
name
)
if
cutofftime
and
getmtime
(
fullname
)
<=
cutofftime
:
pass
else
:
print
fullname
for
sub
in
subdirs
:
process
(
sub
)
main
()
def
getmtime
(
filename
):
try
:
st
=
os
.
stat
(
filename
)
except
os
.
error
:
return
0
return
st
[
stat
.
ST_MTIME
]
sys
.
exit
(
main
())
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