]> git.parisson.com Git - teleforma.git/commitdiff
use requirements, class_groups
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 20 Jul 2017 00:05:34 +0000 (02:05 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 20 Jul 2017 00:05:41 +0000 (02:05 +0200)
Dockerfile
requirements-debian.txt [new file with mode: 0644]
requirements-dev.txt
requirements.txt
setup.py
teleforma/views/core.py

index 738638903a8a5d696277a2977632c36b871bd7ae..9c271d52cec26f43c82b8f21db93da36adbf7cce 100644 (file)
@@ -24,14 +24,26 @@ RUN mkdir -p /srv/app
 RUN mkdir -p /srv/lib/
 RUN mkdir -p /srv/lib/telemeta
 
+WORKDIR /srv
+
+RUN apt-get update && apt-get install -y apt-transport-https
+# COPY etc/apt/sources.list /etc/apt/
+COPY requirements-debian.txt /srv
+RUN apt-get update && \
+    DEBIAN_PACKAGES=$(egrep -v "^\s*(#|$)" /srv/requirements-debian.txt) && \
+    apt-get install -y --force-yes $DEBIAN_PACKAGES && \
+    echo fr_FR.UTF-8 UTF-8 >> /etc/locale.gen && \
+    locale-gen && \
+    apt-get clean
+
 ENV LANG fr_FR.UTF-8
 ENV LANGUAGE fr_FR:fr
 ENV LC_ALL fr_FR.UTF-8
 
-ADD . /srv/lib/teleforma
-WORKDIR /srv/lib/teleforma
-
+COPY requirements.txt /srv
 RUN pip install -r requirements.txt
+
+COPY requirements-dev.txt /srv
 RUN pip install -r requirements-dev.txt --src /srv/lib
 
 WORKDIR /srv/app
diff --git a/requirements-debian.txt b/requirements-debian.txt
new file mode 100644 (file)
index 0000000..64bb17a
--- /dev/null
@@ -0,0 +1,5 @@
+git
+netcat
+vim
+locales
+python-yaml
index 0fc31c298b49c82527fada62497ec81593b980d4..ac1d96e43707561345e7ea736e335d9732808111 100644 (file)
@@ -1 +1,2 @@
 -e git+https://github.com/Parisson/django_quiz.git#egg=django_quiz-0.5.1
+-e git+https://github.com/Parisson/TeleForma.git@tc202#egg=teleforma
index d66c1a175ab244a98c32ffd58d2cbc3abd85a831..080308b064f123216a678d2aff97c0a2b52978b2 100644 (file)
@@ -1,4 +1,19 @@
---index-url https://pypi.python.org/simple/
-
 setuptools
--e .
+django==1.4.19
+telemeta==1.4.6
+south
+django-pagination==1.0.7
+django-postman==3.2.0
+django-extensions==0.9
+django-notes
+django-timezones==0.2
+django-jqchat
+crocodoc
+django-registration==0.8
+django-extra-views==0.6.5
+django-simple-captcha
+django-suit
+django-nvd3
+django-user-agents
+xhtml2pdf
+html5lib==0.95
index 8997d52c166885c52fa0c2603ac2460ed4a70104..7c7f0c21ec7cc7567fc0133c0928236fb017222c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -12,27 +12,6 @@ setup(
   author = "Guillaume Pellerin",
   author_email = "yomguy@parisson.com",
   version = '1.1',
-  install_requires = [
-        'django==1.4.19',
-        'telemeta==1.4.6',
-        'south',
-        'django-pagination==1.0.7',
-        'django-postman',
-        'django-extensions==0.9',
-        'django-notes',
-        'django-timezones==0.2',
-        'django-jqchat',
-        'crocodoc',
-        'django-registration==0.8',
-        'django-extra-views==0.6.5',
-        'django-simple-captcha',
-        'django-suit',
-        'django-nvd3',
-        'django-user-agents',
-        'xhtml2pdf',
-        'html5lib==0.95',
-        
-  ],
   platforms=['OS Independent'],
   license='CeCILL v2',
   classifiers = CLASSIFIERS,
index 123c109a5c8dacb72d2c3bb45bd83f159a485950..d3b634fe10c4e2d7809ef9448351594a7ddcfb1c 100644 (file)
@@ -400,7 +400,7 @@ class MediaView(CourseAccessMixin, DetailView):
         content_type = ContentType.objects.get(app_label="teleforma", model="course")
 
         room_name = media.course.code
-        if media.conference.web_class_group:
+        if media.conference.class_group:
             room_name += '_' + media.conference.public_id
 
         context['room'] = get_room(name=room_name,period=context['period'].name,
@@ -538,7 +538,7 @@ class ConferenceView(CourseAccessMixin, DetailView):
         content_type = ContentType.objects.get(app_label="teleforma", model="course")
 
         room_name = conference.course.code
-        if conference.web_class_group:
+        if conference.class_group:
             room_name += '_' + conference.public_id
 
         context['room'] = get_room(name=room_name, period=context['period'].name,
@@ -725,7 +725,7 @@ class ConferenceRecordView(FormView):
                                         stream_type=stream_type, streaming=True)
                     stream.save()
 
-                if not conference.web_class_group:
+                if not conference.class_group:
                     try:
                         live_message(conference)
                     except:
@@ -770,12 +770,12 @@ class ProfessorListView(View):
             professor.save()
 
 
-class WebClassGroupView(View):
+class ClassGroupView(View):
 
-    @jsonrpc_method('teleforma.get_web_class_group_list')
-    def get_web_class_group_list(request):
-        web_class_groups = WebClassGroup.objects.all()
-        return [w.to_json_dict() for w in web_class_groups]
+    @jsonrpc_method('teleforma.get_class_group_list')
+    def get_class_group_list(request):
+        class_groups = ClassGroup.objects.all()
+        return [w.to_json_dict() for w in class_groups]
 
     def pull(request, host=None):
         if host:
@@ -784,9 +784,9 @@ class WebClassGroupView(View):
             url = 'http://' + settings.TELECASTER_MASTER_SERVER + '/json/'
         s = ServiceProxy(url)
 
-        remote_list = s.teleforma.get_web_class_group_list()
-        for web_class_group_dict in remote_list['result']:
-            web_class_group, c = WebClassGroup.objects.get_or_create(name=web_class_group_dict['name'])
+        remote_list = s.teleforma.get_class_group_list()
+        for class_group_dict in remote_list['result']:
+            class_group, c = ClassGroup.objects.get_or_create(name=class_group_dict['name'])
 
 
 class HelpView(TemplateView):