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
a2637729
Kaydet (Commit)
a2637729
authored
Haz 22, 2012
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7582: Use ISO timestamp in diff.py
üst
ff493c9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
diff.py
Tools/scripts/diff.py
+12
-4
No files found.
Tools/scripts/diff.py
Dosyayı görüntüle @
a2637729
...
@@ -9,6 +9,12 @@
...
@@ -9,6 +9,12 @@
"""
"""
import
sys
,
os
,
time
,
difflib
,
optparse
import
sys
,
os
,
time
,
difflib
,
optparse
from
datetime
import
datetime
,
timezone
def
file_mtime
(
path
):
t
=
datetime
.
fromtimestamp
(
os
.
stat
(
path
)
.
st_mtime
,
timezone
.
utc
)
return
t
.
astimezone
()
.
isoformat
()
def
main
():
def
main
():
...
@@ -30,10 +36,12 @@ def main():
...
@@ -30,10 +36,12 @@ def main():
n
=
options
.
lines
n
=
options
.
lines
fromfile
,
tofile
=
args
fromfile
,
tofile
=
args
fromdate
=
time
.
ctime
(
os
.
stat
(
fromfile
)
.
st_mtime
)
fromdate
=
file_mtime
(
fromfile
)
todate
=
time
.
ctime
(
os
.
stat
(
tofile
)
.
st_mtime
)
todate
=
file_mtime
(
tofile
)
fromlines
=
open
(
fromfile
,
'U'
)
.
readlines
()
with
open
(
fromfile
,
'U'
)
as
ff
:
tolines
=
open
(
tofile
,
'U'
)
.
readlines
()
fromlines
=
ff
.
readlines
()
with
open
(
tofile
,
'U'
)
as
tf
:
tolines
=
tf
.
readlines
()
if
options
.
u
:
if
options
.
u
:
diff
=
difflib
.
unified_diff
(
fromlines
,
tolines
,
fromfile
,
tofile
,
fromdate
,
todate
,
n
=
n
)
diff
=
difflib
.
unified_diff
(
fromlines
,
tolines
,
fromfile
,
tofile
,
fromdate
,
todate
,
n
=
n
)
...
...
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