]> git.parisson.com Git - telecaster-client.git/commitdiff
use yml deefuzzer file by default, use write_conf method
authorGuillaume Pellerin <guillaume.pellerin@free.fr>
Sun, 4 Feb 2024 21:42:12 +0000 (22:42 +0100)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 5 May 2025 16:00:36 +0000 (18:00 +0200)
telecaster/models.py

index 5383e07fb1206ec1b887f07a2e947d1b3f21fcc7..5b51218cf39f6cce155c055ec897505e1445c1e7 100644 (file)
@@ -54,6 +54,8 @@ from south.modelsinspector import add_introspection_rules
 
 from teleforma.models import Conference
 
+from deefuzzer.tools.utils import get_conf_dict, write_conf
+
 
 from tools import *
 
@@ -132,7 +134,7 @@ class Station(Model):
         self.department = self.course.department.name
         self.organization = self.course.department.organization.name
 
-        self.conf = xml2dict(conf_file)
+        self.conf = get_conf_dict(conf_file)
         self.date = datetime.datetime.now().strftime("%Y")
         self.time = datetime.datetime.now().strftime("%x-%X")
         self.time_txt = self.time.replace('/','_').replace(':','_').replace(' ','_')
@@ -184,14 +186,11 @@ class Station(Model):
         #FIXME: only one format in deefuzzer conf file
         self.format = station['media']['format']
         self.deefuzzer_file = 'cache' + os.sep + 'station_' + \
-                                        station['media']['format'] + '.xml'
+                                        station['media']['format'] + '.yaml'
         self.save()
-        self.deefuzzer_xml = dicttoxml(self.conf)
 
     def deefuzzer_write_conf(self):
-        conf_file = open(self.deefuzzer_file.path,'w')
-        conf_file.write(self.deefuzzer_xml)
-        conf_file.close()
+        write_conf(self.conf, self.deefuzzer_file)
 
     def deefuzzer_start(self):
         command = '/usr/local/bin/deefuzzer ' + self.deefuzzer_file.path + ' &'