1 Star 0 Fork 0

donglx/linphone-android

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
check_unused_resources.py 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
Sylvain Berfini 提交于 2018-11-15 13:06 . Cleaned app's project structure
#!/usr/bin/env python
import os
import subprocess
for filename in os.listdir('res/drawable-xhdpi/'):
resourcename = os.path.splitext(filename)[0]
if resourcename[-2:] == '.9':
resourcename = resourcename[:-2]
p = subprocess.Popen(['grep', '-nr', 'R.drawable.' + resourcename, 'src/'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if str(out) is "":
p = subprocess.Popen(['grep', '-nr', '@drawable/' + resourcename, 'res/'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if str(out) is "":
#os.remove('res/drawable-xhdpi/' + filename)
print 'Unused file : ' + filename
for filename in os.listdir('res/drawable/'):
resourcename = os.path.splitext(filename)[0]
if resourcename[-2:] == '.9':
resourcename = resourcename[:-2]
p = subprocess.Popen(['grep', '-nr', 'R.drawable.' + resourcename, 'src/'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if str(out) is "":
p = subprocess.Popen(['grep', '-nr', '@drawable/' + resourcename, 'res/'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if str(out) is "":
#os.remove('res/drawable/' + filename)
print 'Unused file : ' + filename
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/donglx/linphone-android.git
[email protected]:donglx/linphone-android.git
donglx
linphone-android
linphone-android
master

搜索帮助