]> git.parisson.com Git - deefuzzer.git/commitdiff
Allow multiple station in yaml conf, add example (fix #79)
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 2 Jun 2019 22:05:47 +0000 (00:05 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 2 Jun 2019 22:05:47 +0000 (00:05 +0200)
deefuzzer/core.py
deefuzzer/tools/utils.py
example/deefuzzer_multiple.yaml [new file with mode: 0644]

index 1067485192f4d80b4fd693900d204cc3c7e570e7..a43617ede3620b27e6bcaa887d4eb1074b206316 100644 (file)
@@ -78,7 +78,8 @@ class DeeFuzzer(Thread):
             os.makedirs(self.log_dir)
         self.logger = QueueLogger(log_file, self.log_queue)
         self.logger.start()
-        #print(self.conf['deefuzzer'])
+        #print(self.conf)
+
         for key in self.conf['deefuzzer'].keys():
             if key == 'm3u':
                 self.m3u = str(self.conf['deefuzzer'][key])
index 2dc81f305ab618a55b4459b64b6f2a7a42e9e68a..fb70538e7916c28a6a59f8a79f2beb36e60021fd 100644 (file)
@@ -102,7 +102,9 @@ def get_conf_dict(file):
         confile = open(file, 'r')
         data = confile.read()
         confile.close()
-        return yaml.load(data)
+        for c in yaml.load_all(data):
+            conf = c
+        return conf
 
     elif 'json' in mime_type:
         import json
diff --git a/example/deefuzzer_multiple.yaml b/example/deefuzzer_multiple.yaml
new file mode 100644 (file)
index 0000000..febf0f6
--- /dev/null
@@ -0,0 +1,112 @@
+deefuzzer: 
+ log: "/tmp/station.log"
+ m3u: "/tmp/station.m3u"
+ stationdefaults: 
+  control: 
+   mode: 0
+   port: 16001
+  jingles: 
+   dir: "/path/to/jingles"
+   mode: 0
+   shuffle: 1
+ station: 
+  - 
+   control: 
+    mode: 0
+    port: 16001
+   infos: 
+    description: "My personal best funky playlist ever !"
+    genre: "Various Funk Groove"
+    name: "My best funky station"
+    short_name: My_station
+    url: "http://parisson.com"
+   jingles: 
+    dir: "/path/to/jingles"
+    mode: 0
+    shuffle: 1
+   media: 
+    bitrate: 96
+    source: "/home/yomguy/Musique/MP3"
+    format: mp3
+    ogg_quality: 4
+    samplerate: 48000
+    shuffle: 0
+    voices: 2
+   record: 
+    dir: "/path/to/archives"
+    mode: 0
+   relay: 
+    author: Unknown
+    mode: 0
+    url: "http://127.0.0.1:8000/telecaster_live.mp3"
+   feeds: 
+    mode: 0
+    rss: 1
+    json: 0
+    playlist: 1
+    dir: "/path/to/rss/"
+    enclosure: 1
+    media_url: "http://localhost/media/"
+   server: 
+    host: "127.0.0.1"
+    mountpoint: monitor0
+    port: 8000
+    public: 0
+    sourcepassword: hackme
+    type: icecast
+    appendtype: 1
+   twitter: 
+    key: "your access token key"
+    mode: 0
+    secret: "your access token secret key"
+    tags: "parisson deefuzzer"
+  - 
+   control: 
+    mode: 0
+    port: 16001
+   infos: 
+    description: "My personal best funky playlist ever !"
+    genre: "Various Funk Groove"
+    name: "My best funky station"
+    short_name: My_station
+    url: "http://parisson.com"
+   jingles: 
+    dir: "/path/to/jingles"
+    mode: 0
+    shuffle: 1
+   media: 
+    bitrate: 96
+    source: "/home/yomguy/Musique/MP3"
+    format: mp3
+    ogg_quality: 4
+    samplerate: 48000
+    shuffle: 0
+    voices: 2
+   record: 
+    dir: "/path/to/archives"
+    mode: 0
+   relay: 
+    author: Unknown
+    mode: 0
+    url: "http://127.0.0.1:8000/telecaster_live.mp3"
+   feeds: 
+    mode: 0
+    rss: 1
+    json: 0
+    playlist: 1
+    dir: "/path/to/rss/"
+    enclosure: 1
+    media_url: "http://localhost/media/"
+   server: 
+    host: "127.0.0.1"
+    mountpoint: monitor1
+    port: 8000
+    public: 0
+    sourcepassword: hackme
+    type: icecast
+    appendtype: 1
+   twitter: 
+    key: "your access token key"
+    mode: 0
+    secret: "your access token secret key"
+    tags: "parisson deefuzzer"