diff --git a/attributes_listing.xml b/attributes_listing.xml new file mode 100644 index 00000000..5435babd --- /dev/null +++ b/attributes_listing.xml @@ -0,0 +1,4393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdtf-spec.md b/gdtf-spec.md index a637977f..bd5b1f94 100644 --- a/gdtf-spec.md +++ b/gdtf-spec.md @@ -455,15 +455,22 @@ in [table 9](#user-content-table-9 ). | XML Attribute Name | Value Type | Description | |----|----|----| | Name | [Name](#user-content-attrtype-name ) | The unique name of the attribute. | -| Pretty | [String](#user-content-attrtype-string ) | The pretty name of the attribute . | +| Label | [String](#user-content-attrtype-string ) | Name of the attribute for the user. | +| Pretty | [String](#user-content-attrtype-string ) | The short name of the attribute . | | ActivationGroup | [Node](#user-content-attrtype-node ) | Optional link to the activation group. The starting point is the [activation groups](#user-content-activation-groups ) node. | | Feature | [Node](#user-content-attrtype-node ) | Link to the corresponding feature. The starting point is the [feature groups](#user-content-feature-groups ) node. | | MainAttribute | [Node](#user-content-attrtype-node ) | Optional link to the main attribute. The starting point is the [attribute](#user-content-attribute ) node. | | PhysicalUnit | [Enum](#user-content-attrtype-enum ) | The currently defined unit values are: “None”, “Percent”, “Length” (m), “Mass” (kg), “Time” (s), “Temperature” (K), “LuminousIntensity”(cd), “Angle” (degree), “Force” (N), “Frequency” (Hz), “Current” (A), “Voltage” (V), “Power” (W), “Energy” (J), “Area” (m2), “Volume” (m3), “Speed” (m/s), “Acceleration” (m/s2), “AngularSpeed” (degree/s), “AngularAccc” (degree/s2), “WaveLength” (nm), “ColorComponent”. Default: “None”. | | Color | [ColorCIE](#user-content-attrtype-colorcie ) | Optional. Defines the color for the attribute. | -| | | | - - +| Definition | [String](#user-content-attrtype-string ) | Optional. Description of what the attribute defines. | +| Explanation | [String](#user-content-attrtype-string ) | Optional. Longer form explanation of what the attribute defines with focus on the user. | +| UseEmitter | [Enum](#user-content-attrtype-enum ) | Indication whether this attribute typically utilizes [Emitters](#user-content-emitter-collect ). The currently defined values are: "True", "False". Default: "False". | +| UseFilter | [Enum](#user-content-attrtype-enum ) | Indication whether this attribute typically utilizes [Filters](#user-content-filter-collect ). The currently defined values are: "True", "False". Default: "False". | +| UseWheel | [Enum](#user-content-attrtype-enum ) | Indication whether this attribute typically utilizes [Wheels](#user-content-wheel-collect ). The currently defined values are: "True", "False". Default: "False". | +| UseWheelSlot | [Enum](#user-content-attrtype-enum ) | Indication whether this attribute typically utilizes [WheelSlots](#user-content-wheel-slot ). The currently defined values are: "True", "False". Default: "False". | +| UseGamut | [Enum](#user-content-attrtype-enum ) | Indication whether this attribute typically utilizes [Gamuts](#user-content-gamuts ). The currently defined values are: "True", "False". Default: "False" | +| UseColorSpace | [Enum](#user-content-attrtype-enum ) | Indication whether this attribute typically utilizes [ColorSpaces](#user-content-color-space ). The currently defined values are: "True", "False". Default: "False". | +| UseThumbnailExchange | [Enum](#user-content-attrtype-enum ) | Indication whether this attribute typically utilizes the exchange of media content thumbnails [WheelSlots](#user-content-wheel-slot ). The currently defined values are: "True", "False". Default: "False". | As children the attribute node has a list of a [subphysical units](#user-content-subphysical-unit ). @@ -2063,7 +2070,7 @@ are specified in [table 62](#user-content-table-62 ). | DMXFrom | [DMXValue](#user-content-attrtype-dmxvalue ) | Start DMX value; The end DMX value is calculated as a DMXFrom of the next channel set – 1 or the maximum value of the current channel function; Default value: 0/1 | | PhysicalFrom | [Float](#user-content-attrtype-float ) | Physical start value. Default value is the PhysicalFrom from the parent channel function. | | PhysicalTo | [Float](#user-content-attrtype-float ) | Physical end value. Default value is the PhysicalTo from the parent channel function. | -| WheelSlotIndex | [Int](#user-content-attrtype-int ) | If the channel function has a link to a wheel, a corresponding slot index shall be specified. The wheel slot index results from the order of slots of the wheel which is linked in the channel function. The wheel slot index is normalized to 1. Size: 4 bytes | +| WheelSlotIndex | [Int](#user-content-attrtype-int ) | If the channel function has a link to a wheel and if the channel function attribute indicates wheel slot usage, a corresponding slot index shall be specified. The wheel slot index results from the order of slots of the wheel which is linked in the channel function. The wheel slot index is normalized to 1. Size: 4 bytes | @@ -2519,7 +2526,7 @@ Type Attribute. At any time user defined attributes can be introduced as well. | Scale\_Z | Scaling on Y axis. | | Scale\_XYZ | Unified scaling on all axis. | | Gobo(n) | The fixture’s gobo wheel (n). This is the main attribute of gobo wheel’s (n) wheel control. Selects gobos in gobo wheel (n). A different channel function sets the angle of the indexed position in the selected gobo or the angular speed of its continuous rotation. | -| Gobo(n)SelectSpin | Selects gobos whose rotation is continuous in gobo wheel (n) and controls the angular speed of the gobo’s spin within the same channel function. | +| Gobo(n)SelectSpin | Selects gobos whose rotation is continuous in gobo wheel (n) and controls the angular speed of the gobo’s spin within the same channel function. If there is more than one gobo wheel the wild-card (n) will be incremented and the number then indicates which wheel will be controlled. | | Gobo(n)SelectShake | Selects gobos which shake in gobo wheel (n) and controls the frequency of the gobo’s shake within the same channel function. | | Gobo(n)SelectEffects | Selects gobos which run effects in gobo wheel (n). | | Gobo(n)WheelIndex | Controls angle of indexed rotation of gobo wheel (n). | @@ -2530,7 +2537,7 @@ Type Attribute. At any time user defined attributes can be introduced as well. | Gobo(n)Pos | Controls angle of indexed rotation of gobos in gobo wheel (n). This is the main attribute of gobo wheel’s (n) wheel slot control. | | Gobo(n)PosRotate | Controls the speed and direction of continuous rotation of gobos in gobo wheel (n). | | Gobo(n)PosShake | Controls frequency of the shake of gobos in gobo wheel (n). | -| AnimationWheel(n) | This is the main attribute of the animation wheel's (n) wheel control. Selects slots in the animation wheel. A different channel function sets the angle of the indexed position in the selected slot or the angular speed of its continuous rotation. Is used for animation effects with multiple slots. | +| AnimationWheel(n) | This is the main attribute of the animation wheel's (n) wheel control. Selects slots in the animation wheel. A different channel function sets the angle of the indexed position in the selected slot or the angular speed of its continuous rotation. Is used for animation effects with multiple slots. If there is more than one animation wheel the wild-card (n) will be incremented and the number then indicates which wheel will be controlled. | | AnimationWheel(n)Audio | Controls audio-controlled functionality of animation wheel (n). | | AnimationWheel(n)Macro | Selects predefined effects in animation wheel (n). | | AnimationWheel(n)Random | Controls frequency of animation wheel (n) random slot selection. | @@ -2555,7 +2562,7 @@ Type Attribute. At any time user defined attributes can be introduced as well. | MediaContent(n) | Selects file with media content. | | ModelFolder(n) | Selects folder that contains 3D model content. For example 3D meshes for mapping. | | ModelContent(n) | Selects file with 3D model content. | -| PlayMode | Defines media playback mode. | +| Playmode | Defines media playback mode. | | PlayBegin | Defines starting point of media content playback. | | PlayEnd | Defines end point of media content playback. | | PlaySpeed | Adjusts playback speed of media content. | @@ -2587,7 +2594,7 @@ Type Attribute. At any time user defined attributes can be introduced as well. | ColorSub\_C | Controls the insertion of the fixture's cyan filter flag for direct subtractive color mixing. | | ColorSub\_M | Controls the insertion of the fixture's magenta filter flag for direct subtractive color mixing. | | ColorSub\_Y | Controls the insertion of the fixture's yellow filter flag for direct subtractive color mixing. | -| ColorMacro(n) | Selects predefined colors that are programed in the fixture's firmware. | +| ColorMacro(n) | Selects predefined colors that are programmed in the fixture's firmware. | | ColorMacro(n)Rate | Controls the time between Color Macro steps. | | CTO | Controls the fixture's "Correct to orange" wheel or mixing system. | | CTC | Controls the fixture's "Correct to color" wheel or mixing system. | @@ -2694,26 +2701,26 @@ Type Attribute. At any time user defined attributes can be introduced as well. | Color(n)Mode | Changes control between selecting, continuous selection, half selection, random selection, color spinning, etc. in colors of color wheel (n). | | ColorWheelShortcutMode | Defines whether the color wheel takes the shortest distance between two colors. | | CyanMode | Controls how Cyan is used within the fixture's cyan CMY-mixing feature. | -| MagentaMode | Controls how Cyan is used within the fixture's magenta CMY-mixing. | -| YellowMode | Controls how Cyan is used within the fixture's yellow CMY-mixing feature. | +| MagentaMode | Controls how Magenta is used within the fixture's magenta CMY-mixing. | +| YellowMode | Controls how Yellow is used within the fixture's yellow CMY-mixing feature. | | ColorMixMode | Changes control between selecting continuous selection, half selection, random selection, color spinning, etc. in color mixing. | | ChromaticMode | Selects chromatic behavior of the device. | | ColorCalibrationMode | Sets calibration mode (for example on/off). | | ColorConsistency | Controls consistent behavior of color. | | ColorControl | Controls special color related functions. | -| ColorModelMode | Controls color model (CMY/RGB/HSV...). | +| ColorModelMode | Controls color model (CMY/RGB/HSV...). | | ColorSettingsReset | Resets settings of color control channel. | | ColorUniformity | Controls behavior of color uniformity. | | CRIMode | Controls CRI settings of output. | | CustomColor | Custom color related functions (save, recall..). | | UVStability | Settings for UV stability color behavior. | -| WavelengthCorrection | Settings for Wavelength correction of colors. | +| WavelengthCorrection | Settings for Wavelength correction of colors. | | WhiteCount | Controls if White LED is proportionally added to RGB. | | StrobeMode | Changes strobe style - strobe, pulse, random strobe, etc. - of the shutter attribute. | | ZoomMode | Changes modes of the fixture´s zoom. | | FocusMode | Changes modes of the fixture’s focus - manual or auto- focus. | | IrisMode | Changes modes of the fixture’s iris - linear, strobe, pulse. | -| Fan(n)Mode | Controls fan (n) mode. | +| FanMode | Controls fan mode. | | FollowSpotMode | Selects follow spot control mode. | | BeamEffectIndexRotateMode | Changes mode to control either index or rotation of the beam effects. | | IntensityMSpeed | Movement speed of the fixture's intensity. | @@ -2754,12 +2761,13 @@ Type Attribute. At any time user defined attributes can be introduced as well. | DisplayIntensity | Adjusts intensity of display | | DMXInput | Selects DMX Input | | NoFeature | Ranges without a functionality. | +| Dummy | Ranges without a functionality. | | Blower(n) | Fog or hazer‘s blower feature. | | Fan(n) | Fog or hazer's Fan feature. | | Fog(n) | Fog or hazer's Fog feature. | | Haze(n) | Fog or hazer's Haze feature. | | LampPowerMode | Controls the energy consumption of the lamp. | -| Fans | Controls a fixture or device fan. | +| Fans | Controls a fixture or device fan. | | Blade(n)A | 1 of 2 shutters that shape the top/right/bottom/left of the beam. | | Blade(n)B | 2 of 2 shutters that shape the top/right/bottom/left of the beam. | | Blade(n)Rot | Rotates position of blade(n). | @@ -2792,408 +2800,4679 @@ considered as normalized. The upper and lower case of attribute names is not taken into account. ``` -    -        -            -            - - -            -            -            -            -            -            -            -            -            -            -            -            -            -        -        -            -                -            -            -                -                -                -                -            -            -                -                -            -            -                -                -                -                -                -                -                -                -            -            -                -            -            -                -            -            -                -            -            -                -            -            -                -            -        -        -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -           - -            - -            - - This is the amount of shake as a percentage of the image size and defines the peak amplitude of the shake -            -            - -            - -            - - This is the amount of shake as a percentage of the image size and defines the peak amplitude of the shake -            - -            - -            -            -            - This defines the peak amplitude of the shake -            - -            - -            -            - -            -            - - This defines the peak amplitude of the shake -            - -            -            -            - This defines the peak amplitude of the shake -            -            - This defines the duration of the ramp in relation to the period. - This defines the minimum position in relation to the whole way of the spline - This defines the maximum position in relation to the whole way of the spline -            - This defines the minimum position in relation to the whole way of the spline - This defines the maximum position in relation to the whole way of the spline -            -            -            -            -            - This defines the peak amplitude of the shake -            -            -            -            -            -            -            -            -            -            -            -            -            - -            - -            - -            - -            - -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            - This defines the duration of the on time of the strobe. - This defines the offset of the end of the strobe from the start as percentage of the total period. -            - This defines the fraction of one period in which the pulse is on. - This defines the offset of the end of the pulse from the start as percentage of the total period. -            - This defines the fraction of one period in which the ramp is on. - This defines the offset of the end of the ramp from the start as percentage of the total period. -            - This defines the fraction of one period in which the ramp is on. - This defines the offset of the end of the ramp from the start as percentage of the total period. -            - This defines the duration of the on time of the strobe. -            -            -            -            -            -            - This defines the duration of the on time of the iris. - This defines the offset of the end of the strobe from the start as percentage of the total period. - This defines the minimum percentage to which the iris closes. -            - This defines the duration of the on time of the iris. - This defines the minimum percentage to which the iris closes. -            - This defines the fraction of one period in which the pulse of the iris is on. - This defines the offset of the end of the pulse from the start as percentage of the total period. - This defines the minimum percentage to which the iris closes. -            - This defines the fraction of one period in which the pulse of the iris is on. - This defines the offset of the end of the pulse from the start as percentage of the total period. - This defines the minimum percentage to which the iris closes. -            - This defines the minimum percentage to which the iris closes. -            - This defines the minimum percentage to which the iris closes. -            -            - This defines the fraction of one period in which the pulse of the frost is on. - This defines the offset of the end of the pulse from the start as percentage of the total period. -            - This defines the fraction of one period in which the pulse of the frost is on. - This defines the offset of the end of the pulse from the start as percentage of the total period. -            - This defines the fraction of one period in which the ramp of the frost is on. - This defines the offset of the end of the ramp from the start as percentage of the total period. -            -            -            -            -            -            -            -            -            -            -                        -            -            - This defines the size of the beam compared to the original size. - This defines the size of the beam compared to the original size. -            -            -            -            -            -                -                 -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            /> -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -            -        -    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ``` Example for enumeration: diff --git a/proposal/attributes_listing_wheels_usage/.python-version b/proposal/attributes_listing_wheels_usage/.python-version new file mode 100644 index 00000000..6324d401 --- /dev/null +++ b/proposal/attributes_listing_wheels_usage/.python-version @@ -0,0 +1 @@ +3.14 diff --git a/gdtf_attributes_with_description.json b/proposal/attributes_listing_wheels_usage/gdtf_attributes_with_description.json similarity index 99% rename from gdtf_attributes_with_description.json rename to proposal/attributes_listing_wheels_usage/gdtf_attributes_with_description.json index 35df0117..fcb02d75 100644 --- a/gdtf_attributes_with_description.json +++ b/proposal/attributes_listing_wheels_usage/gdtf_attributes_with_description.json @@ -458,7 +458,7 @@ ], "definition": "Controls audio-controlled functionality of animation wheel (n).", "explanation": "This attribute controls how the animation wheel will behave when responding to an audio source for use with the AnimationWheel(n). When using this AnimationWheel(n)Audio as a Channel Function attribute, make sure that the attribute for the Logical Channel is set to AnimationWheel(n). In case that AnimationWheel(n) already exists in the same geometry, you can use the AnimationWheel(n)Audio as the Logical Channel attribute.", - "visual": "This attribute controls how the animation wheel will behave when responding to an audio source for use with the AnimationWheel(n).", + "visual": "", "_label": "Animation Wheel Audio" }, { @@ -1523,7 +1523,7 @@ "_label": "Video Key Color Green" }, { - "_name": "VideoColorKey_B", + "_name": "VideoKeyColor_B", "_prettyName": "B", "_feature": "Color.ColorKey", "_physicalUnit": "None", diff --git a/proposal/attributes_listing_wheels_usage/map.txt b/proposal/attributes_listing_wheels_usage/map.txt new file mode 100644 index 00000000..d7ba36f8 --- /dev/null +++ b/proposal/attributes_listing_wheels_usage/map.txt @@ -0,0 +1,10 @@ + "_name": "TiltRotate", + "_prettyName": "T Rotate", + "_feature": "Position.PanTilt", + "_physicalUnit": "AngularSpeed", + "definition": "Controls the speed of the fixture's continuous tilt movement (vertical axis).", + "explanation": "For fixtures with the ability to have a continuous tilt rotation, the “Tilt Rotate” control defines how fast (speed) a fixture can rotat +e about the tilt axis. Usually, the vertical axis.", + "visual": "", + "_label": "Tilt Rotate" + diff --git a/proposal/attributes_listing_wheels_usage/merge_attributes.py b/proposal/attributes_listing_wheels_usage/merge_attributes.py new file mode 100755 index 00000000..fa49f83e --- /dev/null +++ b/proposal/attributes_listing_wheels_usage/merge_attributes.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python3 +""" +Merge gdtf_attributes_with_description.json into attributes_listing.xml +based on Attribute Name. + +Rules: +- Match JSON _name to XML Attribute@Name. +- Map fields: + _name -> Name + _prettyName -> Pretty + _feature -> Feature + _physicalUnit -> PhysicalUnit + definition -> Definition + explanation -> Explanation + _label -> Label +- Keep all other XML attributes and structure. +- JSON values overwrite existing XML values when non-empty. +- Reformat output with a custom formatter (2-space indent). +""" + +import json +from pathlib import Path +import xml.etree.ElementTree as ET + +JSON_PATH = Path("gdtf_attributes_with_description.json") +XML_PATH = Path("attributes_listing.xml") + +MAP_FIELDS = { + "_name": "Name", + "_prettyName": "Pretty", + "_feature": "Feature", + "_physicalUnit": "PhysicalUnit", + "definition": "Definition", + "explanation": "Explanation", + "_label": "Label", +} + +DEFAULT_ATTRS = { + "UseEmmiter": "False", + "UseFilter": "False", + "UseWheel": "False", + "UseWheelSlot": "False", + "UseGamut": "False", + "UseColorSpace": "False", +} + + +def load_json(path: Path): + obj = json.loads(path.read_text(encoding="utf-8")) + if isinstance(obj, dict) and "Attribute" in obj: + items = obj["Attribute"] + elif isinstance(obj, list): + items = obj + else: + raise ValueError("Unexpected JSON structure") + if not isinstance(items, list): + raise ValueError("JSON 'Attribute' is not a list") + return items + + +def build_index(items): + by_name = {} + for it in items: + name = it.get("_name") + if name: + by_name[name] = it + return by_name + + +def merge(xml_path: Path, by_name): + tree = ET.parse(xml_path) + root = tree.getroot() + + updated = 0 + matched = 0 + missing_in_json = [] + + for attr in root.findall(".//Attribute"): + name = attr.get("Name") + if not name: + continue + data = by_name.get(name) + if not data: + missing_in_json.append(name) + continue + matched += 1 + for jkey, xkey in MAP_FIELDS.items(): + if jkey not in data: + continue + val = data.get(jkey) + if val is None or val == "": + continue + val = str(val) + if attr.get(xkey) != val: + attr.set(xkey, val) + updated += 1 + for xkey, val in DEFAULT_ATTRS.items(): + if attr.get(xkey) != val: + attr.set(xkey, val) + updated += 1 + + return tree, root, matched, updated, missing_in_json + + +def xml_escape(text: str) -> str: + return ( + text.replace("&", "&") + .replace("<", "<") + .replace(">", ">") + .replace('"', """) + ) + + +def format_custom(root: ET.Element, indent: str = " ") -> str: + lines = [""] + + def write_elem(elem: ET.Element, level: int) -> None: + pad = indent * level + tag = elem.tag + attrs = elem.attrib + children = list(elem) + text = (elem.text or "").strip() + + if attrs: + lines.append(f"{pad}<{tag}") + for k, v in attrs.items(): + lines.append(f"{pad}{indent}{k}=\"{xml_escape(str(v))}\"") + else: + lines.append(f"{pad}<{tag}") + + if children or text: + lines[-1] = lines[-1] + ">" + if text: + lines.append(f"{pad}{indent}{xml_escape(text)}") + for child in children: + write_elem(child, level + 1) + if child.tail and child.tail.strip(): + lines.append(f"{pad}{indent}{xml_escape(child.tail.strip())}") + lines.append(f"{pad}") + else: + lines[-1] = lines[-1] + "/>" + + write_elem(root, 0) + return "\n".join(lines) + "\n" + + +def main(): + items = load_json(JSON_PATH) + by_name = build_index(items) + + tree, root, matched, updated, missing_in_json = merge(XML_PATH, by_name) + + formatted = format_custom(root) + XML_PATH.write_text(formatted, encoding="utf-8") + + print(f"matched {matched} attributes; updated {updated} fields") + print(f"missing in json: {len(missing_in_json)}") + + +if __name__ == "__main__": + main() diff --git a/proposal/attributes_listing_wheels_usage/print_attr_table.py b/proposal/attributes_listing_wheels_usage/print_attr_table.py new file mode 100644 index 00000000..9cd96db3 --- /dev/null +++ b/proposal/attributes_listing_wheels_usage/print_attr_table.py @@ -0,0 +1,33 @@ +from pathlib import Path +import xml.etree.ElementTree as ET + + +XML_PATH = Path(__file__).with_name("attributes_listing.xml") +HEADER = ( + "| Attribute | Description" + " " +) +SEPARATOR = "|----------------------------------|-----------------------------| " +ATTRIBUTE_WIDTH = 32 +DESCRIPTION_WIDTH = 297 + + +def main() -> None: + root = ET.parse(XML_PATH).getroot() + + print(HEADER) + print(SEPARATOR) + + for attribute in root.find("Attributes").findall("Attribute"): + name = attribute.get("Name") + description = attribute.get("Definition") + if not name or not description: + print("skipping", attribute.get("Name")) + continue + name = name.replace("_", r"\_") + description = description.replace("_", r"\_") + print(f"| {name:<{ATTRIBUTE_WIDTH}} | {description:<{DESCRIPTION_WIDTH}} |") + + +if __name__ == "__main__": + main() diff --git a/proposal/attributes_listing_wheels_usage/pyproject.toml b/proposal/attributes_listing_wheels_usage/pyproject.toml new file mode 100644 index 00000000..174ca0bb --- /dev/null +++ b/proposal/attributes_listing_wheels_usage/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "attributes-listing-wheels-usage" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.14" +dependencies = [] diff --git a/proposal/attributes_listing_wheels_usage/uv.lock b/proposal/attributes_listing_wheels_usage/uv.lock new file mode 100644 index 00000000..8f683afd --- /dev/null +++ b/proposal/attributes_listing_wheels_usage/uv.lock @@ -0,0 +1,8 @@ +version = 1 +revision = 3 +requires-python = ">=3.14" + +[[package]] +name = "attributes-listing-wheels-usage" +version = "0.1.0" +source = { virtual = "." }