]> git.parisson.com Git - telecaster-client.git/commitdiff
fix single deefuzzer station
authoryomguy <yomguy@parisson.com>
Tue, 9 Oct 2012 11:20:23 +0000 (13:20 +0200)
committeryomguy <yomguy@parisson.com>
Tue, 9 Oct 2012 11:20:23 +0000 (13:20 +0200)
telecaster/models.py

index 2a606cc7cddbb7aca6b4333b5e4e00cbbe0ad72f..18e08fd614f12e7a48dad40b25a41e2f2a8ee68b 100644 (file)
@@ -130,8 +130,11 @@ class Station(Model):
         self.user = pwd.getpwuid(self.uid)[0]
         self.encoder = 'TeleCaster system by Parisson'
         self.save()
-
-        for station in self.conf['deefuzzer']['station']:
+        
+        self._stations = self.conf['deefuzzer']['station']
+        if not isinstance(self._stations,list):
+            self._stations = [self._stations]
+        for station in self._stations:
             if station['control']['mode'] != '0':
                 port = int(station['control']['port'])
                 osc = OSC.objects.filter(port=port)
@@ -143,7 +146,7 @@ class Station(Model):
     def deefuzzer_setup(self):
         self.output_dirs = []
         self.urls = []
-        for station in self.conf['deefuzzer']['station']:
+        for station in self._stations:
             if station['record']['mode'] != '0':
                 output_dir = station['record']['dir']
                 if output_dir[-1] != os.sep:
@@ -158,7 +161,6 @@ class Station(Model):
                 self.output_dir = output_dir
                 self.record_dir = output_dir
 
-
             station['infos']['short_name'] = self.mount_point
             station['infos']['name'] = self.slug
             station['infos']['description'] = self.slug