开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 0

乘着船/python-for-android

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (22)
标签 (20)
master
develop
release-2024年01月21日
Pillow_post_get_bbox
release-2022年12月20日
release-2022年09月04日
release-2020年06月02日
release-2020年04月29日
release-2020年03月30日
develop-merge-master-2
release-2020年04月01日
release-2019年10月06日
feature/entry_point_from_getextra
release-2019年08月09日
release-2019年07月08日
release-2019年06月06日
feature/add_kivent_recipes_again
dump_restore_manifest
stable
old_toolchain
v2024.01.21
v2023.09.16
v2023.05.21
v2023.02.10
v2023.01.28
v2022.12.20
v2022.09.04
v2022.07.20
v2022.03.13
v2021.09.05
v2020.06.02
v2020.04.29
v2020.03.30
v2019.10.06
v2019.08.09
v2019.07.08
v2019.06.06
0.7.0
0.6.0
0.5.3
master
分支 (22)
标签 (20)
master
develop
release-2024年01月21日
Pillow_post_get_bbox
release-2022年12月20日
release-2022年09月04日
release-2020年06月02日
release-2020年04月29日
release-2020年03月30日
develop-merge-master-2
release-2020年04月01日
release-2019年10月06日
feature/entry_point_from_getextra
release-2019年08月09日
release-2019年07月08日
release-2019年06月06日
feature/add_kivent_recipes_again
dump_restore_manifest
stable
old_toolchain
v2024.01.21
v2023.09.16
v2023.05.21
v2023.02.10
v2023.01.28
v2022.12.20
v2022.09.04
v2022.07.20
v2022.03.13
v2021.09.05
v2020.06.02
v2020.04.29
v2020.03.30
v2019.10.06
v2019.08.09
v2019.07.08
v2019.06.06
0.7.0
0.6.0
0.5.3
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (22)
标签 (20)
master
develop
release-2024年01月21日
Pillow_post_get_bbox
release-2022年12月20日
release-2022年09月04日
release-2020年06月02日
release-2020年04月29日
release-2020年03月30日
develop-merge-master-2
release-2020年04月01日
release-2019年10月06日
feature/entry_point_from_getextra
release-2019年08月09日
release-2019年07月08日
release-2019年06月06日
feature/add_kivent_recipes_again
dump_restore_manifest
stable
old_toolchain
v2024.01.21
v2023.09.16
v2023.05.21
v2023.02.10
v2023.01.28
v2022.12.20
v2022.09.04
v2022.07.20
v2022.03.13
v2021.09.05
v2020.06.02
v2020.04.29
v2020.03.30
v2019.10.06
v2019.08.09
v2019.07.08
v2019.06.06
0.7.0
0.6.0
0.5.3
patching.py 3.66 KB
一键复制 编辑 原始数据 按行查看 历史
Julian 提交于 2023年07月27日 00:25 +08:00 . Cleanup patching.py (#2868)
"""
Helper functions for recipes.
Recipes must supply a list of patches.
Patches consist of a filename and an optional conditional, which is
any function of the form:
def patch_check(arch: string, recipe : Recipe) -> bool
This library provides some helpful conditionals and mechanisms to
join multiple conditionals.
Example:
patches = [
("linux_or_darwin_only.patch",
check_any(is_linux, is_darwin),
("recent_android_API.patch",
is_apt_gte(27)),
]
"""
from platform import uname
from packaging.version import Version
# Platform checks
def is_platform(platform):
"""
Returns true if the host platform matches the parameter given.
"""
def check(arch, recipe):
return uname().system.lower() == platform.lower()
return check
is_linux = is_platform("Linux")
is_darwin = is_platform("Darwin")
is_windows = is_platform("Windows")
def is_arch(xarch):
"""
Returns true if the target architecture platform matches the parameter
given.
"""
def check(arch):
return arch.arch == xarch
return check
# Android API comparisons:
# Return true if the Android API level being targeted
# is equal (or >, >=, <, <= as appropriate) the given parameter
def is_api(apiver: int):
def check(arch, recipe):
return recipe.ctx.android_api == apiver
return check
def is_api_gt(apiver: int):
def check(arch, recipe):
return recipe.ctx.android_api > apiver
return check
def is_api_gte(apiver: int):
def check(arch, recipe):
return recipe.ctx.android_api >= apiver
return check
def is_api_lt(apiver: int):
def check(arch, recipe):
return recipe.ctx.android_api < apiver
return check
def is_api_lte(apiver: int):
def check(arch, recipe):
return recipe.ctx.android_api <= apiver
return check
# Android API comparisons:
def is_ndk(ndk):
"""
Return true if the Minimum Supported Android NDK level being targeted
is equal the given parameter (which should be an AndroidNDK instance)
"""
def check(arch, recipe):
return recipe.ctx.ndk == ndk
return check
# Recipe Version comparisons:
# These compare the Recipe's version with the provided string (or
# Packaging.Version).
#
# Warning: Both strings must conform to PEP 440 - e.g. "3.2.1" or "1.0rc1"
def is_version_gt(version):
"""Return true if the Recipe's version is greater"""
def check(arch, recipe):
return Version(recipe.version) > Version(version)
return check
def is_version_lt(version):
"""Return true if the Recipe's version is less than"""
def check(arch, recipe):
return Version(recipe.version) < Version(version)
return check
def version_starts_with(version_prefix):
def check(arch, recipe):
return recipe.version.startswith(version_prefix)
return check
# Will Build
def will_build(recipe_name):
"""Return true if the recipe with this name is planned to be included in
the distribution."""
def check(arch, recipe):
return recipe_name in recipe.ctx.recipe_build_order
return check
# Conjunctions
def check_all(*patch_checks):
"""
Given a collection of patch_checks as params, return if all returned true.
"""
def check(arch, recipe):
return all(patch_check(arch, recipe) for patch_check in patch_checks)
return check
def check_any(*patch_checks):
"""
Given a collection of patch_checks as params, return if any returned true.
"""
def check(arch, recipe):
return any(patch_check(arch, recipe) for patch_check in patch_checks)
return check
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/buddygr/python-for-android.git
git@gitee.com:buddygr/python-for-android.git
buddygr
python-for-android
python-for-android
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /