Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3d697ce4
Commit
3d697ce4
authored
Feb 01, 1995
by
Sjoerd Mullender
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for album.notes and trackN.artist via notes and trackartist
instance variables.
parent
d09b41bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
Lib/irix5/cddb.py
Lib/irix5/cddb.py
+11
-2
Lib/plat-irix5/cddb.py
Lib/plat-irix5/cddb.py
+11
-2
No files found.
Lib/irix5/cddb.py
View file @
3d697ce4
...
@@ -77,10 +77,12 @@ class Cddb:
...
@@ -77,10 +77,12 @@ class Cddb:
self
.
artist
=
''
self
.
artist
=
''
self
.
title
=
''
self
.
title
=
''
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
self
.
trackartist
=
[
None
]
+
[
''
]
*
ntracks
self
.
notes
=
[]
if
not
hasattr
(
self
,
'file'
):
if
not
hasattr
(
self
,
'file'
):
return
return
import
regex
import
regex
reg
=
regex
.
compile
(
'^
\
\
([^.]*
\
\
)
\
\
.
\
\
([^:]*
\
\
):
\
t
\
\
(.*
\
\
)'
)
reg
=
regex
.
compile
(
'^
\
\
([^.]*
\
\
)
\
\
.
\
\
([^:]*
\
\
):
[
\
t
]+
\
\
(.*
\
\
)'
)
while
1
:
while
1
:
line
=
f
.
readline
()
line
=
f
.
readline
()
if
not
line
:
if
not
line
:
...
@@ -101,6 +103,8 @@ class Cddb:
...
@@ -101,6 +103,8 @@ class Cddb:
self
.
toc
=
value
self
.
toc
=
value
if
self
.
toc
!=
value
:
if
self
.
toc
!=
value
:
print
'toc
\
'
s don
\
'
t match'
print
'toc
\
'
s don
\
'
t match'
elif
name2
==
'notes'
:
self
.
notes
.
append
(
value
)
elif
name1
[:
5
]
==
'track'
:
elif
name1
[:
5
]
==
'track'
:
try
:
try
:
trackno
=
string
.
atoi
(
name1
[
5
:])
trackno
=
string
.
atoi
(
name1
[
5
:])
...
@@ -112,7 +116,10 @@ class Cddb:
...
@@ -112,7 +116,10 @@ class Cddb:
' in file '
+
file
+
\
' in file '
+
file
+
\
' out of range'
' out of range'
continue
continue
if
name2
==
'title'
:
self
.
track
[
trackno
]
=
value
self
.
track
[
trackno
]
=
value
elif
name2
==
'artist'
:
self
.
trackartist
[
trackno
]
=
value
f
.
close
()
f
.
close
()
for
i
in
range
(
2
,
len
(
self
.
track
)):
for
i
in
range
(
2
,
len
(
self
.
track
)):
track
=
self
.
track
[
i
]
track
=
self
.
track
[
i
]
...
@@ -181,6 +188,8 @@ class Cddb:
...
@@ -181,6 +188,8 @@ class Cddb:
f
.
write
(
'album.title:
\
t
'
+
self
.
title
+
'
\
n
'
)
f
.
write
(
'album.title:
\
t
'
+
self
.
title
+
'
\
n
'
)
f
.
write
(
'album.artist:
\
t
'
+
self
.
artist
+
'
\
n
'
)
f
.
write
(
'album.artist:
\
t
'
+
self
.
artist
+
'
\
n
'
)
f
.
write
(
'album.toc:
\
t
'
+
self
.
toc
+
'
\
n
'
)
f
.
write
(
'album.toc:
\
t
'
+
self
.
toc
+
'
\
n
'
)
for
note
in
self
.
notes
:
f
.
write
(
'album.notes:
\
t
'
+
note
+
'
\
n
'
)
prevpref
=
None
prevpref
=
None
for
i
in
range
(
1
,
len
(
self
.
track
)):
for
i
in
range
(
1
,
len
(
self
.
track
)):
track
=
self
.
track
[
i
]
track
=
self
.
track
[
i
]
...
...
Lib/plat-irix5/cddb.py
View file @
3d697ce4
...
@@ -77,10 +77,12 @@ class Cddb:
...
@@ -77,10 +77,12 @@ class Cddb:
self
.
artist
=
''
self
.
artist
=
''
self
.
title
=
''
self
.
title
=
''
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
self
.
track
=
[
None
]
+
[
''
]
*
ntracks
self
.
trackartist
=
[
None
]
+
[
''
]
*
ntracks
self
.
notes
=
[]
if
not
hasattr
(
self
,
'file'
):
if
not
hasattr
(
self
,
'file'
):
return
return
import
regex
import
regex
reg
=
regex
.
compile
(
'^
\
\
([^.]*
\
\
)
\
\
.
\
\
([^:]*
\
\
):
\
t
\
\
(.*
\
\
)'
)
reg
=
regex
.
compile
(
'^
\
\
([^.]*
\
\
)
\
\
.
\
\
([^:]*
\
\
):
[
\
t
]+
\
\
(.*
\
\
)'
)
while
1
:
while
1
:
line
=
f
.
readline
()
line
=
f
.
readline
()
if
not
line
:
if
not
line
:
...
@@ -101,6 +103,8 @@ class Cddb:
...
@@ -101,6 +103,8 @@ class Cddb:
self
.
toc
=
value
self
.
toc
=
value
if
self
.
toc
!=
value
:
if
self
.
toc
!=
value
:
print
'toc
\
'
s don
\
'
t match'
print
'toc
\
'
s don
\
'
t match'
elif
name2
==
'notes'
:
self
.
notes
.
append
(
value
)
elif
name1
[:
5
]
==
'track'
:
elif
name1
[:
5
]
==
'track'
:
try
:
try
:
trackno
=
string
.
atoi
(
name1
[
5
:])
trackno
=
string
.
atoi
(
name1
[
5
:])
...
@@ -112,7 +116,10 @@ class Cddb:
...
@@ -112,7 +116,10 @@ class Cddb:
' in file '
+
file
+
\
' in file '
+
file
+
\
' out of range'
' out of range'
continue
continue
if
name2
==
'title'
:
self
.
track
[
trackno
]
=
value
self
.
track
[
trackno
]
=
value
elif
name2
==
'artist'
:
self
.
trackartist
[
trackno
]
=
value
f
.
close
()
f
.
close
()
for
i
in
range
(
2
,
len
(
self
.
track
)):
for
i
in
range
(
2
,
len
(
self
.
track
)):
track
=
self
.
track
[
i
]
track
=
self
.
track
[
i
]
...
@@ -181,6 +188,8 @@ class Cddb:
...
@@ -181,6 +188,8 @@ class Cddb:
f
.
write
(
'album.title:
\
t
'
+
self
.
title
+
'
\
n
'
)
f
.
write
(
'album.title:
\
t
'
+
self
.
title
+
'
\
n
'
)
f
.
write
(
'album.artist:
\
t
'
+
self
.
artist
+
'
\
n
'
)
f
.
write
(
'album.artist:
\
t
'
+
self
.
artist
+
'
\
n
'
)
f
.
write
(
'album.toc:
\
t
'
+
self
.
toc
+
'
\
n
'
)
f
.
write
(
'album.toc:
\
t
'
+
self
.
toc
+
'
\
n
'
)
for
note
in
self
.
notes
:
f
.
write
(
'album.notes:
\
t
'
+
note
+
'
\
n
'
)
prevpref
=
None
prevpref
=
None
for
i
in
range
(
1
,
len
(
self
.
track
)):
for
i
in
range
(
1
,
len
(
self
.
track
)):
track
=
self
.
track
[
i
]
track
=
self
.
track
[
i
]
...
...
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