]> git.parisson.com Git - teleforma.git/commitdiff
cleanup dev
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Fri, 18 Apr 2025 09:47:58 +0000 (11:47 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Fri, 18 Apr 2025 09:47:58 +0000 (11:47 +0200)
teleforma/management/commands/teleforma-export-stream-m-slugs.py [deleted file]

diff --git a/teleforma/management/commands/teleforma-export-stream-m-slugs.py b/teleforma/management/commands/teleforma-export-stream-m-slugs.py
deleted file mode 100644 (file)
index 2ca4847..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-from optparse import make_option
-from django.conf import settings
-from django.core.management.base import BaseCommand, CommandError
-from django.contrib.auth.models import User
-from django.template.defaultfilters import slugify
-from teleforma.models import *
-import logging
-import json
-
-class Command(BaseCommand):
-    help = "Export course slugs to a Stream-M server conf file"
-    args = "password, path"
-    admin_email = 'webmaster@parisson.com'
-    ext = 'webm'
-    data = """
-# server.bindAddress
-# example: 127.0.0.1, 192.168.1.1
-# localhost. www.example.com also work
-#server.bindAddress = 192.168.0.12
-
-# server.port
-# listening port
-http.port=8080
-
-streams.safe=true
-streams.safe.password=source2parisson
-streams.safe.limit=100
-"""
-
-    def add_arguments(self, parser):
-        parser.add_argument('args', nargs='*')
-
-    def export(self):
-        courses = Course.objects.all()
-        types = CourseType.objects.all()
-        for course in courses:
-            for type in types:
-                slug = course.slug + '-' + slugify(type.name.lower())
-                slug = slugify(course.department.name.lower()) + '-' + slug
-                self.data += '\nstreams.' + slug + '=true\n'
-                self.data += 'streams.' + slug + '.password=' + self.passwd + '\n'
-                self.data += 'streams.' + slug + '.limit=1000\n'
-
-    def handle(self, *args, **options):
-        self.passwd = args[0]
-        file = args[1]
-        self.export()
-        f = open(file, 'w')
-        f.write(self.data)
-        f.close()