资源简介
Support for multiple Pepper versions to compile for specific minimum versions of Chrome.
Update utility to download new bundles and updates to existing bundles.
Toolchains to compile for Portable Native Client (PNaCl), traditional Native Client (NaCl), and for compiling architecture-specific Native Client applications with glibc
代码片段和文件信息
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import urlparse
from sdk_update_common import Error
SOURCE_WHITELIST = [
‘http://localhost/‘ # For testing.
‘https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk‘
]
def IsSourceValid(url):
# E1101: Instance of ‘ParseResult‘ has no ‘scheme‘ member
# pylint: disable=E1101
given = urlparse.urlparse(url)
for allowed_url in SOURCE_WHITELIST:
allowed = urlparse.urlparse(allowed_url)
if (given.scheme == allowed.scheme and
given.hostname == allowed.hostname and
given.path.startswith(allowed.path)):
return True
return False
class Config(dict):
def __init__(self data=None):
dict.__init__(self)
if data:
self.update(data)
else:
self.sources = []
def LoadJson(self json_data):
try:
self.update(json.loads(json_data))
except Exception as e:
raise Error(‘Error reading json config:\n%s‘ % str(e))
def ToJson(self):
try:
return json.dumps(self sort_keys=False indent=2)
except Exception as e:
raise Error(‘Json encoding error writing config:\n%s‘ % e)
def __getattr__(self name):
if name in self:
return self[name]
else:
raise AttributeError(‘Config does not contain: %s‘ % name)
def __setattr__(self name value):
self[name] = value
def AddSource(self source):
if not IsSourceValid(source):
logging.warn(‘Only whitelisted sources are allowed. Ignoring \“%s\“.‘ % (
source))
return
if source in self.sources:
logging.info(‘Source \“%s\“ already in Config.‘ % (source))
return
self.sources.append(source)
def RemoveSource(self source):
if source not in self.sources:
logging.warn(‘Source \“%s\“ not in Config.‘ % (source))
return
self.sources.remove(source)
def RemoveAllSources(self):
if not self.sources:
logging.info(‘No sources to remove.‘)
return
self.sources = []
相关资源
- 用foobar2000听google音乐[更新一下]
- Google Earth KML文件生成工具
- google earth 高程点坐标提取软件
- Google架构安全白皮书
- Google Earth在地质勘探中的应用
- AlCl3-NaCl-KCl-MgCl2熔盐体系电沉积Al-Mg合
- NaCl胁迫下AM真菌对棉花生长和叶片保
- NaCl-SDS复合溶液中多组分瓦斯水合物成
- NaCl对瓦斯水合物相平衡的影响
- NaCl溶液中多组分瓦斯水合物的成核诱
- The datacenter as a computer_Final-Draft
- Google OCR API源代码和神经网络识别OC
- Google DeepMind的David Silver的强化学习课
- Google论文\“Wide & Deep Learning for Recom
- googlemappoi内容解析
- csv 转换为google earth的轨迹kml
- Google Chrome 49.0.2623.110 便携版(免安装
- arcmap中加载谷歌地图ArcBruTile
- Google Play结算库V2.0.3 接入
- Google Earth 中国国界轮廓.kml
- GoogleEarth高程数据采集工具V1.1.0.1(和
- Google PPT模板
- 中国各省、直辖市、自治区界线,k
- google_usb_driver
- Google book Downloader 谷歌电子书PDF工具
- google earth api
- SGGS-Google earth拼图工具
- ADA_CDMATool_V2-网优插件
- Google Map api V3 (3.9.12)的离线开发包
- 浪潮之巅 清晰pdf版
评论
共有 条评论