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
dcd3a875
Kaydet (Commit)
dcd3a875
authored
Şub 09, 2001
tarafından
Eric S. Raymond
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String method conversion.
üst
62f1a23a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
25 deletions
+23
-25
cddb.py
Lib/plat-irix5/cddb.py
+11
-12
cddb.py
Lib/plat-irix6/cddb.py
+12
-13
No files found.
Lib/plat-irix5/cddb.py
Dosyayı görüntüle @
dcd3a875
...
@@ -30,8 +30,8 @@ def tochash(toc):
...
@@ -30,8 +30,8 @@ def tochash(toc):
tracklist
=
[]
tracklist
=
[]
for
i
in
range
(
2
,
len
(
toc
),
4
):
for
i
in
range
(
2
,
len
(
toc
),
4
):
tracklist
.
append
((
None
,
tracklist
.
append
((
None
,
(
string
.
atoi
(
toc
[
i
:
i
+
2
]),
(
int
(
toc
[
i
:
i
+
2
]),
string
.
atoi
(
toc
[
i
+
2
:
i
+
4
]))))
int
(
toc
[
i
+
2
:
i
+
4
]))))
else
:
else
:
tracklist
=
toc
tracklist
=
toc
ntracks
=
len
(
tracklist
)
ntracks
=
len
(
tracklist
)
...
@@ -58,7 +58,7 @@ class Cddb:
...
@@ -58,7 +58,7 @@ class Cddb:
def
__init__
(
self
,
tracklist
):
def
__init__
(
self
,
tracklist
):
if
os
.
environ
.
has_key
(
'CDDB_PATH'
):
if
os
.
environ
.
has_key
(
'CDDB_PATH'
):
path
=
os
.
environ
[
'CDDB_PATH'
]
path
=
os
.
environ
[
'CDDB_PATH'
]
cddb_path
=
string
.
splitfields
(
path
,
','
)
cddb_path
=
path
.
split
(
','
)
else
:
else
:
home
=
os
.
environ
[
'HOME'
]
home
=
os
.
environ
[
'HOME'
]
cddb_path
=
[
home
+
'/'
+
_cddbrc
]
cddb_path
=
[
home
+
'/'
+
_cddbrc
]
...
@@ -73,7 +73,7 @@ class Cddb:
...
@@ -73,7 +73,7 @@ class Cddb:
break
break
except
IOError
:
except
IOError
:
pass
pass
ntracks
=
string
.
atoi
(
self
.
id
[:
2
],
16
)
ntracks
=
int
(
self
.
id
[:
2
],
16
)
self
.
artist
=
''
self
.
artist
=
''
self
.
title
=
''
self
.
title
=
''
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
...
@@ -106,7 +106,7 @@ class Cddb:
...
@@ -106,7 +106,7 @@ class Cddb:
self
.
notes
.
append
(
value
)
self
.
notes
.
append
(
value
)
elif
name1
[:
5
]
==
'track'
:
elif
name1
[:
5
]
==
'track'
:
try
:
try
:
trackno
=
string
.
atoi
(
name1
[
5
:])
trackno
=
int
(
name1
[
5
:])
except
strings
.
atoi_error
:
except
strings
.
atoi_error
:
print
'syntax error in '
+
file
print
'syntax error in '
+
file
continue
continue
...
@@ -126,9 +126,8 @@ class Cddb:
...
@@ -126,9 +126,8 @@ class Cddb:
# of previous track's title
# of previous track's title
if
track
and
track
[
0
]
==
','
:
if
track
and
track
[
0
]
==
','
:
try
:
try
:
off
=
string
.
index
(
self
.
track
[
i
-
1
],
off
=
self
.
track
[
i
-
1
]
.
index
(
','
)
','
)
except
ValueError
:
except
string
.
index_error
:
pass
pass
else
:
else
:
self
.
track
[
i
]
=
self
.
track
[
i
-
1
][:
off
]
\
self
.
track
[
i
]
=
self
.
track
[
i
-
1
][:
off
]
\
...
@@ -146,8 +145,8 @@ class Cddb:
...
@@ -146,8 +145,8 @@ class Cddb:
t
=
[]
t
=
[]
for
i
in
range
(
2
,
len
(
tracklist
),
4
):
for
i
in
range
(
2
,
len
(
tracklist
),
4
):
t
.
append
((
None
,
\
t
.
append
((
None
,
\
(
string
.
atoi
(
tracklist
[
i
:
i
+
2
]),
\
(
int
(
tracklist
[
i
:
i
+
2
]),
\
string
.
atoi
(
tracklist
[
i
+
2
:
i
+
4
]))))
int
(
tracklist
[
i
+
2
:
i
+
4
]))))
tracklist
=
t
tracklist
=
t
ntracks
=
len
(
tracklist
)
ntracks
=
len
(
tracklist
)
self
.
id
=
_dbid
((
ntracks
>>
4
)
&
0xF
)
+
_dbid
(
ntracks
&
0xF
)
self
.
id
=
_dbid
((
ntracks
>>
4
)
&
0xF
)
+
_dbid
(
ntracks
&
0xF
)
...
@@ -195,8 +194,8 @@ class Cddb:
...
@@ -195,8 +194,8 @@ class Cddb:
f
.
write
(
'track'
+
`i`
+
'.artist:
\t
'
+
self
.
trackartist
[
i
]
+
'
\n
'
)
f
.
write
(
'track'
+
`i`
+
'.artist:
\t
'
+
self
.
trackartist
[
i
]
+
'
\n
'
)
track
=
self
.
track
[
i
]
track
=
self
.
track
[
i
]
try
:
try
:
off
=
string
.
index
(
track
,
','
)
off
=
track
.
index
(
','
)
except
string
.
index_e
rror
:
except
ValuE
rror
:
prevpref
=
None
prevpref
=
None
else
:
else
:
if
prevpref
and
track
[:
off
]
==
prevpref
:
if
prevpref
and
track
[:
off
]
==
prevpref
:
...
...
Lib/plat-irix6/cddb.py
Dosyayı görüntüle @
dcd3a875
...
@@ -30,8 +30,8 @@ def tochash(toc):
...
@@ -30,8 +30,8 @@ def tochash(toc):
tracklist
=
[]
tracklist
=
[]
for
i
in
range
(
2
,
len
(
toc
),
4
):
for
i
in
range
(
2
,
len
(
toc
),
4
):
tracklist
.
append
((
None
,
tracklist
.
append
((
None
,
(
string
.
atoi
(
toc
[
i
:
i
+
2
]),
(
int
(
toc
[
i
:
i
+
2
]),
string
.
atoi
(
toc
[
i
+
2
:
i
+
4
]))))
int
(
toc
[
i
+
2
:
i
+
4
]))))
else
:
else
:
tracklist
=
toc
tracklist
=
toc
ntracks
=
len
(
tracklist
)
ntracks
=
len
(
tracklist
)
...
@@ -58,7 +58,7 @@ class Cddb:
...
@@ -58,7 +58,7 @@ class Cddb:
def
__init__
(
self
,
tracklist
):
def
__init__
(
self
,
tracklist
):
if
os
.
environ
.
has_key
(
'CDDB_PATH'
):
if
os
.
environ
.
has_key
(
'CDDB_PATH'
):
path
=
os
.
environ
[
'CDDB_PATH'
]
path
=
os
.
environ
[
'CDDB_PATH'
]
cddb_path
=
string
.
splitfields
(
path
,
','
)
cddb_path
=
path
.
split
(
','
)
else
:
else
:
home
=
os
.
environ
[
'HOME'
]
home
=
os
.
environ
[
'HOME'
]
cddb_path
=
[
home
+
'/'
+
_cddbrc
]
cddb_path
=
[
home
+
'/'
+
_cddbrc
]
...
@@ -73,7 +73,7 @@ class Cddb:
...
@@ -73,7 +73,7 @@ class Cddb:
break
break
except
IOError
:
except
IOError
:
pass
pass
ntracks
=
string
.
atoi
(
self
.
id
[:
2
],
16
)
ntracks
=
int
(
self
.
id
[:
2
],
16
)
self
.
artist
=
''
self
.
artist
=
''
self
.
title
=
''
self
.
title
=
''
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
...
@@ -106,8 +106,8 @@ class Cddb:
...
@@ -106,8 +106,8 @@ class Cddb:
self
.
notes
.
append
(
value
)
self
.
notes
.
append
(
value
)
elif
name1
[:
5
]
==
'track'
:
elif
name1
[:
5
]
==
'track'
:
try
:
try
:
trackno
=
string
.
atoi
(
name1
[
5
:])
trackno
=
int
(
name1
[
5
:])
except
strings
.
atoi_e
rror
:
except
ValueE
rror
:
print
'syntax error in '
+
file
print
'syntax error in '
+
file
continue
continue
if
trackno
>
ntracks
:
if
trackno
>
ntracks
:
...
@@ -126,9 +126,8 @@ class Cddb:
...
@@ -126,9 +126,8 @@ class Cddb:
# of previous track's title
# of previous track's title
if
track
and
track
[
0
]
==
','
:
if
track
and
track
[
0
]
==
','
:
try
:
try
:
off
=
string
.
index
(
self
.
track
[
i
-
1
],
off
=
self
.
track
[
i
-
1
]
.
index
(
','
)
','
)
except
ValueError
:
except
string
.
index_error
:
pass
pass
else
:
else
:
self
.
track
[
i
]
=
self
.
track
[
i
-
1
][:
off
]
\
self
.
track
[
i
]
=
self
.
track
[
i
-
1
][:
off
]
\
...
@@ -146,8 +145,8 @@ class Cddb:
...
@@ -146,8 +145,8 @@ class Cddb:
t
=
[]
t
=
[]
for
i
in
range
(
2
,
len
(
tracklist
),
4
):
for
i
in
range
(
2
,
len
(
tracklist
),
4
):
t
.
append
((
None
,
\
t
.
append
((
None
,
\
(
string
.
atoi
(
tracklist
[
i
:
i
+
2
]),
\
(
int
(
tracklist
[
i
:
i
+
2
]),
\
string
.
atoi
(
tracklist
[
i
+
2
:
i
+
4
]))))
int
(
tracklist
[
i
+
2
:
i
+
4
]))))
tracklist
=
t
tracklist
=
t
ntracks
=
len
(
tracklist
)
ntracks
=
len
(
tracklist
)
self
.
id
=
_dbid
((
ntracks
>>
4
)
&
0xF
)
+
_dbid
(
ntracks
&
0xF
)
self
.
id
=
_dbid
((
ntracks
>>
4
)
&
0xF
)
+
_dbid
(
ntracks
&
0xF
)
...
@@ -195,8 +194,8 @@ class Cddb:
...
@@ -195,8 +194,8 @@ class Cddb:
f
.
write
(
'track'
+
`i`
+
'.artist:
\t
'
+
self
.
trackartist
[
i
]
+
'
\n
'
)
f
.
write
(
'track'
+
`i`
+
'.artist:
\t
'
+
self
.
trackartist
[
i
]
+
'
\n
'
)
track
=
self
.
track
[
i
]
track
=
self
.
track
[
i
]
try
:
try
:
off
=
string
.
index
(
track
,
','
)
off
=
track
.
index
(
','
)
except
string
.
index_e
rror
:
except
ValueE
rror
:
prevpref
=
None
prevpref
=
None
else
:
else
:
if
prevpref
and
track
[:
off
]
==
prevpref
:
if
prevpref
and
track
[:
off
]
==
prevpref
:
...
...
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