コード例 #1
0
def parse_file(filename):
    filename = make_unicode(filename)
    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.error("stream error! %s\n" % unicode(err))
        return None
コード例 #2
0
def parse_file(filename):
    filename = make_unicode(filename)
    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.error("stream error! %s\n" % unicode(err))
        return None
コード例 #3
0
def extract(filename):
    """Extract the metadata from the media file"""

    filename = unicode(filename)

    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.error("stream error! %s\n" % unicode(err))
        return None
コード例 #4
0
ファイル: eventos.py プロジェクト: vindula/vindula.streaming
def metadata(objeto, key):
    uid = objeto.UID()
    registry = getUtility(IRegistry)
    global_settings = registry.forInterface(IStreamingSettings)
    path = global_settings.path
    file = path + uid + "_video.flv"
    parser = createParser(unicode(file))
    if parser is not None:
        metadata = extractMetadata(parser)
        if metadata is not None:
            if metadata.has(key):
                return metadata.get(key)
    return None
コード例 #5
0
def extract(filename):
    """Extract the metadata from the media file"""

    from hachoir_parser.guess import createParser
    from hachoir_metadata.metadata import extractMetadata
    from hachoir_core.error import HachoirError
    from hachoir_core.stream import InputStreamError

    filename = unicode(filename)

    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.warning("Stream error! %s" % unicode(err))
        return None
コード例 #6
0
def extract(filename):
    """Extract the metadata from the media file"""

    from hachoir_parser.guess import createParser
    from hachoir_metadata.metadata import extractMetadata
    from hachoir_core.error import HachoirError
    from hachoir_core.stream import InputStreamError

    filename = unicode(filename)

    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.warning("Stream error! %s" % unicode(err))
        return None
コード例 #7
0
ファイル: app.py プロジェクト: foreni-packages/hachoir-wx
def load_file(app, filename):
    parser = createParser(force_unicode(filename), real_filename = filename)
    if not parser:
        return
    new_window(app, open(filename, 'rb'), parser, filename)
コード例 #8
0
def load_file(app, filename):
    parser = createParser(force_unicode(filename), real_filename=filename)
    if not parser:
        return
    new_window(app, open(filename, 'rb'), parser, filename)