コード例 #1
0
ファイル: nav.py プロジェクト: 1nfrag/mute-profanity
def createEDL(srtLoc, fileLoc):
    try:
        safety = Addon.getSetting("safety")
        safety = float(safety) / 1000
        edl = EDLManager(srtLoc, fileLoc, get_blocked_words(), safety)
        edl.open_file = lambda x,y : xbmcvfs.File(x, y)
        edl.rename = lambda x,y : xbmcvfs.rename(x,y)
        if Addon.getSetting("editsrt") == "true":
            # Tell the edl manager to replace blocked works on SRT file too
            edl.modify_srt = True

        # Does all work to update / create EDL, update SRT
        edl.updateEDL()
        return True
    except:
        print "Unexpected error:", sys.exc_info()[0]
        return False
コード例 #2
0
def createEDL(srtLoc, fileLoc):
    try:
        safety = Addon.getSetting("safety")
        safety = float(safety) / 1000
        edl = EDLManager(srtLoc, fileLoc, get_blocked_words(), safety)
        edl.open_file = lambda x, y: xbmcvfs.File(x, y)
        edl.rename = lambda x, y: xbmcvfs.rename(x, y)
        if Addon.getSetting("editsrt") == "true":
            # Tell the edl manager to replace blocked works on SRT file too
            edl.modify_srt = True

        # Does all work to update / create EDL, update SRT
        edl.updateEDL()
        return True
    except:
        print "Unexpected error:", sys.exc_info()[0]
        return False