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


Python Utils.getProgress方法代码示例

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


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

示例1: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType):
    progress = Utils.getProgress()
    name = Utils.httpFilename(RAIUrls.info)

    folder = Config.tgFolder
    localName = os.path.join(folder, name)

    f = Utils.download(grabber, progress, RAIUrls.info, localName, downType, "utf-8", True)
    process(grabber, progress, downType, f, db)
开发者ID:audetto,项目名称:andsoft,代码行数:11,代码来源:TG.py

示例2: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType):
    page = Utils.httpFilename(RAIUrls.junior)

    folder = Config.juniorFolder
    localFilename = os.path.join(folder, page)

    progress = Utils.getProgress()
    f = Utils.download(grabber, progress, RAIUrls.junior, localFilename, downType, None, True)

    process(grabber, progress, folder, f, db, downType)
开发者ID:audetto,项目名称:andsoft,代码行数:12,代码来源:Junior.py

示例3: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType):
    page = Utils.httpFilename(RAIUrls.onDemand)

    folder = Config.demandFolder
    localFilename = os.path.join(folder, page)

    progress = Utils.getProgress()

    f = Utils.download(grabber, progress, RAIUrls.onDemand, localFilename, downType, "raw-unicode-escape", True)

    process(grabber, f, db)
开发者ID:audetto,项目名称:andsoft,代码行数:13,代码来源:Demand.py

示例4: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType):
    progress = Utils.getProgress()

    for channel in channels:
        url = getCatalogueUrl(channel)
        name = Utils.httpFilename(url) + "." + channel

        folder = Config.m6Folder
        localName = os.path.join(folder, name)

        f = Utils.download(grabber, progress, url, localName, downType, "utf-8", True)
        if (f):
            process(grabber, downType, f, channel, db)
开发者ID:audetto,项目名称:andsoft,代码行数:15,代码来源:M6.py

示例5: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType):
    progress = Utils.getProgress()

    folder = Config.tf1Folder

    localName = os.path.join(folder, "news.json")
    f = Utils.download(grabber, progress, newsUrl, localName, downType, "utf-8", True)

    processNews(grabber, f, folder, progress, downType, db)

    localName = os.path.join(folder, "programs.json")
    f = Utils.download(grabber, progress, programsUrl, localName, downType, "utf-8", True)

    processPrograms(grabber, f, folder, progress, downType, db)
开发者ID:audetto,项目名称:raireplay,代码行数:16,代码来源:TF1.py

示例6: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType):
    progress = Utils.getProgress()
    name = Utils.httpFilename(infoUrl)

    folder = Config.pluzzFolder
    localName = os.path.join(folder, name)

    f = Utils.download(grabber, progress, infoUrl, localName, downType, None, True)

    z = zipfile.ZipFile(f, "r")

    decoder = codecs.getreader("ascii")

    for a in z.namelist():
        if a.find("catch_up_") == 0:
            with z.open(a) as f:
                process(grabber, decoder(f), db)
开发者ID:audetto,项目名称:andsoft,代码行数:19,代码来源:Pluzz.py

示例7: getTS

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
    def getTS(self):
        if self.ts:
            return self.ts

        folder = Config.m6Folder
        name = Utils.httpFilename(self.url)
        localName = os.path.join(folder, name)
        progress = Utils.getProgress()

        f = Utils.download(self.grabber, progress, self.url, localName, self.downType, "utf-8", True)
        if (f):
            root = ElementTree.parse(f).getroot()
            asset = root.find("asset")
            for v in asset.findall("assetItem"):
                u = v.find("url").text
                self.ts = getTSUrl(u)
                return self.ts
开发者ID:audetto,项目名称:andsoft,代码行数:19,代码来源:M6.py

示例8: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType, mediasetType):
    progress = Utils.getProgress()
    name = Utils.httpFilename(configUrl)

    folder = Config.mediasetFolder
    localName = os.path.join(folder, name)

    f = Utils.download(grabber, progress, configUrl, localName, downType, None, True)
    s = f.read().strip()
    root = ElementTree.fromstring(s)
    conf = parseConfig(root)

    if mediasetType == "tg5":
        url = conf["FullVideoRequestUrl"].replace("http://ww.", "http://www.")
        downloadItems(grabber, url, FULL_VIDEO, conf, folder, progress, downType, db)
    else:
        url = conf["ProgramListRequestUrl"]
        downloadItems(grabber, url, PROGRAM_LIST, conf, folder, progress, downType, db)
开发者ID:audetto,项目名称:andsoft,代码行数:20,代码来源:Mediaset.py

示例9: download

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
def download(db, grabber, downType):
    progress = Utils.getProgress()

    today = datetime.date.today()

    folder = Config.replayFolder

    for x in range(1, 8):
        day = today - datetime.timedelta(days = x)
        strDate = day.strftime("_%Y_%m_%d")

        for channel in channels.values():
            filename = channel + strDate + ".html"
            url = RAIUrls.replay + "/" + filename
            localName = os.path.join(folder, filename)

            f = Utils.download(grabber, progress, url, localName, downType, "utf-8")

            if f:
                process(grabber, f, db)
开发者ID:audetto,项目名称:andsoft,代码行数:22,代码来源:Replay.py

示例10: follow

# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import getProgress [as 别名]
    def follow(self, db, downType):
        folder = Config.juniorFolder
        progress = Utils.getProgress()

        again = True
        url = self.url

        while again:
            name = Utils.httpFilename(url)
            localFilename = os.path.join(folder, name)

            f = Utils.download(self.grabber, progress, url, localFilename, downType, None, True)
            (index, total) = processSet(self.grabber, progress, folder, f, db, downType)
            if index + 1 == total:
                again = False
            else:
                # replace -V-0.xml -> -V-1.xml and so on
                pos = url.rfind("-V-")
                if pos == -1:
                    again = False
                else:
                    base = url[:pos]
                    url = "{0}-V-{1}.xml".format(base, index + 1)
开发者ID:audetto,项目名称:andsoft,代码行数:25,代码来源:Junior.py


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