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
d683504b
Kaydet (Commit)
d683504b
authored
Şub 06, 2003
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use new name for GetoptError, and pass it two arguments
Use re module instead of regex
üst
c7557589
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
findlinksto.py
Tools/scripts/findlinksto.py
+5
-5
No files found.
Tools/scripts/findlinksto.py
Dosyayı görüntüle @
d683504b
...
...
@@ -6,21 +6,21 @@
import
os
import
sys
import
re
gex
import
re
import
getopt
def
main
():
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
''
)
if
len
(
args
)
<
2
:
raise
getopt
.
error
,
'not enough arguments'
except
getopt
.
e
rror
,
msg
:
raise
getopt
.
GetoptError
(
'not enough arguments'
,
None
)
except
getopt
.
GetoptE
rror
,
msg
:
sys
.
stdout
=
sys
.
stderr
print
msg
print
'usage: findlinksto pattern directory ...'
sys
.
exit
(
2
)
pat
,
dirs
=
args
[
0
],
args
[
1
:]
prog
=
re
gex
.
compile
(
pat
)
prog
=
re
.
compile
(
pat
)
for
dirname
in
dirs
:
os
.
path
.
walk
(
dirname
,
visit
,
prog
)
...
...
@@ -34,7 +34,7 @@ def visit(prog, dirname, names):
name
=
os
.
path
.
join
(
dirname
,
name
)
try
:
linkto
=
os
.
readlink
(
name
)
if
prog
.
search
(
linkto
)
>=
0
:
if
prog
.
search
(
linkto
)
is
not
None
:
print
name
,
'->'
,
linkto
except
os
.
error
:
pass
...
...
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