本文整理汇总了Python中bleachbit.FileUtilities.uris_to_paths方法的典型用法代码示例。如果您正苦于以下问题:Python FileUtilities.uris_to_paths方法的具体用法?Python FileUtilities.uris_to_paths怎么用?Python FileUtilities.uris_to_paths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bleachbit.FileUtilities
的用法示例。
在下文中一共展示了FileUtilities.uris_to_paths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cb_clipboard_uri_received
# 需要导入模块: from bleachbit import FileUtilities [as 别名]
# 或者: from bleachbit.FileUtilities import uris_to_paths [as 别名]
def cb_clipboard_uri_received(self, clipboard, targets, data):
"""Callback for when URIs are received from clipboard"""
shred_paths = None
if 'text/uri-list' in targets:
# Linux
shred_uris = clipboard.wait_for_contents(
'text/uri-list').get_uris()
shred_paths = FileUtilities.uris_to_paths(shred_uris)
elif 'FileNameW' in targets:
# Windows
# Use non-GTK+ functions because because GTK+ 2 does not work.
shred_paths = Windows.get_clipboard_paths()
if shred_paths:
self.shred_paths(shred_paths)
else:
logger.warning(_('No paths found in clipboard.'))
示例2: cb_drag_data_received
# 需要导入模块: from bleachbit import FileUtilities [as 别名]
# 或者: from bleachbit.FileUtilities import uris_to_paths [as 别名]
def cb_drag_data_received(self, widget, context, x, y, selection, target_type, time):
if target_type == self.TARGET_TYPE_TEXT:
file_uris = selection.get_uris()
file_paths = FileUtilities.uris_to_paths(file_uris)
self.shred_paths(file_paths)
示例3: cb_drag_data_received
# 需要导入模块: from bleachbit import FileUtilities [as 别名]
# 或者: from bleachbit.FileUtilities import uris_to_paths [as 别名]
def cb_drag_data_received(widget, context, x, y, data, info, time):
if info == 80:
uris = data.get_uris()
paths = FileUtilities.uris_to_paths(uris)
self.shred_paths(paths)