Commit 18f5688c authored by guest's avatar guest

提交脚本

parent 9d8a858b
This diff is collapsed.
...@@ -1471,12 +1471,19 @@ def deal_res(): ...@@ -1471,12 +1471,19 @@ def deal_res():
# styleables_attr = re.findall('<attr name="(.*?)".*?/>', i) # styleables_attr = re.findall('<attr name="(.*?)".*?/>', i)
styleables_attr = re.findall('<attr name="(.*?)".*?>', i) # 包括单行和多行定义 styleables_attr = re.findall('<attr name="(.*?)".*?>', i) # 包括单行和多行定义
for attr in styleables_attr: for attr in styleables_attr:
# else:
# new_attr = attr
result = result.replace('<attr name="' + attr + '"', '<attr name="' + styleable_mapping[attr + '_A'] + '"') result = result.replace('<attr name="' + attr + '"', '<attr name="' + styleable_mapping[attr + '_A'] + '"')
sub_map['R\\.styleable\\.' + styleable_id + '_' + attr + '(\\W)'] = \ sub_map['R\\.styleable\\.' + styleable_id + '_' + attr + '(\\W)'] = \
'R.styleable.' + styleable_mapping[styleable_id] + '_' + styleable_mapping[attr + '_A'] + '\\g<1>' 'R.styleable.' + styleable_mapping[styleable_id] + '_' + styleable_mapping[attr + '_A'] + '\\g<1>'
sub_map['app:' + attr + '='] = 'app:' + styleable_mapping[attr + '_A'] + '=' sub_map['app:' + attr + '='] = 'app:' + styleable_mapping[attr + '_A'] + '='
sub_map['\\?attr/' + attr] = '?attr/' + styleable_mapping[attr + '_A'] # 新增的替换规则 sub_map['\\?attr/' + attr] = '?attr/' + styleable_mapping[attr + '_A'] # 新增的替换规则
sub_map['<item name=\"' + attr +'\"'] = '<item name=\"' + 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[re.escape(i)] = result
sub_map_text(sub_map) sub_map_text(sub_map)
......
...@@ -283,7 +283,6 @@ ...@@ -283,7 +283,6 @@
"democraticedto", "democraticedto",
"cellaredto", "cellaredto",
"essentialedto", "essentialedto",
"infrastructureedto",
"introductionedto", "introductionedto",
"celledto", "celledto",
"principleedto", "principleedto",
...@@ -774,7 +773,7 @@ ...@@ -774,7 +773,7 @@
"satisfactionedto", "satisfactionedto",
"raceedto", "raceedto",
"circumstanceedto", "circumstanceedto",
"Europeedto", "europeedto",
"pupiledto", "pupiledto",
"denyedto", "denyedto",
"contradictionedto", "contradictionedto",
...@@ -3091,7 +3090,6 @@ ...@@ -3091,7 +3090,6 @@
"usefuledto", "usefuledto",
"sighedto", "sighedto",
"threatenedto", "threatenedto",
"vacuumedto",
"valleyedto", "valleyedto",
"evaluateedto", "evaluateedto",
"worthedto", "worthedto",
...@@ -3728,7 +3726,6 @@ ...@@ -3728,7 +3726,6 @@
"diligenceedto", "diligenceedto",
"edictedto", "edictedto",
"epicureanedto", "epicureanedto",
"equinoxedto",
"etherealedto", "etherealedto",
"exodusedto", "exodusedto",
"fjordedto", "fjordedto",
...@@ -3772,7 +3769,6 @@ ...@@ -3772,7 +3769,6 @@
"opaledto", "opaledto",
"optimismedto", "optimismedto",
"papyrusedto", "papyrusedto",
"paradoxedto",
"phantomedto", "phantomedto",
"phosphorescentedto", "phosphorescentedto",
"plutoniumedto", "plutoniumedto",
...@@ -3785,7 +3781,6 @@ ...@@ -3785,7 +3781,6 @@
"serendipityedto", "serendipityedto",
"solsticeedto", "solsticeedto",
"sonorousedto", "sonorousedto",
"spectrumedto",
"tachyonedto", "tachyonedto",
"terracottaedto", "terracottaedto",
"threnodyedto", "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