本文整理汇总了Python中GuiBasic.browse_folder方法的典型用法代码示例。如果您正苦于以下问题:Python GuiBasic.browse_folder方法的具体用法?Python GuiBasic.browse_folder怎么用?Python GuiBasic.browse_folder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiBasic
的用法示例。
在下文中一共展示了GuiBasic.browse_folder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_drive_cb
# 需要导入模块: import GuiBasic [as 别名]
# 或者: from GuiBasic import browse_folder [as 别名]
def add_drive_cb(button):
"""Callback for adding a drive"""
title = _("Choose a folder")
pathname = GuiBasic.browse_folder(self.parent, title,
multiple=False, stock_button=gtk.STOCK_ADD)
if pathname:
liststore.append([pathname])
pathnames.append(pathname)
options.set_list('shred_drives', pathnames)
示例2: cb_wipe_free_space
# 需要导入模块: import GuiBasic [as 别名]
# 或者: from GuiBasic import browse_folder [as 别名]
def cb_wipe_free_space(self, action):
"""callback to wipe free space in arbitrary folder"""
path = GuiBasic.browse_folder(self.window, _("Choose a folder"), multiple=False, stock_button=gtk.STOCK_OK)
if not path:
# user cancelled
return
backends["_gui"] = Cleaner.create_wipe_cleaner(path)
# execute
operations = {"_gui": ["free_disk_space"]}
self.preview_or_run_operations(True, operations)
示例3: add_custom_folder_cb
# 需要导入模块: import GuiBasic [as 别名]
# 或者: from GuiBasic import browse_folder [as 别名]
def add_custom_folder_cb(button):
"""Callback for adding a folder"""
title = _("Choose a folder")
pathname = GuiBasic.browse_folder(self.parent, title,
multiple=False, stock_button=gtk.STOCK_ADD)
if pathname:
for this_pathname in pathnames:
if pathname == this_pathname[1]:
print "warning: '%s' already exists in whitelist" % pathname
return
liststore.append([_('Folder'), pathname])
pathnames.append(['folder', pathname])
options.set_custom_paths(pathnames)
示例4: cb_shred_file
# 需要导入模块: import GuiBasic [as 别名]
# 或者: from GuiBasic import browse_folder [as 别名]
def cb_shred_file(self, action):
"""Callback for shredding a file or folder"""
# get list of files
if "ShredFiles" == action.get_name():
paths = GuiBasic.browse_files(self.window, _("Choose files to shred"))
elif "ShredFolders" == action.get_name():
paths = GuiBasic.browse_folder(
self.window, _("Choose folder to shred"), multiple=True, stock_button=gtk.STOCK_DELETE
)
else:
raise RuntimeError("Unexpected kind in cb_shred_file")
if not paths:
return
self.shred_paths(paths)