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
b2e358d4
Kaydet (Commit)
b2e358d4
authored
Kas 08, 1993
tarafından
Sjoerd Mullender
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use __init__ instead of init.
Also use CDDB_PATH and CDDB_WRITE_DIR environment variables in cddb.py.
üst
e65cce5e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
26 deletions
+28
-26
cddb.py
Lib/irix5/cddb.py
+8
-5
cdplayer.py
Lib/irix5/cdplayer.py
+4
-5
readcd.doc
Lib/irix5/readcd.doc
+1
-1
readcd.py
Lib/irix5/readcd.py
+1
-2
cddb.py
Lib/plat-irix5/cddb.py
+8
-5
cdplayer.py
Lib/plat-irix5/cdplayer.py
+4
-5
readcd.doc
Lib/plat-irix5/readcd.doc
+1
-1
readcd.py
Lib/plat-irix5/readcd.py
+1
-2
No files found.
Lib/irix5/cddb.py
Dosyayı görüntüle @
b2e358d4
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
# Usage is as follows:
# Usage is as follows:
#
#
# import readcd
# import readcd
# r = readcd.Readcd()
.init()
# r = readcd.Readcd()
# c = Cddb(
).init(
r.gettrackinfo())
# c = Cddb(r.gettrackinfo())
#
#
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# starts at 1). When the CD is not recognized, all values will be the empty
# starts at 1). When the CD is not recognized, all values will be the empty
...
@@ -55,7 +55,7 @@ def tochash(toc):
...
@@ -55,7 +55,7 @@ def tochash(toc):
return
hash
return
hash
class
Cddb
:
class
Cddb
:
def
init
(
self
,
tracklist
):
def
__init__
(
self
,
tracklist
):
if
posix
.
environ
.
has_key
(
'CDDB_PATH'
):
if
posix
.
environ
.
has_key
(
'CDDB_PATH'
):
path
=
posix
.
environ
[
'CDDB_PATH'
]
path
=
posix
.
environ
[
'CDDB_PATH'
]
cddb_path
=
string
.
splitfields
(
path
,
','
)
cddb_path
=
string
.
splitfields
(
path
,
','
)
...
@@ -104,7 +104,7 @@ class Cddb:
...
@@ -104,7 +104,7 @@ class Cddb:
except
IOError
:
except
IOError
:
pass
pass
if
not
hasattr
(
self
,
'file'
):
if
not
hasattr
(
self
,
'file'
):
return
self
return
import
regex
import
regex
reg
=
regex
.
compile
(
'^
\\
([^.]*
\\
)
\\
.
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
reg
=
regex
.
compile
(
'^
\\
([^.]*
\\
)
\\
.
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
while
1
:
while
1
:
...
@@ -138,14 +138,17 @@ class Cddb:
...
@@ -138,14 +138,17 @@ class Cddb:
continue
continue
self
.
track
[
trackno
]
=
value
self
.
track
[
trackno
]
=
value
f
.
close
()
f
.
close
()
return
self
def
write
(
self
):
def
write
(
self
):
import
posixpath
if
posix
.
environ
.
has_key
(
'CDDB_WRITE_DIR'
):
if
posix
.
environ
.
has_key
(
'CDDB_WRITE_DIR'
):
dir
=
posix
.
environ
[
'CDDB_WRITE_DIR'
]
dir
=
posix
.
environ
[
'CDDB_WRITE_DIR'
]
else
:
else
:
dir
=
posix
.
environ
[
'HOME'
]
+
'/'
+
_cddbrc
dir
=
posix
.
environ
[
'HOME'
]
+
'/'
+
_cddbrc
file
=
dir
+
'/'
+
self
.
id
+
'.rdb'
file
=
dir
+
'/'
+
self
.
id
+
'.rdb'
if
posixpath
.
exists
(
file
):
# make backup copy
posix
.
rename
(
file
,
file
+
'~'
)
f
=
open
(
file
,
'w'
)
f
=
open
(
file
,
'w'
)
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
'
)
...
...
Lib/irix5/cdplayer.py
Dosyayı görüntüle @
b2e358d4
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
# Usage is as follows:
# Usage is as follows:
#
#
# import readcd
# import readcd
# r = readcd.Readcd()
.init()
# r = readcd.Readcd()
# c = Cdplayer(
).init(
r.gettrackinfo())
# c = Cdplayer(r.gettrackinfo())
#
#
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# starts at 1). When the CD is not recognized, all values will be the empty
# starts at 1). When the CD is not recognized, all values will be the empty
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
cdplayerrc
=
'.cdplayerrc'
cdplayerrc
=
'.cdplayerrc'
class
Cdplayer
:
class
Cdplayer
:
def
init
(
self
,
tracklist
):
def
__init__
(
self
,
tracklist
):
import
string
import
string
self
.
artist
=
''
self
.
artist
=
''
self
.
title
=
''
self
.
title
=
''
...
@@ -38,7 +38,7 @@ class Cdplayer:
...
@@ -38,7 +38,7 @@ class Cdplayer:
import
posix
import
posix
f
=
open
(
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
,
'r'
)
f
=
open
(
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
,
'r'
)
except
IOError
:
except
IOError
:
return
self
return
import
regex
import
regex
reg
=
regex
.
compile
(
'^
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
reg
=
regex
.
compile
(
'^
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
s
=
self
.
id
+
'.'
s
=
self
.
id
+
'.'
...
@@ -62,7 +62,6 @@ class Cdplayer:
...
@@ -62,7 +62,6 @@ class Cdplayer:
trackno
=
string
.
atoi
(
name
[
6
:])
trackno
=
string
.
atoi
(
name
[
6
:])
self
.
track
[
trackno
]
=
value
self
.
track
[
trackno
]
=
value
f
.
close
()
f
.
close
()
return
self
def
write
(
self
):
def
write
(
self
):
import
posix
import
posix
...
...
Lib/irix5/readcd.doc
Dosyayı görüntüle @
b2e358d4
...
@@ -18,7 +18,7 @@ read and the callbacks will be called.
...
@@ -18,7 +18,7 @@ read and the callbacks will be called.
Initialization.
Initialization.
===============
===============
r = readcd.Readcd(
).init(
[cd-player [, mode]])
r = readcd.Readcd([cd-player [, mode]])
The optional arguments are the name of the CD device and the mode.
The optional arguments are the name of the CD device and the mode.
When "mode" is not specified, it defaults to 'r' (which is the only
When "mode" is not specified, it defaults to 'r' (which is the only
...
...
Lib/irix5/readcd.py
Dosyayı görüntüle @
b2e358d4
...
@@ -22,7 +22,7 @@ def _dopnum(self, cb_type, data):
...
@@ -22,7 +22,7 @@ def _dopnum(self, cb_type, data):
func
(
arg
,
cb_type
,
data
)
func
(
arg
,
cb_type
,
data
)
class
Readcd
:
class
Readcd
:
def
init
(
self
,
*
arg
):
def
__init__
(
self
,
*
arg
):
if
len
(
arg
)
==
0
:
if
len
(
arg
)
==
0
:
self
.
player
=
cd
.
open
()
self
.
player
=
cd
.
open
()
elif
len
(
arg
)
==
1
:
elif
len
(
arg
)
==
1
:
...
@@ -38,7 +38,6 @@ class Readcd:
...
@@ -38,7 +38,6 @@ class Readcd:
self
.
end
=
0
self
.
end
=
0
self
.
status
=
None
self
.
status
=
None
self
.
trackinfo
=
None
self
.
trackinfo
=
None
return
self
def
eject
(
self
):
def
eject
(
self
):
self
.
player
.
eject
()
self
.
player
.
eject
()
...
...
Lib/plat-irix5/cddb.py
Dosyayı görüntüle @
b2e358d4
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
# Usage is as follows:
# Usage is as follows:
#
#
# import readcd
# import readcd
# r = readcd.Readcd()
.init()
# r = readcd.Readcd()
# c = Cddb(
).init(
r.gettrackinfo())
# c = Cddb(r.gettrackinfo())
#
#
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# starts at 1). When the CD is not recognized, all values will be the empty
# starts at 1). When the CD is not recognized, all values will be the empty
...
@@ -55,7 +55,7 @@ def tochash(toc):
...
@@ -55,7 +55,7 @@ def tochash(toc):
return
hash
return
hash
class
Cddb
:
class
Cddb
:
def
init
(
self
,
tracklist
):
def
__init__
(
self
,
tracklist
):
if
posix
.
environ
.
has_key
(
'CDDB_PATH'
):
if
posix
.
environ
.
has_key
(
'CDDB_PATH'
):
path
=
posix
.
environ
[
'CDDB_PATH'
]
path
=
posix
.
environ
[
'CDDB_PATH'
]
cddb_path
=
string
.
splitfields
(
path
,
','
)
cddb_path
=
string
.
splitfields
(
path
,
','
)
...
@@ -104,7 +104,7 @@ class Cddb:
...
@@ -104,7 +104,7 @@ class Cddb:
except
IOError
:
except
IOError
:
pass
pass
if
not
hasattr
(
self
,
'file'
):
if
not
hasattr
(
self
,
'file'
):
return
self
return
import
regex
import
regex
reg
=
regex
.
compile
(
'^
\\
([^.]*
\\
)
\\
.
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
reg
=
regex
.
compile
(
'^
\\
([^.]*
\\
)
\\
.
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
while
1
:
while
1
:
...
@@ -138,14 +138,17 @@ class Cddb:
...
@@ -138,14 +138,17 @@ class Cddb:
continue
continue
self
.
track
[
trackno
]
=
value
self
.
track
[
trackno
]
=
value
f
.
close
()
f
.
close
()
return
self
def
write
(
self
):
def
write
(
self
):
import
posixpath
if
posix
.
environ
.
has_key
(
'CDDB_WRITE_DIR'
):
if
posix
.
environ
.
has_key
(
'CDDB_WRITE_DIR'
):
dir
=
posix
.
environ
[
'CDDB_WRITE_DIR'
]
dir
=
posix
.
environ
[
'CDDB_WRITE_DIR'
]
else
:
else
:
dir
=
posix
.
environ
[
'HOME'
]
+
'/'
+
_cddbrc
dir
=
posix
.
environ
[
'HOME'
]
+
'/'
+
_cddbrc
file
=
dir
+
'/'
+
self
.
id
+
'.rdb'
file
=
dir
+
'/'
+
self
.
id
+
'.rdb'
if
posixpath
.
exists
(
file
):
# make backup copy
posix
.
rename
(
file
,
file
+
'~'
)
f
=
open
(
file
,
'w'
)
f
=
open
(
file
,
'w'
)
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
'
)
...
...
Lib/plat-irix5/cdplayer.py
Dosyayı görüntüle @
b2e358d4
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
# Usage is as follows:
# Usage is as follows:
#
#
# import readcd
# import readcd
# r = readcd.Readcd()
.init()
# r = readcd.Readcd()
# c = Cdplayer(
).init(
r.gettrackinfo())
# c = Cdplayer(r.gettrackinfo())
#
#
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# starts at 1). When the CD is not recognized, all values will be the empty
# starts at 1). When the CD is not recognized, all values will be the empty
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
cdplayerrc
=
'.cdplayerrc'
cdplayerrc
=
'.cdplayerrc'
class
Cdplayer
:
class
Cdplayer
:
def
init
(
self
,
tracklist
):
def
__init__
(
self
,
tracklist
):
import
string
import
string
self
.
artist
=
''
self
.
artist
=
''
self
.
title
=
''
self
.
title
=
''
...
@@ -38,7 +38,7 @@ class Cdplayer:
...
@@ -38,7 +38,7 @@ class Cdplayer:
import
posix
import
posix
f
=
open
(
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
,
'r'
)
f
=
open
(
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
,
'r'
)
except
IOError
:
except
IOError
:
return
self
return
import
regex
import
regex
reg
=
regex
.
compile
(
'^
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
reg
=
regex
.
compile
(
'^
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
s
=
self
.
id
+
'.'
s
=
self
.
id
+
'.'
...
@@ -62,7 +62,6 @@ class Cdplayer:
...
@@ -62,7 +62,6 @@ class Cdplayer:
trackno
=
string
.
atoi
(
name
[
6
:])
trackno
=
string
.
atoi
(
name
[
6
:])
self
.
track
[
trackno
]
=
value
self
.
track
[
trackno
]
=
value
f
.
close
()
f
.
close
()
return
self
def
write
(
self
):
def
write
(
self
):
import
posix
import
posix
...
...
Lib/plat-irix5/readcd.doc
Dosyayı görüntüle @
b2e358d4
...
@@ -18,7 +18,7 @@ read and the callbacks will be called.
...
@@ -18,7 +18,7 @@ read and the callbacks will be called.
Initialization.
Initialization.
===============
===============
r = readcd.Readcd(
).init(
[cd-player [, mode]])
r = readcd.Readcd([cd-player [, mode]])
The optional arguments are the name of the CD device and the mode.
The optional arguments are the name of the CD device and the mode.
When "mode" is not specified, it defaults to 'r' (which is the only
When "mode" is not specified, it defaults to 'r' (which is the only
...
...
Lib/plat-irix5/readcd.py
Dosyayı görüntüle @
b2e358d4
...
@@ -22,7 +22,7 @@ def _dopnum(self, cb_type, data):
...
@@ -22,7 +22,7 @@ def _dopnum(self, cb_type, data):
func
(
arg
,
cb_type
,
data
)
func
(
arg
,
cb_type
,
data
)
class
Readcd
:
class
Readcd
:
def
init
(
self
,
*
arg
):
def
__init__
(
self
,
*
arg
):
if
len
(
arg
)
==
0
:
if
len
(
arg
)
==
0
:
self
.
player
=
cd
.
open
()
self
.
player
=
cd
.
open
()
elif
len
(
arg
)
==
1
:
elif
len
(
arg
)
==
1
:
...
@@ -38,7 +38,6 @@ class Readcd:
...
@@ -38,7 +38,6 @@ class Readcd:
self
.
end
=
0
self
.
end
=
0
self
.
status
=
None
self
.
status
=
None
self
.
trackinfo
=
None
self
.
trackinfo
=
None
return
self
def
eject
(
self
):
def
eject
(
self
):
self
.
player
.
eject
()
self
.
player
.
eject
()
...
...
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