Ejemplo n.º 1
0
 def __init__(self, filename):
     try:
         from util import CueSheetDAO
     except ImportError as e:
         self.sqlite3 = False
     else:
         self.sqlite3 = True
         self.cueSheetDAO = CueSheetDAO(resolveFilename(SCOPE_CONFIG, filename))
Ejemplo n.º 2
0
 def __init__(self, filename):
     try:
         from util import CueSheetDAO
     except ImportError as e:
         self.sqlite3 = False
     else:
         self.sqlite3 = True
         self.cueSheetDAO = CueSheetDAO(resolveFilename(SCOPE_CONFIG, filename))
Ejemplo n.º 3
0
class CutList(object):
    def __init__(self, filename):
        try:
            from util import CueSheetDAO
        except ImportError as e:
            self.sqlite3 = False
        else:
            self.sqlite3 = True
            self.cueSheetDAO = CueSheetDAO(resolveFilename(SCOPE_CONFIG, filename))

    def getCutList(self, path):
        if not self.sqlite3:
            print '[CutList] python-sqlite3 not installed'
            return []
        cutList = self.cueSheetDAO.get_cut_list(unicode(path, 'utf-8'))
        if cutList is not None:
            return map(lambda x:(long(x[0] * 90000), int(x[1])), (x for x in cutList))

    def setCutList(self, path, cutList):
        if not self.sqlite3:
            print '[CutList] python-sqlite3 not installed'
            return
        self.cueSheetDAO.set_cut_list(unicode(path, 'utf-8'), map(lambda x:(int(x[0] / 90000), int(x[1])), (x for x in cutList)))
Ejemplo n.º 4
0
class CutList(object):
    def __init__(self, filename):
        try:
            from util import CueSheetDAO
        except ImportError as e:
            self.sqlite3 = False
        else:
            self.sqlite3 = True
            self.cueSheetDAO = CueSheetDAO(resolveFilename(SCOPE_CONFIG, filename))

    def getCutList(self, path):
        if not self.sqlite3:
            print '[CutList] python-sqlite3 not installed'
            return []
        cutList = self.cueSheetDAO.get_cut_list(unicode(path, 'utf-8'))
        if cutList is not None:
            return map(lambda x:(long(x[0] * 90000), int(x[1])), (x for x in cutList))

    def setCutList(self, path, cutList):
        if not self.sqlite3:
            print '[CutList] python-sqlite3 not installed'
            return
        self.cueSheetDAO.set_cut_list(unicode(path, 'utf-8'), map(lambda x:(int(x[0] / 90000), int(x[1])), (x for x in cutList)))