当前位置: 首页>>代码示例>>Python>>正文


Python VFS.local_reference方法代码示例

本文整理汇总了Python中VFS.local_reference方法的典型用法代码示例。如果您正苦于以下问题:Python VFS.local_reference方法的具体用法?Python VFS.local_reference怎么用?Python VFS.local_reference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VFS的用法示例。


在下文中一共展示了VFS.local_reference方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GetInfoMedia

# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import local_reference [as 别名]
    def GetInfoMedia (self, source):
        # Download file input file, if needed
        local_in = VFS.local_reference (source)
        assert local_in[0] == '/', "A local copy of the file is required"

        # Video Converter
        infor = converters.VideoInfo()
        dict_info = infor.get (local_in)

        # Check the information retrieved
        if not dict_info:
            return "failed"

        return ("ok", dict_info)
开发者ID:manolodd,项目名称:activae,代码行数:16,代码来源:Worker.py

示例2: BuildThumbnailMedia

# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import local_reference [as 别名]
    def BuildThumbnailMedia (self, source, target):
        # Download file input file, if needed
        local_in = VFS.local_reference (source)
        assert local_in[0] == '/', "A local copy of the file is required"

        # Video Converter
        thumbnailer = converters.VideoThumbnail()
        thumbnailer.generate (local_in, target)

        # Check the new file
        if not os.path.exists (target):
            return "failed"
        if os.path.getsize (target) < 1:
            return "failed"

        return "ok"
开发者ID:manolodd,项目名称:activae,代码行数:18,代码来源:Worker.py

示例3: ConvertMedia

# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import local_reference [as 别名]
    def ConvertMedia (self, source, target, format):
        # Download file input file, if needed
        local_in = VFS.local_reference (source)
        assert local_in[0] == '/', "A local copy of the file is required"

        # Video Converter
        vc = converters.VideoConverter()
        args = (local_in, target, format)

        task_id = (int(time.time()*10**6)) & 0xFFFFFFF
        callback = processors.FileCallback (task_id)

        self.jobs.put ((vc.convert, args, callback, task_id))
        status.status[task_id] = -1

        return task_id
开发者ID:manolodd,项目名称:activae,代码行数:18,代码来源:Worker.py


注:本文中的VFS.local_reference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。