从kinto集合生成blocklists.xml文件。
amo2kinto的Python项目详细描述
amo2kinto
- kinto2xml :以传统XML格式导出阻止列表
- 阻止页生成器 :生成阻止列表文档页。
安装
要安装发行版:
pip install amo2kinto
要安装开发环境:
make install
系统依赖性
为了建立 amo2kinto 依赖关系,您可能需要以下库:
- 构建lxml需要: libxml2 dev libxslt dev python dev
否则您将遇到如下错误:
- libxml/xmlversion.h:找不到文件
从kinto集合生成blocklist.xml文件
如果要导出存储在kinto中的阻止列表,请在addons server xml export中 格式,您可以使用 kinto2xml 脚本:
kinto2xml -s http://localhost:8888/v1
kinto2xml 使您能够配置所需的内容 导出以及存储数据的存储桶和集合。
usage: kinto2xml [-h] [-s SERVER] [-a AUTH] [-v] [-q] [-D] [--certificates-bucket CERTIFICATES_BUCKET] [--certificates-collection CERTIFICATES_COLLECTION] [--gfx-bucket GFX_BUCKET] [--gfx-collection GFX_COLLECTION] [--addons-bucket ADDONS_BUCKET] [--addons-collection ADDONS_COLLECTION] [--plugins-bucket PLUGINS_BUCKET] [--plugins-collection PLUGINS_COLLECTION] [--api-version API_VERSION] [--app APP] [--app-version APP_VERSION] [-o OUT] Build a blocklists.xml file from Kinto blocklists. optional arguments: -h, --help show this help message and exit -s SERVER, --server SERVER The location of the remote server (with prefix) -a AUTH, --auth AUTH BasicAuth token:my-secret -v, --verbose Show all messages. -q, --quiet Show only critical errors. -D, --debug Show all messages, including debug messages. --certificates-bucket CERTIFICATES_BUCKET Bucket name for certificates --certificates-collection CERTIFICATES_COLLECTION Collection name for certificates --gfx-bucket GFX_BUCKET Bucket name for gfx --gfx-collection GFX_COLLECTION Collection name for gfx --addons-bucket ADDONS_BUCKET Bucket name for addons --addons-collection ADDONS_COLLECTION Collection name for addon --plugins-bucket PLUGINS_BUCKET Bucket name for plugins --plugins-collection PLUGINS_COLLECTION Collection name for plugin --api-version API_VERSION Targeted blocklists.xml APP id --app APP Targeted blocklists.xml APP id --app-version APP_VERSION The targetted app version -o OUT, --out OUT Output XML file.
生成阻止的加载项和插件描述页
您可能希望导出人类可读的列表和 被阻止的加载项和插件。
您可以使用blockpages生成器来完成此操作
usage: blockpages-generator [-h] [-s SERVER] [-a AUTH] [-b BUCKET] [-v] [-q] [-D] [--addons-collection ADDONS_COLLECTION] [--plugins-collection PLUGINS_COLLECTION] [-d TARGET_DIR] Generate blocked item description files. optional arguments: -h, --help show this help message and exit -s SERVER, --server SERVER The location of the remote server (with prefix) -a AUTH, --auth AUTH BasicAuth token:my-secret -b BUCKET, --bucket BUCKET Bucket name. -v, --verbose Show all messages. -q, --quiet Show only critical errors. -D, --debug Show all messages, including debug messages. --addons-collection ADDONS_COLLECTION Collection name for addon --plugins-collection PLUGINS_COLLECTION Collection name for plugin -d TARGET_DIR, --target-dir TARGET_DIR Destination directory to write files in.
它将生成一个带有记录列表的index.html文件 出现在 目标目录 目录。
它还将使用 块id 或 id 。例如 i487.html 或 08DB5018-2C80-4C4D-AA98-DAFE6AACC28C.html