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


Python TVShow.getImages方法代码示例

本文整理汇总了Python中sickbeard.tv.TVShow.getImages方法的典型用法代码示例。如果您正苦于以下问题:Python TVShow.getImages方法的具体用法?Python TVShow.getImages怎么用?Python TVShow.getImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sickbeard.tv.TVShow的用法示例。


在下文中一共展示了TVShow.getImages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: QueueItemAdd

# 需要导入模块: from sickbeard.tv import TVShow [as 别名]
# 或者: from sickbeard.tv.TVShow import getImages [as 别名]
class QueueItemAdd(QueueItem):
    def __init__(self, show=None):

        self.showDir = show

        # if we can't create the dir, bail
        if not os.path.isdir(self.showDir):
            if not helpers.makeDir(self.showDir):
                raise exceptions.NoNFOException("Unable to create the show dir " + self.showDir)

        if not os.path.isfile(os.path.join(self.showDir, "tvshow.nfo")):
            raise exceptions.NoNFOException("No tvshow.nfo found")

        # this will initialize self.show to None
        QueueItem.__init__(self, QueueActions.ADD)

        self.initialShow = TVShow(self.showDir)

    def _getName(self):
        if self.show == None:
            return self.showDir
        return self.show.name

    name = property(_getName)

    def _isLoading(self):
        if self.show == None:
            return True
        return False

    isLoading = property(_isLoading)

    def execute(self):

        QueueItem.execute(self)

        logger.log("Starting to add show "+self.showDir)

        otherShow = helpers.findCertainShow(sickbeard.showList, self.initialShow.tvdbid)
        if otherShow != None:
            logger.log("Show is already in your list, not adding it again")
            self.finish()
            return

        try:
            self.initialShow.getImages()
            self.initialShow.loadFromTVDB()
            
        except tvdb_exceptions.tvdb_exception, e:
            logger.log("Unable to add show due to an error with TVDB: "+str(e), logger.ERROR)
            webserve.flash.error("Unable to add "+str(self.initialShow.name)+" due to an error with TVDB")
            self._finishEarly()
            return
            
        except exceptions.NoNFOException:
            logger.log("Unable to load show from NFO", logger.ERROR)
            webserve.flash.error("Unable to add "+str(self.initialShow.name)+" from NFO, skipping")
            self._finishEarly()
            return
开发者ID:basti1,项目名称:Sick-Beard,代码行数:61,代码来源:queue.py

示例2: QueueItemAdd

# 需要导入模块: from sickbeard.tv import TVShow [as 别名]
# 或者: from sickbeard.tv.TVShow import getImages [as 别名]
class QueueItemAdd(QueueItem):
    def __init__(self, show=None):

        self.showDir = show

        # if we can't create the dir, bail
        if not os.path.isdir(self.showDir):
            if not helpers.makeDir(self.showDir):
                raise exceptions.NoNFOException("Unable to create the show dir " + self.showDir)

        if not os.path.isfile(os.path.join(self.showDir, "tvshow.nfo")):
            raise exceptions.NoNFOException("No tvshow.nfo found")

        # this will initialize self.show to None
        QueueItem.__init__(self, QueueActions.ADD)

        self.initialShow = TVShow(self.showDir)

    def _getName(self):
        if self.show == None:
            return self.showDir
        return self.show.name

    name = property(_getName)

    def _isLoading(self):
        if self.show == None:
            return True
        return False

    isLoading = property(_isLoading)

    def execute(self):

        QueueItem.execute(self)

        logger.log("Starting to add show "+self.showDir)

        try:
            self.initialShow.getImages()
            self.initialShow.loadFromTVDB()
            
        except tvdb_exceptions.tvdb_exception, e:
            logger.log("Unable to add show due to an error with TVDB: "+str(e), logger.ERROR)
            self.finish()
            return
            
        except exceptions.NoNFOException:
            logger.log("Unable to load show from NFO", logger.ERROR)
            # take the show out of the loading list
            self.finish()
            return
开发者ID:mattsch,项目名称:Sickbeard,代码行数:54,代码来源:queue.py


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