Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
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ç
LibreOffice
core
Commits
9983c58c
Kaydet (Commit)
9983c58c
authored
Eki 06, 2015
tarafından
Samuel Mehrbrodt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add script to find duplicate icons
Change-Id: I1a314d1ca98194eaef7c27ab9b1f3cef08cc0f12
üst
a6b42f91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
find-duplicated-files.py
bin/find-duplicated-files.py
+43
-0
No files found.
bin/find-duplicated-files.py
0 → 100755
Dosyayı görüntüle @
9983c58c
#!/usr/bin/env python3
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import
os
import
sys
from
filecmp
import
dircmp
"""
This script compares two directories and lists the files which are the same in both directories.
Intended to find duplicate icons among icon themes.
Adopted from the example at https://docs.python.org/3.5/library/filecmp.html
Usage: ./bin/findduplicatefiles dir1 dir2
"""
def
print_diff_files
(
dcmp
):
for
name
in
dcmp
.
same_files
:
print
(
"
%
s found in
%
s and
%
s"
%
(
name
,
dcmp
.
left
,
dcmp
.
right
))
for
sub_dcmp
in
dcmp
.
subdirs
.
values
():
print_diff_files
(
sub_dcmp
)
if
len
(
sys
.
argv
)
!=
3
:
print
(
"Usage:
%
s dir1 dir2"
%
sys
.
argv
[
0
])
exit
()
dir1
=
sys
.
argv
[
1
]
dir2
=
sys
.
argv
[
2
]
if
not
os
.
path
.
isdir
(
dir1
)
or
not
os
.
path
.
isdir
(
dir2
):
print
(
"Arguments must be directories!"
)
exit
()
dcmp
=
dircmp
(
dir1
,
dir2
)
print_diff_files
(
dcmp
)
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