コード例 #1
0
ファイル: common.py プロジェクト: shirabe/indico
def submitMicalaMetadata(aw, IndicoID, contentType, LODBID, LOID, videoFormat,
                         languages):
    '''Generate a lecture.xml file for the given event, then web upload it to the micala server.'''

    #    Logger.get('RecMan').debug('in submitMicalaMetadata()')

    # Initialize success flag, and result string to which we will append any errors.
    flagSuccess = True
    result = ""

    # First update the micala database that we've started this task
    try:
        idMachine = MicalaCommunication.getIdMachine(
            CollaborationTools.getOptionValue("RecordingManager",
                                              "micalaDBMachineName"))
        idTask = MicalaCommunication.getIdTask(
            CollaborationTools.getOptionValue("RecordingManager",
                                              "micalaDBStatusExportMicala"))
        idLecture = LODBID
        #        Logger.get('RecMan').debug('submitMicalaMetadata calling reportStatus...')
        MicalaCommunication.reportStatus('START', '', idMachine, idTask,
                                         idLecture)
    except Exception, e:
        flagSuccess = False
        result += _(
            "Unknown error occured when updating MICALA START task information in micala database: %s\n."
        ) % e
コード例 #2
0
ファイル: common.py プロジェクト: bubbas/indico
def submitMicalaMetadata(aw, IndicoID, contentType, LODBID, LOID, videoFormat, languages):
    '''Generate a lecture.xml file for the given event, then web upload it to the micala server.'''

#    Logger.get('RecMan').debug('in submitMicalaMetadata()')

    # Initialize success flag, and result string to which we will append any errors.
    flagSuccess = True
    result = ""

    # First update the micala database that we've started this task
    try:
        idMachine = MicalaCommunication.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName"))
        idTask    = MicalaCommunication.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportMicala"))
        idLecture = LODBID
#        Logger.get('RecMan').debug('submitMicalaMetadata calling reportStatus...')
        MicalaCommunication.reportStatus('START', '', idMachine, idTask, idLecture)
    except Exception, e:
        flagSuccess = False
        result += _("Unknown error occured when updating MICALA START task information in micala database: %s\n.") % e
コード例 #3
0
ファイル: common.py プロジェクト: bubbas/indico
    except Exception, e:
        flagSuccess = False
        result += _("Unknown error occured when submitting CDS record: %s.\n") % e

    # Uncomment these lines when debugging to see the result returned by CDS
#    f = open('/tmp/cds_result.txt', 'w')
#    f.write(cds_response)
#    f.close()

    # Update the micala database showing the task has started, but only if
    # the submission actually succeeded.
    if flagSuccess == True:
        # Update the micala database with our current task status
        try:
            # first need to get DB ids for stuff
            idMachine = MicalaCommunication.getIdMachine(CollaborationTools.getOptionValue("RecordingManager", "micalaDBMachineName"))
            idTask    = MicalaCommunication.getIdTask(CollaborationTools.getOptionValue("RecordingManager", "micalaDBStatusExportCDS"))
            # Look for the current talk in the Lectures table of the micala database
            # If it is a plain_video talk, look for its IndicoID;
            # if it is a web_lecture talk, use its LODBID
            if contentType == 'plain_video':
                idLecture = MicalaCommunication.getIdLecture(IndicoID)
                # If the current talk was not found in the micala DB, add a new record.
                if idLecture == '':
                    # It's not necessary to pass contentType since this only gets called once,
                    # for plain_videos, but maybe later we'll want to use it to create records for LOIDs
                    idLecture = MicalaCommunication.createNewMicalaLecture(IndicoID, contentType)
            elif contentType == 'web_lecture':
                # there's no question that there is a record for this lecture object,
                # because we just read the database to get the LODBID.
                idLecture = LODBID
コード例 #4
0
ファイル: common.py プロジェクト: shirabe/indico
    # Uncomment these lines when debugging to see the result returned by CDS


#    f = open('/tmp/cds_result.txt', 'w')
#    f.write(cds_response)
#    f.close()

# Update the micala database showing the task has started, but only if
# the submission actually succeeded.
    if flagSuccess == True:
        # Update the micala database with our current task status
        try:
            # first need to get DB ids for stuff
            idMachine = MicalaCommunication.getIdMachine(
                CollaborationTools.getOptionValue("RecordingManager",
                                                  "micalaDBMachineName"))
            idTask = MicalaCommunication.getIdTask(
                CollaborationTools.getOptionValue("RecordingManager",
                                                  "micalaDBStatusExportCDS"))
            # Look for the current talk in the Lectures table of the micala database
            # If it is a plain_video talk, look for its IndicoID;
            # if it is a web_lecture talk, use its LODBID
            if contentType == 'plain_video':
                idLecture = MicalaCommunication.getIdLecture(IndicoID)
                # If the current talk was not found in the micala DB, add a new record.
                if idLecture == '':
                    # It's not necessary to pass contentType since this only gets called once,
                    # for plain_videos, but maybe later we'll want to use it to create records for LOIDs
                    idLecture = MicalaCommunication.createNewMicalaLecture(
                        IndicoID, contentType)