Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
WebRadioPi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thorfin89
WebRadioPi
Commits
4fa0d370
Commit
4fa0d370
authored
Jan 24, 2023
by
Thorfin89
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correction d'un bug sur la lecture du 1er champ du fichier csv : '\ufeffNom'
parent
ed777a40
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
25 deletions
+26
-25
radios.csv
data/radios.csv
+19
-19
pupitre.py
pupitre.py
+7
-6
No files found.
data/radios.csv
View file @
4fa0d370
N
ull,N
om,Pays,Type,Url,Logo
Nom,Pays,Type,Url,Logo
,
France Inter,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
France Inter,FR,Généraliste,http://direct.franceinter.fr/live/franceinter-midfi.mp3,france-inter.png
,
France Musique,FR,Classique,http://direct.francemusique.fr/live/francemusique-midfi.mp3,france-musique.png
France Musique,FR,Classique,http://direct.francemusique.fr/live/francemusique-midfi.mp3,france-musique.png
,
France Bleue Auxerre,FR,Régionale,http://direct.francebleu.fr/live/fbauxerre-midfi.mp3,fb-auxerre.png
France Bleue Auxerre,FR,Régionale,http://direct.francebleu.fr/live/fbauxerre-midfi.mp3,fb-auxerre.png
,
France Bleue Isère,FR,Régionale,http://direct.francebleu.fr/live/fbisere-midfi.mp3,fb-isere.png
France Bleue Isère,FR,Régionale,http://direct.francebleu.fr/live/fbisere-midfi.mp3,fb-isere.png
,
France Bleu Armorique,FR,Régionale,http://direct.francebleu.fr/live/fbarmorique-midfi.mp3,fb-armorique.png
France Bleu Armorique,FR,Régionale,http://direct.francebleu.fr/live/fbarmorique-midfi.mp3,fb-armorique.png
,
France Info,FR,Informations,http://direct.franceinfo.fr/live/franceinfo-midfi.mp3,france-info.png
France Info,FR,Informations,http://direct.franceinfo.fr/live/franceinfo-midfi.mp3,france-info.png
,
RTL,FR,Généraliste,http://icecast.rtl.fr/rtl-1-44-128?listen=webCwsBCggNCQgLDQUGBAcGBg,rtl.png
RTL,FR,Généraliste,http://icecast.rtl.fr/rtl-1-44-128?listen=webCwsBCggNCQgLDQUGBAcGBg,rtl.png
,
Europe 1,FR,Généraliste,http://stream.europe1.fr/europe1.mp3,europe-1.png
Europe 1,FR,Généraliste,http://stream.europe1.fr/europe1.mp3,europe-1.png
,
Nostalgie,FR,Divers,http://scdn.nrjaudio.fm/adwz2/fr/30601/mp3_128.mp3?origine=fluxradios,nostalgie.png
Nostalgie,FR,Divers,http://scdn.nrjaudio.fm/adwz2/fr/30601/mp3_128.mp3?origine=fluxradios,nostalgie.png
,
Dépèche Mode,UK,Rock,http://streaming.radionomy.com/wwwdepechemodebe-radio,dempechemode.png
Dépèche Mode,UK,Rock,http://streaming.radionomy.com/wwwdepechemodebe-radio,dempechemode.png
,
TSF Jazz,FR,Jazz,http://tsfjazz.ice.infomaniak.ch/tsfjazz-high.mp3,tsf-jazz.png
TSF Jazz,FR,Jazz,http://tsfjazz.ice.infomaniak.ch/tsfjazz-high.mp3,tsf-jazz.png
,
Jazz Radio,FR,Jazz,http://jazzradio.ice.infomaniak.ch/jazzradio-high.mp3,jazz-radio.png
Jazz Radio,FR,Jazz,http://jazzradio.ice.infomaniak.ch/jazzradio-high.mp3,jazz-radio.png
,
Live Ireland,DE,Celtic,http://192.111.140.11:8058/stream?type=http&nocache=51282,live-ireland.png
Live Ireland,DE,Celtic,http://192.111.140.11:8058/stream?type=http&nocache=51282,live-ireland.png
,
Bretagne Blog,DE,Celtic,http://laut.fm/bretagneblog,bretagneblog.png
Bretagne Blog,DE,Celtic,http://laut.fm/bretagneblog,bretagneblog.png
,
Highlander Radio,DE,Celtic,https://jenny.torontocast.com:2000/stream/highlanderradio/stream,Highlander.png
Highlander Radio,DE,Celtic,https://jenny.torontocast.com:2000/stream/highlanderradio/stream,Highlander.png
,
Virgin Rock 70,DE,Rock,http://icy.unitedradio.it/VirginRock70.mp3,virginrock70.png
Virgin Rock 70,DE,Rock,http://icy.unitedradio.it/VirginRock70.mp3,virginrock70.png
,
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
Boom FM_Ottawa,CA,Rock,http://live.leanstream.co/CJOTFM-MP3,boom-ottawa.png
,
Celtic Folk Punk,DE,Celtic-Folk-Punk,https://streamingp.shoutcast.com/JamendoLounge,celtik-folk-punk.png
Celtic Folk Punk,DE,Celtic-Folk-Punk,https://streamingp.shoutcast.com/JamendoLounge,celtik-folk-punk.png
pupitre.py
View file @
4fa0d370
...
@@ -96,7 +96,8 @@ class Pupitre:
...
@@ -96,7 +96,8 @@ class Pupitre:
def
mosaique
(
self
):
# récupération de la liste des radios (+infos) et affichage de la mosaïque de logos
def
mosaique
(
self
):
# récupération de la liste des radios (+infos) et affichage de la mosaïque de logos
self
.
logo
=
[
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
]
self
.
logo
=
[
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
]
with
open
(
"./data/radios.csv"
,
'r'
,
encoding
=
'utf8'
)
as
radios_file
:
with
open
(
"./data/radios.csv"
,
'r'
,
encoding
=
'utf-8-sig'
)
as
radios_file
:
# utf-8-sig au lieu de utf8 pour éviter l'erreur sur le nom du 1er champ '\ufeffNom'
radios_list
=
csv
.
DictReader
(
radios_file
)
radios_list
=
csv
.
DictReader
(
radios_file
)
radios_list
=
[
dict
(
ligne
)
for
ligne
in
radios_list
]
# transforme en liste de dictionnaires
radios_list
=
[
dict
(
ligne
)
for
ligne
in
radios_list
]
# transforme en liste de dictionnaires
...
@@ -125,13 +126,14 @@ class Pupitre:
...
@@ -125,13 +126,14 @@ class Pupitre:
def
radio_selected
(
self
,
flux
,
num_radio
):
def
radio_selected
(
self
,
flux
,
num_radio
):
self
.
radio_flux
(
flux
)
self
.
radio_flux
(
flux
)
# affichage de la radio sélectionnée
# affichage de la radio sélectionnée
with
open
(
"./data/radios.csv"
,
'r'
,
encoding
=
'utf
8
'
)
as
radios_file
:
with
open
(
"./data/radios.csv"
,
'r'
,
encoding
=
'utf
-8-sig
'
)
as
radios_file
:
radios_list
=
csv
.
DictReader
(
radios_file
)
radios_list
=
csv
.
DictReader
(
radios_file
)
radios_list
=
[
dict
(
ligne
)
for
ligne
in
radios_list
]
# transforme en liste de dictionnaires
radios_list
=
[
dict
(
ligne
)
for
ligne
in
radios_list
]
# transforme en liste de dictionnaires
self
.
logo_selected
=
tk
.
PhotoImage
(
file
=
"images/Large/"
+
radios_list
[
num_radio
][
'Logo'
])
self
.
logo_selected
=
tk
.
PhotoImage
(
file
=
"images/Large/"
+
radios_list
[
num_radio
][
'Logo'
])
self
.
lbl_radio_selected
.
config
(
image
=
self
.
logo_selected
)
self
.
lbl_radio_selected
.
config
(
image
=
self
.
logo_selected
)
print
(
radios_list
[
num_radio
][
'Nom'
])
# print(radios_list[1
]['Nom'])
self
.
lbl_info_radio
.
config
(
text
=
radios_list
[
num_radio
][
'Nom'
],
font
=
(
'Helvatical bold'
,
20
))
self
.
lbl_info_radio
.
config
(
text
=
radios_list
[
num_radio
][
'Nom'
],
font
=
(
'Helvatical bold'
,
20
))
def
switch_sound
(
self
):
# bascule on/off du son
def
switch_sound
(
self
):
# bascule on/off du son
global
mute
global
mute
...
@@ -145,8 +147,7 @@ class Pupitre:
...
@@ -145,8 +147,7 @@ class Pupitre:
mute
=
False
mute
=
False
def
info
(
self
):
def
info
(
self
):
# affichage de l'info sur la radio en cours d'audition
# affichage de l'info sur la radio sélectionnée
self
.
lbl_info_radio
=
tk
.
Label
(
self
.
bandeau
)
self
.
lbl_info_radio
=
tk
.
Label
(
self
.
bandeau
)
self
.
lbl_info_radio
.
place
(
width
=
500
,
height
=
60
,
x
=
0
,
y
=
10
)
self
.
lbl_info_radio
.
place
(
width
=
500
,
height
=
60
,
x
=
0
,
y
=
10
)
...
...
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