mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-05 19:20:20 +03:00
fix(meta-info): имя команды вместо склеенного XML
Get-SimpleChildren брала InnerText дочернего узла ChildObjects. Для Form и Template это верно — имя лежит прямо в тексте узла. Command же имеет вложенный Properties, и InnerText склеивал всё его содержимое в одну строку: Команды: БанковскиеСчета_ИнтерфейсИнтеграцииСБанкомruБанковские счетаForm NavigationPanelImportantcfg:CatalogRef.ОрганизацииSinglefalseAutoAuto Теперь имя берётся из Properties/Name, если оно есть, иначе — прежний InnerText. Задеты обе точки вывода: overview у отчётов и обработок и full у всех типов. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
8925bd5875
commit
cdf0944b2f
@@ -1,4 +1,4 @@
|
|||||||
# meta-info v1.4 — Compact summary of 1C metadata object
|
# meta-info v1.5 — Compact summary of 1C metadata object
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true)][Alias('Path')][string]$ObjectPath,
|
[Parameter(Mandatory=$true)][Alias('Path')][string]$ObjectPath,
|
||||||
@@ -329,7 +329,10 @@ function Get-MaxNameLen($attrs) {
|
|||||||
function Get-SimpleChildren($parentNode, [string]$tag) {
|
function Get-SimpleChildren($parentNode, [string]$tag) {
|
||||||
$result = @()
|
$result = @()
|
||||||
foreach ($child in $parentNode.SelectNodes("md:$tag", $ns)) {
|
foreach ($child in $parentNode.SelectNodes("md:$tag", $ns)) {
|
||||||
$result += $child.InnerText
|
# Form/Template в ChildObjects — простые узлы с именем в тексте, а Command — узел
|
||||||
|
# с вложенным Properties: у него InnerText склеил бы всё содержимое в одну строку.
|
||||||
|
$nameNode = $child.SelectSingleNode("md:Properties/md:Name", $ns)
|
||||||
|
if ($nameNode) { $result += $nameNode.InnerText } else { $result += $child.InnerText }
|
||||||
}
|
}
|
||||||
return $result
|
return $result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# meta-info v1.4 — Compact summary of 1C metadata object (Python port)
|
# meta-info v1.5 — Compact summary of 1C metadata object (Python port)
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
@@ -381,7 +381,10 @@ def get_max_name_len(attrs):
|
|||||||
def get_simple_children(parent_node, tag):
|
def get_simple_children(parent_node, tag):
|
||||||
result = []
|
result = []
|
||||||
for child in find_all(parent_node, f"md:{tag}"):
|
for child in find_all(parent_node, f"md:{tag}"):
|
||||||
result.append(inner_text(child))
|
# Form/Template в ChildObjects — простые узлы с именем в тексте, а Command — узел
|
||||||
|
# с вложенным Properties: у него inner_text склеил бы всё содержимое в одну строку.
|
||||||
|
name_node = find(child, "md:Properties/md:Name")
|
||||||
|
result.append(inner_text(name_node) if name_node is not None else inner_text(child))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user