changeset 652:6d10150ff905

API changes for bigbluebutton-0.5.0 Python API
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 19 Apr 2016 14:58:38 +0200
parents 8abf42ff06e3
children 127da830be6c
files data/plugin/action/submit_bbb_create_meeting.py data/plugin/action/submit_bbb_start_meeting.py
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/submit_bbb_create_meeting.py	Fri Oct 02 11:24:32 2015 +0200
+++ b/data/plugin/action/submit_bbb_create_meeting.py	Tue Apr 19 14:58:38 2016 +0200
@@ -25,6 +25,7 @@
     || Meeting ID || <<FormText(meeting_id,maxlength=50)>> ||
     || Moderator Passwort: || <<FormText(moderator_password,maxlength=50)>> ||
     || Attendee Passwort: || <<FormText(attendee_password,maxlength=50)>> ||
+    || Pre Upload URL: || <<FormText(pre_upload_url, maxlength=250)>> ||
     ||<-2:> <<FormSubmit(Send)>> ||
     <<FormFooter()>>
 
--- a/data/plugin/action/submit_bbb_start_meeting.py	Fri Oct 02 11:24:32 2015 +0200
+++ b/data/plugin/action/submit_bbb_start_meeting.py	Tue Apr 19 14:58:38 2016 +0200
@@ -7,11 +7,13 @@
 """
 import urllib
 from MoinMoin.Page import Page
+from MoinMoin import wikiutil
+
 # pip install bigbluebutton
 try:
-    from bigbluebutton import Meeting_Setup
+    from bigbluebutton import MeetingSetup
 except ImportError:
-    Meeting_Setup = None
+    MeetingSetup = None
 try:    
     import bbb_settings
 except ImportError:
@@ -25,7 +27,7 @@
     On same directory as wikiconfig.py you need
     a "bbb_settings.py" module with the SALT and the BBB_API_URL.
     """
-    if Meeting_Setup is None or bbb_settings is None:
+    if MeetingSetup is None or bbb_settings is None:
         msg, state = ("bigbluebutton module not installed or bbb_settings missing!", "error")
         request.theme.add_msg(msg, state)
         Page(request, pagename).send_page()
@@ -54,6 +56,11 @@
 
             attendee_password = content["attendee_password"]
             moderator_password = content["moderator_password"]
+            try:
+                pre_upload_url = content["pre_upload_url"]
+                pre_upload_url = wikiutil.escape(pre_upload_url)
+            except KeyError:
+                pre_upload_url = None
             msg, state = ("Sorry, we don't support empty passwords!", "error")
             if not attendee_password.strip() or not moderator_password.strip():
                 request.theme.add_msg(msg, state)
@@ -69,19 +76,17 @@
             url = "%s%s%s" % (request.host_url, scriptname, pagename.lstrip('/'))
             msg, state = ("Meeting started ", "info")
             try:
-                session = Meeting_Setup(bbb_api_url=bbb_settings.BBB_API_URL, salt=bbb_settings.SALT,
+                session = MeetingSetup(bbb_api_url=bbb_settings.BBB_API_URL, salt=bbb_settings.SALT,
                                     meeting_name=meeting_name, meeting_id=meeting_id,
                                     attendee_password=attendee_password,
                                     moderator_password=moderator_password,
-                                    logout_url=url,
+                                    logout_url=url, pre_upload_slide=pre_upload_url
                                     )
                 try:
                     session.create_meeting()
                 except TypeError:
                     recreate = False
                     msg, state = ("Usually the meeting is running and you tried to change some important parameters. Stop the Meeting beforehand.", "error")
-                # XXX there is an AttributeError if the SALT is wrong.
-                # catching the AttributeError seems no solution for a correct SALT.
 
             except KeyError:
                 msg, state = ("Usually not the right parameters or syntax used! Check the page content.  ", "error")