当前位置: 首页>>代码示例>>Python>>正文


Python Library.checkBlacklist方法代码示例

本文整理汇总了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
开发者ID:Tristan79,项目名称:ComicStreamer,代码行数:70,代码来源:monitor.py


注:本文中的library.Library.checkBlacklist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。