コード例 #1
0
import datetime
from webService import WebService
import Utilidades as ut
import sys
import csv
import requests
import sys

if __name__ == "__main__":
    param = ut.mainRecordings(sys.argv[1:])
    webService = WebService()
    report = []
    reporte_403 = []
    recordings_ids = ut.readCollabReport(param[0])
    if recordings_ids != None:
        print(
            "Reading recordigns_id from file Admin Collab Report- recordings")
        for recording in recordings_ids:
            grabacion = webService.get_grabacion_uuid_data(
                recording['recording'])
            if grabacion == None:
                reporte_403.append([
                    recording['sessionOwner'], recording['sessionName'],
                    recording['sessionId'], recording['recording'],
                    recording['recName'], '403: Not allowed, private recording'
                ])
            else:
                recording_lista = ut.listaGrabacionCollabData(grabacion)
                if recording_lista != None:
                    report_record = [
                        recording['sessionOwner'], recording['recording'],
コード例 #2
0
ファイル: Collab.py プロジェクト: gleidsonlm/PyCollab
import datetime
from webService import WebService
import Utilidades as ut
import sys


if __name__ == "__main__":
    param = ut.main(sys.argv[1:])
    webService = WebService()
    report = []
    course_uuids = []
    if  param[1] == '':
        print("Course Recordings:")
        cursos_id = ut.leerCursos(param[0])
        for curso in cursos_id:
            course_uuids.append(webService.getUUID(curso))
        print(course_uuids)
    else:
        print("UUID Recordings:")
        course_uuids = ut.leerUUID(param[1])
        print(course_uuids)
    tiempo = datetime.datetime.now() - datetime.timedelta(weeks=param[2])
    tiempo = tiempo.strftime('%Y-%m-%dT%H:%M:%SZ')
    for cuuid in course_uuids:
        grabacionesJson = webService.getGrabaciones(cuuid,tiempo)
        grabaciones = ut.listaGrabaciones(grabacionesJson)
        if grabaciones is None:
            print("There's no recording: " + cuuid)
        else:
            for grabacion in grabaciones:
                report.append([grabacion['recording_id'], grabacion['recording_name'],grabacion['duration'],grabacion['storageSize'],grabacion['created']])
コード例 #3
0
import datetime
import requests
from tqdm import tqdm
from webService import WebService
import csv
import sys, getopt

webService = WebService()


def listaGrabaciones(recordings):
    recordinglist = []
    x = 0
    try:
        number_of_recordings = (len(recordings['results']))
        if number_of_recordings <= 0:
            return None
        while x < number_of_recordings:
            recordinglist.append({
                "recording_id":
                recordings['results'][x]['id'],
                "recording_name":
                recordings['results'][x]['name'],
                "duration":
                recordings['results'][x]['duration'],
                "storageSize":
                recordings['results'][x]['storageSize'],
                "created":
                recordings['results'][x]['created']
            })
            x += 1
コード例 #4
0
import datetime
from webService import WebService
import Utilidades as ut
import sys

if __name__ == "__main__":
    param = ut.mainMoodle(sys.argv[1:])
    #param = 'moodle_plugin_sessions.txt', '', '2020-08-01 00:00:00,2020-12-31 00:00:00'
    webService = WebService()
    report = []
    ret = 0
    dates = param[2].split(",")
    if param[0] != '' and param[1] == '':
        print("Moodle Sesions...")
        moodlSession = ut.leerUUID(param[0])
        for sesion in moodlSession:
            try:
                nombre_session, date_session = webService.get_moodle_sesion_name(
                    sesion)
            except:
                print('Erro WS')
                nombre_session = None
            if nombre_session == None or nombre_session == ' ':
                print("Session name not found!")
            else:
                print(nombre_session)
                try:
                    lista_grabaciones = webService.get_moodle_lista_grabaciones(
                        nombre_session, dates, date_session)
                except:
                    lista_grabaciones = None
コード例 #5
0
import datetime
from webService import WebService
import Utilidades as ut
import sys


if __name__ == "__main__":
    param = ut.main(sys.argv[1:])
    webService = WebService()
    report = []
    report_403 = []
    course_uuids = []
    if param[2]== 0:
        tiempo = ut.semanasAtiempo(12)
    else:
        tiempo = ut.semanasAtiempo(param[2])
    if  param[0] != '' and param[1] == '':
        print("Course Recordings from " + tiempo)
        cursos_id = ut.leerCursos(param[0])
        for curso in cursos_id:
            course_uuids.append([{'uuid':webService.getUUID(curso), 'cursoid':curso}])
        
        for elemento in course_uuids:
            cuuid = elemento[0]['uuid']
            cursoid = elemento[0]['cursoid']
            grabacionesJson = webService.getGrabaciones(cuuid,tiempo)
            grabaciones = ut.listaGrabacionesOnlyData(grabacionesJson)
            if grabaciones is None:
                print("There's no recording for course: " + cuuid)
            else:
                for grabacion in grabaciones:
コード例 #6
0
ファイル: CollabMoodle.py プロジェクト: zerausolrac/PyCollab
import datetime
from webService import WebService
import Utilidades as ut
import sys

if __name__ == "__main__":
    param = ut.mainMoodle(sys.argv[1:])
    webService = WebService()
    report = []
    if param[2] == 0:
        tiempo = ut.semanasAtiempo(12)
    else:
        tiempo = ut.semanasAtiempo(param[2])
    if param[0] != '' and param[1] == '':
        print("Moodle Sesions...")
        moodlSession = ut.leerUUID(param[0])
        for sesion in moodlSession:
            nombre_session = webService.get_moodle_sesion_name(sesion)
            if nombre_session == None or nombre_session == ' ':
                print("Session name not found!")
            else:
                print(nombre_session)
                lista_grabaciones = webService.get_moodle_lista_grabaciones(
                    nombre_session)
                if lista_grabaciones is None:
                    print("There's no recording for: " + nombre_session)
                else:
                    for grabacion in lista_grabaciones:
                        report.append([
                            grabacion['recording_id'],
                            grabacion['recording_name'], grabacion['duration'],
コード例 #7
0
ファイル: CollabReport.py プロジェクト: zerausolrac/PyCollab
from webService import WebService
import Utilidades as ut
import sys
#Collaborate Courses Report

if __name__ == "__main__":
   param = ut.mainReport(sys.argv[1:])
   courses_id = ut.leerCursos(param[0])
   if param[1] == 0:
        tiempo = ut.semanasAtiempo(12)
   else:
       tiempo = ut.semanasAtiempo(param[1])
   
   if len(courses_id) != 0:   
      print("Creating Learn-Collaborate Report...")
      webService = WebService()
      course_uuid = []
      course_info = []
      reporte = []
      reporte_403 = []
      course_uuid_recordings = []
      for course_id in courses_id:
         course_info.append(webService.getCourseInfo(course_id))   
         course_uuid.append(webService.getCourseInfo(course_id)['course_uuid'])     

      
      for cuuid in course_uuid:
         grabacionesJson = webService.getGrabaciones(cuuid,tiempo)
         grabaciones = ut.listaGrabaciones(grabacionesJson)
         if grabaciones is None:
            print("There's no recording for UUID: " + cuuid)
コード例 #8
0
ファイル: Collab.py プロジェクト: zerausolrac/PyCollab
import datetime
from webService import WebService
import Utilidades as ut
import sys

if __name__ == "__main__":
    param = ut.main(sys.argv[1:])
    webService = WebService()
    report = []
    report_403 = []
    course_uuids = []
    if param[2] == 0:
        tiempo = ut.semanasAtiempo(12)
    else:
        tiempo = ut.semanasAtiempo(param[2])
    if param[0] != '' and param[1] == '':
        print("Course Recordings from " + tiempo)
        cursos_id = ut.leerCursos(param[0])
        for curso in cursos_id:
            course_uuids.append([{
                'uuid': webService.getUUID(curso),
                'cursoid': curso
            }])

        for elemento in course_uuids:
            cuuid = elemento[0]['uuid']
            cursoid = elemento[0]['cursoid']
            grabacionesJson = webService.getGrabaciones(cuuid, tiempo)
            grabaciones = ut.listaGrabaciones(grabacionesJson)
            if grabaciones is None:
                print("There's no recording for course: " + cuuid)