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


Python Site.download方法代码示例

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


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

示例1: need

# 需要导入模块: from Site import Site [as 别名]
# 或者: from Site.Site import download [as 别名]
	def need(self, address, all_file=True):
		from Site import Site
		new = False
		site = self.get(address)
		if not site: # Site not exist yet
			if not self.isAddress(address): return False # Not address: %s % address
			logging.debug("Added new site: %s" % address)
			site = Site(address)
			self.sites[address] = site
			if not site.settings["serving"]: # Maybe it was deleted before
				site.settings["serving"] = True
				site.saveSettings()
			new = True

		if all_file: site.download()
		return site
开发者ID:TamtamHero,项目名称:ZeroNet,代码行数:18,代码来源:SiteManager.py

示例2: need

# 需要导入模块: from Site import Site [as 别名]
# 或者: from Site.Site import download [as 别名]
    def need(self, address, all_file=True, settings=None):
        from Site import Site
        site = self.get(address)
        if not site:  # Site not exist yet
            # Try to find site with differect case
            for recover_address, recover_site in self.sites.items():
                if recover_address.lower() == address.lower():
                    return recover_site

            if not self.isAddress(address):
                return False  # Not address: %s % address
            self.log.debug("Added new site: %s" % address)
            site = Site(address, settings=settings)
            self.sites[address] = site
            if not site.settings["serving"]:  # Maybe it was deleted before
                site.settings["serving"] = True
            site.saveSettings()
            if all_file:  # Also download user files on first sync
                site.download(check_size=True, blind_includes=True)

        return site
开发者ID:zhilinwww,项目名称:ZeroNet,代码行数:23,代码来源:SiteManager.py


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