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
9a6757da
Kaydet (Commit)
9a6757da
authored
Mar 30, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
posix -> os
üst
391b8b7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
byteyears.py
Tools/scripts/byteyears.py
+5
-5
checkpyc.py
Tools/scripts/checkpyc.py
+7
-8
copytime.py
Tools/scripts/copytime.py
+5
-5
No files found.
Tools/scripts/byteyears.py
Dosyayı görüntüle @
9a6757da
...
...
@@ -6,15 +6,15 @@
#
# Options -[amc] select atime, mtime (default) or ctime as age.
import
sys
,
posix
,
time
import
sys
,
os
,
time
import
string
from
stat
import
*
# Use lstat() to stat files if it exists, else stat()
try
:
statfunc
=
posix
.
lstat
except
Nam
eError
:
statfunc
=
posix
.
stat
statfunc
=
os
.
lstat
except
Attribut
eError
:
statfunc
=
os
.
stat
# Parse options
if
sys
.
argv
[
1
]
==
'-m'
:
...
...
@@ -42,7 +42,7 @@ for file in sys.argv[1:]:
for
file
in
sys
.
argv
[
1
:]:
try
:
st
=
statfunc
(
file
)
except
posix
.
error
,
msg
:
except
os
.
error
,
msg
:
sys
.
stderr
.
write
(
'can
\'
t stat '
+
`file`
+
': '
+
`msg`
+
'
\n
'
)
status
=
1
st
=
()
...
...
Tools/scripts/checkpyc.py
Dosyayı görüntüle @
9a6757da
# Check that all ".pyc" files exist and are up-to-date
# Uses module '
posix
'
# Uses module '
os
'
import
sys
import
posix
import
path
import
os
from
stat
import
ST_MTIME
def
main
():
...
...
@@ -24,8 +23,8 @@ def main():
print
'Using MAGIC word'
,
`MAGIC`
for
dirname
in
sys
.
path
:
try
:
names
=
posix
.
listdir
(
dirname
)
except
posix
.
error
:
names
=
os
.
listdir
(
dirname
)
except
os
.
error
:
print
'Cannot list directory'
,
`dirname`
continue
if
not
silent
:
...
...
@@ -33,10 +32,10 @@ def main():
names
.
sort
()
for
name
in
names
:
if
name
[
-
3
:]
==
'.py'
:
name
=
path
.
join
(
dirname
,
name
)
name
=
os
.
path
.
join
(
dirname
,
name
)
try
:
st
=
posix
.
stat
(
name
)
except
posix
.
error
:
st
=
os
.
stat
(
name
)
except
os
.
error
:
print
'Cannot stat'
,
`name`
continue
if
verbose
:
...
...
Tools/scripts/copytime.py
Dosyayı görüntüle @
9a6757da
...
...
@@ -3,7 +3,7 @@
# Copy one file's atime and mtime to another
import
sys
import
posix
import
os
from
stat
import
ST_ATIME
,
ST_MTIME
# Really constants 7 and 8
def
main
():
...
...
@@ -12,13 +12,13 @@ def main():
sys
.
exit
(
2
)
file1
,
file2
=
sys
.
argv
[
1
],
sys
.
argv
[
2
]
try
:
stat1
=
posix
.
stat
(
file1
)
except
posix
.
error
:
stat1
=
os
.
stat
(
file1
)
except
os
.
error
:
sys
.
stderr
.
write
(
file1
+
': cannot stat
\n
'
)
sys
.
exit
(
1
)
try
:
posix
.
utime
(
file2
,
(
stat1
[
ST_ATIME
],
stat1
[
ST_MTIME
]))
except
posix
.
error
:
os
.
utime
(
file2
,
(
stat1
[
ST_ATIME
],
stat1
[
ST_MTIME
]))
except
os
.
error
:
sys
.
stderr
.
write
(
file2
+
': cannot change time
\n
'
)
sys
.
exit
(
2
)
...
...
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