def __init__(self, lang, path = None, checksum = None):
     self._languages = LanguagesProvider.getLanguagesInstance()
     if lang not in self._languages.supportedLanguages.keys():
         raise ValueError('Language' + lang + ' not supported')
     self._lang = lang
     self._path = path
     self._checksum = checksum
 def __init__(self, lang, path=None, checksum=None):
     self._languages = LanguagesProvider.getLanguagesInstance()
     if lang not in self._languages.supportedLanguages.keys():
         raise ValueError('Language' + lang + ' not supported')
     self._lang = lang
     self._path = path
     self._checksum = checksum
Ejemplo n.º 3
0
 def __init__(self, overlayBridge, tokenBucket, maxSubsSize):
     self._languagesUtility = LanguagesProvider.getLanguagesInstance()
     self._overlay_bridge = overlayBridge
     self._listenersList = list()
     self._tokenBucket = tokenBucket
     self._nextUploadTime = 0
     self.requestedSubtitles = {}
     self._requestsLock = threading.RLock()
     self._nextCleanUpTime = int(time()) + CLEANUP_PERIOD
     self._uploadQueue = []
     self._requestValidityTime = REQUEST_VALIDITY_TIME
     self._maxSubSize = maxSubsSize
 def __init__(self, overlayBridge, tokenBucket, maxSubsSize):
     self._languagesUtility = LanguagesProvider.getLanguagesInstance()
     self._overlay_bridge = overlayBridge
     self._listenersList = list()
     self._tokenBucket = tokenBucket
     self._nextUploadTime = 0
     self.requestedSubtitles = {}
     self._requestsLock = threading.RLock()
     self._nextCleanUpTime = int(time()) + CLEANUP_PERIOD
     self._uploadQueue = []
     self._requestValidityTime = REQUEST_VALIDITY_TIME
     self._maxSubSize = maxSubsSize
    def __init__(self):
        try:
            SubtitlesSupport._singletonLock.acquire()
            SubtitlesSupport.__single = self
        finally:
            SubtitlesSupport._singletonLock.release()

        self.richMetadata_db = None
        self.subtitlesHandler = None
        self.channelcast_db = None
        self.langUtility = LanguagesProvider.getLanguagesInstance()
        self._registered = False
 def __init__(self):
     SubtitlesHandler.__single = self
     self.languagesUtility = LanguagesProvider.getLanguagesInstance()
     self.subtitlesDb = None
     self.registered = False
     self.subs_dir = None
Ejemplo n.º 7
0
#Embedded file name: ACEStream\Core\Subtitles\MetadataDomainObjects\MetadataDTO.pyo
from ACEStream.Core.BitTornado.bencode import bencode, bdecode
from ACEStream.Core.Subtitles.MetadataDomainObjects.Languages import LanguagesProvider
from ACEStream.Core.Subtitles.MetadataDomainObjects.MetadataExceptions import SerializationException
from ACEStream.Core.Subtitles.MetadataDomainObjects.SubtitleInfo import SubtitleInfo
from ACEStream.Core.Overlay.permid import sign_data, verify_data
from ACEStream.Core.Utilities.utilities import isValidInfohash, isValidPermid
from math import floor
from struct import pack, unpack
import sys
import time
DEBUG = False
_languagesUtil = LanguagesProvider.getLanguagesInstance()


class MetadataDTO(object):
    def __init__(self,
                 publisher,
                 infohash,
                 timestamp=None,
                 description=u'',
                 subtitles=None,
                 signature=None):
        self.channel = publisher
        self.infohash = infohash
        if timestamp is not None:
            timestring = int(floor(timestamp))
        else:
            timestring = int(floor(time.time()))
        self.timestamp = timestring
        if isinstance(description, str):
#Embedded file name: ACEStream\Core\Subtitles\MetadataDomainObjects\MetadataDTO.pyo
from ACEStream.Core.BitTornado.bencode import bencode, bdecode
from ACEStream.Core.Subtitles.MetadataDomainObjects.Languages import LanguagesProvider
from ACEStream.Core.Subtitles.MetadataDomainObjects.MetadataExceptions import SerializationException
from ACEStream.Core.Subtitles.MetadataDomainObjects.SubtitleInfo import SubtitleInfo
from ACEStream.Core.Overlay.permid import sign_data, verify_data
from ACEStream.Core.Utilities.utilities import isValidInfohash, isValidPermid
from math import floor
from struct import pack, unpack
import sys
import time
DEBUG = False
_languagesUtil = LanguagesProvider.getLanguagesInstance()

class MetadataDTO(object):

    def __init__(self, publisher, infohash, timestamp = None, description = u'', subtitles = None, signature = None):
        self.channel = publisher
        self.infohash = infohash
        if timestamp is not None:
            timestring = int(floor(timestamp))
        else:
            timestring = int(floor(time.time()))
        self.timestamp = timestring
        if isinstance(description, str):
            description = unicode(description, 'utf-8')
        self.description = description
        if subtitles is None:
            subtitles = {}
        self._subtitles = subtitles
        self.signature = signature