本文整理汇总了Python中bleachbit.FileUtilities.expand_glob_join方法的典型用法代码示例。如果您正苦于以下问题:Python FileUtilities.expand_glob_join方法的具体用法?Python FileUtilities.expand_glob_join怎么用?Python FileUtilities.expand_glob_join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bleachbit.FileUtilities
的用法示例。
在下文中一共展示了FileUtilities.expand_glob_join方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_commands
# 需要导入模块: from bleachbit import FileUtilities [as 别名]
# 或者: from bleachbit.FileUtilities import expand_glob_join [as 别名]
def get_commands(self, option_id):
# paths for which to run expand_glob_join
egj = []
if 'recent_documents' == option_id:
egj.append(
"user/registry/data/org/openoffice/Office/Histories.xcu")
egj.append(
"user/registry/cache/org.openoffice.Office.Histories.dat")
if 'recent_documents' == option_id and not 'cache' == option_id:
egj.append("user/registry/cache/org.openoffice.Office.Common.dat")
for egj_ in egj:
for prefix in self.prefixes:
for path in FileUtilities.expand_glob_join(prefix, egj_):
if 'nt' == os.name:
path = os.path.normpath(path)
if os.path.lexists(path):
yield Command.Delete(path)
if 'cache' == option_id:
dirs = []
for prefix in self.prefixes:
dirs += FileUtilities.expand_glob_join(
prefix, "user/registry/cache/")
for dirname in dirs:
if 'nt' == os.name:
dirname = os.path.normpath(dirname)
for filename in children_in_directory(dirname, False):
yield Command.Delete(filename)
if 'recent_documents' == option_id:
for prefix in self.prefixes:
for path in FileUtilities.expand_glob_join(prefix, "user/registry/data/org/openoffice/Office/Common.xcu"):
if os.path.lexists(path):
yield Command.Function(path,
Special.delete_ooo_history,
_('Delete the usage history'))
# ~/.openoffice.org/3/user/registrymodifications.xcu
# Apache OpenOffice.org 3.4.1 from openoffice.org on Ubuntu 13.04
# %AppData%\OpenOffice.org\3\user\registrymodifications.xcu
# Apache OpenOffice.org 3.4.1 from openoffice.org on Windows XP
for path in FileUtilities.expand_glob_join(prefix, "user/registrymodifications.xcu"):
if os.path.lexists(path):
yield Command.Function(path,
Special.delete_office_registrymodifications,
_('Delete the usage history'))