Commit 18f5688c authored by guest's avatar guest

提交脚本

parent 9d8a858b
This diff is collapsed.
......@@ -1471,12 +1471,19 @@ def deal_res():
# styleables_attr = re.findall('<attr name="(.*?)".*?/>', i)
styleables_attr = re.findall('<attr name="(.*?)".*?>', i) # 包括单行和多行定义
for attr in styleables_attr:
# else:
# new_attr = attr
result = result.replace('<attr name="' + attr + '"', '<attr name="' + styleable_mapping[attr + '_A'] + '"')
sub_map['R\\.styleable\\.' + styleable_id + '_' + attr + '(\\W)'] = \
'R.styleable.' + styleable_mapping[styleable_id] + '_' + styleable_mapping[attr + '_A'] + '\\g<1>'
sub_map['app:' + attr + '='] = 'app:' + styleable_mapping[attr + '_A'] + '='
sub_map['\\?attr/' + attr] = '?attr/' + styleable_mapping[attr + '_A'] # 新增的替换规则
sub_map['<item name=\"' + attr +'\"'] = '<item name=\"' + styleable_mapping[attr + '_A'] +'\"' # 新增的替换规则
# 判断 attr 是否以 "android:" 开头
if attr.startswith("android:"):
new_attr = "android_" + attr[8:] # 去掉 "android:" 并替换为 "android_"
sub_map['R\\.styleable\\.' + styleable_id + '_' + new_attr + '(\\W)'] = \
'R.styleable.' + styleable_mapping[styleable_id] + '_' + styleable_mapping[attr + '_A'] + '\\g<1>'
sub_map[re.escape(i)] = result
sub_map_text(sub_map)
......
......@@ -283,7 +283,6 @@
"democraticedto",
"cellaredto",
"essentialedto",
"infrastructureedto",
"introductionedto",
"celledto",
"principleedto",
......@@ -774,7 +773,7 @@
"satisfactionedto",
"raceedto",
"circumstanceedto",
"Europeedto",
"europeedto",
"pupiledto",
"denyedto",
"contradictionedto",
......@@ -3091,7 +3090,6 @@
"usefuledto",
"sighedto",
"threatenedto",
"vacuumedto",
"valleyedto",
"evaluateedto",
"worthedto",
......@@ -3728,7 +3726,6 @@
"diligenceedto",
"edictedto",
"epicureanedto",
"equinoxedto",
"etherealedto",
"exodusedto",
"fjordedto",
......@@ -3772,7 +3769,6 @@
"opaledto",
"optimismedto",
"papyrusedto",
"paradoxedto",
"phantomedto",
"phosphorescentedto",
"plutoniumedto",
......@@ -3785,7 +3781,6 @@
"serendipityedto",
"solsticeedto",
"sonorousedto",
"spectrumedto",
"tachyonedto",
"terracottaedto",
"threnodyedto",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment