本文整理汇总了Python中library.Library.checkBlacklist方法的典型用法代码示例。如果您正苦于以下问题:Python Library.checkBlacklist方法的具体用法?Python Library.checkBlacklist怎么用?Python Library.checkBlacklist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类library.Library
的用法示例。
在下文中一共展示了Library.checkBlacklist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Monitor
# 需要导入模块: from library import Library [as 别名]
# 或者: from library.Library import checkBlacklist [as 别名]
#.........这里部分代码省略.........
remove = True
return remove
"""
def getComicMetadata(self, path):
logging.debug(u"Monitor: Scanning File {0} {1}\r".format(self.read_count, path))
self.read_count += 1
sys.stdout.flush()
return self.library.getComicMetadata(path)
def setStatusDetail(self, detail, level=logging.DEBUG):
self.statusdetail = detail
if level == logging.DEBUG:
logging.debug("Monitor: "+detail)
else:
logging.info("Monitor: "+detail)
def setStatusDetailOnly(self, detail):
self.statusdetail = detail
def commitMetadataList(self, md_list):
comics = []
for md in md_list:
self.add_count += 1
comic = self.library.createComicFromMetadata(md)
comics.append(comic)
if self.quit:
self.setStatusDetail(u"Monitor: Stopped")
return
for i in comics:
self.library.checkBlacklist(i)
if self.quit:
self.setStatusDetail(u"Monitor: Stopped")
return
self.library.addComics(comics)
def getRecursiveFilelist(self, dirs):
filename_encoding = sys.getfilesystemencoding()
filelist = []
index = 0
for p in dirs:
# if path is a folder, walk it recursivly, and all files underneath
if type(p) == str:
#make sure string is unicode
p = p.decode(filename_encoding) #, 'replace')
elif type(p) != unicode:
#it's probably a QString
p = unicode(p)
if os.path.isdir( p ):
for root,dirs,files in os.walk( p ):
# issue #26: try to exclude hidden files and dirs
files = [f for f in files if not f[0] == '.']
dirs[:] = [d for d in dirs if not d[0] == '.']
for f in files:
if type(f) == str:
#make sure string is unicode
f = f.decode(filename_encoding, 'replace')
elif type(f) != unicode:
#it's probably a QString
f = unicode(f)
filelist.append(os.path.join(root,f))
if self.quit:
return filelist