本文整理汇总了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)
示例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"
示例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