From 5f13dbbc736515900f8de8413035ecd4eeee87fa Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 20 Jul 2017 02:05:34 +0200 Subject: [PATCH] use requirements, class_groups --- Dockerfile | 18 +++++++++++++++--- requirements-debian.txt | 5 +++++ requirements-dev.txt | 1 + requirements.txt | 21 ++++++++++++++++++--- setup.py | 21 --------------------- teleforma/views/core.py | 22 +++++++++++----------- 6 files changed, 50 insertions(+), 38 deletions(-) create mode 100644 requirements-debian.txt diff --git a/Dockerfile b/Dockerfile index 73863890..9c271d52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 index 00000000..64bb17ad --- /dev/null +++ b/requirements-debian.txt @@ -0,0 +1,5 @@ +git +netcat +vim +locales +python-yaml diff --git a/requirements-dev.txt b/requirements-dev.txt index 0fc31c29..ac1d96e4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 diff --git a/requirements.txt b/requirements.txt index d66c1a17..080308b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index 8997d52c..7c7f0c21 100644 --- 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, diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 123c109a..d3b634fe 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -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): -- 2.39.5