Do not produce Python methods masked by properties.

This commit is contained in:
Matthias Koefferlein 2022-10-24 20:31:46 +02:00
parent a39d22c438
commit 24c6224a84
3 changed files with 9 additions and 320 deletions

View File

@ -715,6 +715,15 @@ MethodTable::finish ()
{
for (std::vector<MethodTableEntry>::iterator m = m_table.begin (); m != m_table.end (); ++m) {
m->finish ();
if (m->is_enabled ()) {
// disable methods which are also present as properties
if (m_property_name_map.find (std::make_pair (m->is_static (), m->name ())) != m_property_name_map.end ()) {
m->set_enabled (false);
for (auto i = m->begin (); i != m->end (); ++i) {
mp_module->add_python_doc (*i, tl::to_string (tr ("This method is not available for Python")));
}
}
}
}
for (std::vector<std::pair<MethodTableEntry, MethodTableEntry> >::iterator m = m_property_table.begin (); m != m_property_table.end (); ++m) {
m->first.finish ();

View File

@ -3199,14 +3199,6 @@ class Instance:
The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned.
This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28.
"""
def cell(self) -> Cell:
r"""
@brief Gets the \Cell object of the cell this instance refers to
This is the const version of the \cell method. It will return a const \Cell object and itself can be called on a const \Instance object.
This variant has been introduced in version 0.25.
"""
def change_pcell_parameter(self, name: str, value: Any) -> None:
r"""
@brief Changes a single parameter of a PCell instance to the given value
@ -3386,14 +3378,6 @@ class Instance:
This const version of the method has been introduced in version 0.25.
"""
def parent_cell(self) -> Cell:
r"""
@brief Gets the cell this instance is contained in
Returns nil if the instance does not live inside a cell.
This const version of the \parent_cell method has been introduced in version 0.25.
"""
def pcell_declaration(self) -> PCellDeclaration_Native:
r"""
@brief Returns the PCell declaration object
@ -14900,22 +14884,6 @@ class SaveLayoutOptions:
r"""
@brief Assigns another object to self
"""
def cif_blank_separator(self) -> bool:
r"""
@brief Gets a flag indicating whether blanks shall be used as x/y separator characters
See \cif_blank_separator= method for a description of that property.
This property has been added in version 0.23.10.
The predicate version (cif_blank_separator?) has been added in version 0.25.1.
"""
def cif_dummy_calls(self) -> bool:
r"""
@brief Gets a flag indicating whether dummy calls shall be written
See \cif_dummy_calls= method for a description of that property.
This property has been added in version 0.23.10.
The predicate version (cif_blank_separator?) has been added in version 0.25.1.
"""
def clear_cells(self) -> None:
r"""
@brief Clears all cells to be saved
@ -14953,24 +14921,6 @@ class SaveLayoutOptions:
r"""
@brief Creates a copy of self
"""
def gds2_no_zero_length_paths(self) -> bool:
r"""
@brief Gets a value indicating whether zero-length paths are eliminated
This property has been added in version 0.23.
"""
def gds2_write_cell_properties(self) -> bool:
r"""
@brief Gets a value indicating whether cell properties are written
This property has been added in version 0.23.
"""
def gds2_write_file_properties(self) -> bool:
r"""
@brief Gets a value indicating whether layout properties are written
This property has been added in version 0.24.
"""
def is_const_object(self) -> bool:
r"""
@brief Returns a value indicating whether the reference is a const reference
@ -23553,18 +23503,6 @@ class LoadLayoutOptions:
r"""
@brief Creates a copy of self
"""
def dxf_keep_other_cells(self) -> bool:
r"""
@brief If this option is true, all cells are kept, not only the top cell and it's children
This property has been added in version 0.21.15.
"""
def dxf_render_texts_as_polygons(self) -> bool:
r"""
@brief If this option is true, text objects are rendered as polygons
This property has been added in version 0.21.15.
"""
def dxf_select_all_layers(self) -> None:
r"""
@brief Selects all layers and disables the layer map
@ -23583,18 +23521,6 @@ class LoadLayoutOptions:
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
"""
def gds2_allow_big_records(self) -> bool:
r"""
@brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes.
See \gds2_allow_big_records= method for a description of this property.
This property has been added in version 0.18.
"""
def gds2_allow_multi_xy_records(self) -> bool:
r"""
@brief Gets a value specifying whether to allow big polygons with multiple XY records.
See \gds2_allow_multi_xy_records= method for a description of this property.
This property has been added in version 0.18.
"""
def is_const_object(self) -> bool:
r"""
@brief Returns a value indicating whether the reference is a const reference
@ -28839,12 +28765,6 @@ class Shape:
r"""
@brief Returns the bounding box of the shape
"""
def box(self) -> Any:
r"""
@brief Gets the box object
Starting with version 0.23, this method returns nil, if the shape does not represent a box.
"""
def create(self) -> None:
r"""
@brief Ensures the C++ object is created
@ -28988,18 +28908,6 @@ class Shape:
This method applies to polygons and delivers all points of the polygon hull contour.
It will throw an exception for other objects.
"""
def edge(self) -> Any:
r"""
@brief Returns the edge object
Starting with version 0.23, this method returns nil, if the shape does not represent an edge.
"""
def edge_pair(self) -> Any:
r"""
@brief Returns the edge pair object
This method has been introduced in version 0.26.
"""
def has_prop_id(self) -> bool:
r"""
@brief Returns true, if the shape has properties, i.e. has a properties ID
@ -29079,12 +28987,6 @@ class Shape:
This method has been introduced in version 0.22.
"""
def path(self) -> Any:
r"""
@brief Returns the path object
Starting with version 0.23, this method returns nil, if the shape does not represent a path.
"""
def path_dlength(self) -> float:
r"""
@brief Returns the length of the path in micrometer units
@ -29112,14 +29014,6 @@ class Shape:
This method has been added in version 0.23.
"""
def polygon(self) -> Any:
r"""
@brief Returns the polygon object
Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour.
Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon.
"""
def property(self, key: Any) -> Any:
r"""
@brief Gets the user property with the given key
@ -29142,19 +29036,6 @@ class Shape:
This method has been introduced in version 0.22.
"""
def simple_polygon(self) -> Any:
r"""
@brief Returns the simple polygon object
Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour.
Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon.
"""
def text(self) -> Any:
r"""
@brief Returns the text object
Starting with version 0.23, this method returns nil, if the shape does not represent a text.
"""
def to_s(self) -> str:
r"""
@brief Create a string showing the contents of the reference
@ -49857,13 +49738,6 @@ class LEFDEFReaderConfiguration:
r"""
@brief Creates a copy of self
"""
def fills_datatype(self, mask: int) -> int:
r"""
@brief Gets the fill geometry layer datatype value per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def fills_suffix_per_mask(self, mask: int) -> str:
r"""
@brief Gets the fill geometry layer name suffix per mask.
@ -49877,25 +49751,11 @@ class LEFDEFReaderConfiguration:
This method returns true, if self is a const reference.
In that case, only const methods may be called on self.
"""
def lef_pins_datatype(self, mask: int) -> int:
r"""
@brief Gets the LEF pin geometry layer datatype value per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def lef_pins_suffix_per_mask(self, mask: int) -> str:
r"""
@brief Gets the LEF pin geometry layer name suffix per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def pins_datatype(self, mask: int) -> int:
r"""
@brief Gets the pin geometry layer datatype value per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def pins_suffix_per_mask(self, mask: int) -> str:
@ -49903,13 +49763,6 @@ class LEFDEFReaderConfiguration:
@brief Gets the pin geometry layer name suffix per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def routing_datatype(self, mask: int) -> int:
r"""
@brief Gets the routing geometry layer datatype value per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def routing_suffix_per_mask(self, mask: int) -> str:
@ -50003,13 +49856,6 @@ class LEFDEFReaderConfiguration:
See \produce_via_geometry for details about this property.
The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def special_routing_datatype(self, mask: int) -> int:
r"""
@brief Gets the special routing geometry layer datatype value per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def special_routing_suffix_per_mask(self, mask: int) -> str:
@ -50017,14 +49863,6 @@ class LEFDEFReaderConfiguration:
@brief Gets the special routing geometry layer name suffix per mask.
See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def via_geometry_datatype(self, mask: int) -> int:
r"""
@brief Gets the via geometry layer datatype value per mask.
See \produce_via_geometry for details about this property.
The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
"""
def via_geometry_suffix_per_mask(self, mask: int) -> str:

View File

@ -1688,12 +1688,6 @@ class LayerProperties:
Usually it's not required to call this method. It has been introduced in version 0.24.
"""
def animation(self, real: bool) -> int:
r"""
@brief Gets the animation state
The animation state is an integer either being 0 (static), 1 (scrolling), 2 (blinking) or 3 (inversely blinking)
"""
def assign(self, other: LayerProperties) -> None:
r"""
@brief Assigns another object to self
@ -1755,14 +1749,6 @@ class LayerProperties:
This method returns true, if the object was destroyed, either explicitly or by the C++ side.
The latter may happen, if the object is owned by a C++ object which got destroyed itself.
"""
def dither_pattern(self, real: bool) -> int:
r"""
@brief Gets the dither pattern index
This method may deliver an invalid dither pattern index if it is not set.
@param real Set to true to return the real instead of local value
"""
def dup(self) -> LayerProperties:
r"""
@brief Creates a copy of self
@ -1842,22 +1828,6 @@ class LayerProperties:
This method has been introduced in version 0.25.
"""
def fill_brightness(self, real: bool) -> int:
r"""
@brief Gets the fill brightness value
If the brightness is not set, this method may return an invalid value
@param real Set to true to return the real instead of local value
"""
def fill_color(self, real: bool) -> int:
r"""
@brief Gets the fill color
This method may return an invalid color if the color is not set.
@param real Set to true to return the real instead of local value
"""
def flat(self) -> LayerProperties:
r"""
@brief Returns the "flattened" (effective) layer properties entry for this node
@ -1866,22 +1836,6 @@ class LayerProperties:
This object represents the effective layer properties for the given node. In particular, all 'local' properties are identical to the 'real' properties. Such an object can be used as a basis for manipulations.
This method has been introduced in version 0.22.
"""
def frame_brightness(self, real: bool) -> int:
r"""
@brief Gets the frame brightness value
If the brightness is not set, this method may return an invalid value
@param real Set to true to return the real instead of local value
"""
def frame_color(self, real: bool) -> int:
r"""
@brief Gets the frame color
This method may return an invalid color if the color is not set.
@param real Set to true to return the real instead of local value
"""
@overload
def has_dither_pattern(self) -> bool:
r"""
@ -2000,21 +1954,6 @@ class LayerProperties:
This is the index of the actual layer used. The source specification given by \source_layer, \source_datatype, \source_name is evaluated and the corresponding layer is looked up in the layout object. If a \source_layer_index is specified, this layer index is taken as the layer index to use.
"""
def line_style(self, real: bool) -> int:
r"""
@brief Gets the line style index
This method may deliver an invalid line style index if it is not set (see \has_line_style?).
@param real Set to true to return the real instead of local value
This method has been introduced in version 0.25.
"""
def lower_hier_level(self, real: bool) -> int:
r"""
@brief Gets the lower hierarchy level shown
This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_lower_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level.
"""
@overload
def lower_hier_level_mode(self) -> int:
r"""
@ -2052,10 +1991,6 @@ class LayerProperties:
This method has been introduced in version 0.19.
"""
def marked(self, real: bool) -> bool:
r"""
@brief Gets the marked state
"""
@overload
def set_lower_hier_level(self, level: int, relative: bool) -> None:
r"""
@ -2092,73 +2027,6 @@ class LayerProperties:
This method has been introduced in version 0.20.
"""
def source(self, real: bool) -> str:
r"""
@brief Gets the source specification
This method delivers the source specification as a string
@param real Set to true to return the computed instead of local value
"""
def source_cellview(self, real: bool) -> int:
r"""
@brief Gets the cellview index that this layer refers to
If "real" is true, the effective value is returned.
"""
def source_datatype(self, real: bool) -> int:
r"""
@brief Gets the stream datatype that the shapes are taken from
If the datatype is positive, the actual layer is looked up by this stream datatype. If a name or layer index is specified, the stream datatype is not used.
If "real" is true, the effective value is returned.
"""
def source_layer(self, real: bool) -> int:
r"""
@brief Gets the stream layer that the shapes are taken from
If the layer is positive, the actual layer is looked up by this stream layer. If a name or layer index is specified, the stream layer is not used.
If "real" is true, the effective value is returned.
"""
def source_layer_index(self, real: bool) -> int:
r"""
@brief Gets the layer index that the shapes are taken from
If the layer index is positive, the shapes drawn are taken from this layer rather than searched for by layer and datatype. This property is stronger than the layer/datatype or name specification.
A different method is \layer_index which indicates the ID of the layer actually used. While "source_layer_index" is one of several ways to address the layer drawn, "layer_index" is the ID (index) of the layer matching the source specification and is >= 0 if such a layer is found.
If "real" is true, the effective value is returned.
"""
def source_name(self, real: bool) -> str:
r"""
@brief Gets the stream name that the shapes are taken from
If the name is non-empty, the actual layer is looked up by this stream layer name. If a layer index (see \layer_index) is specified, the stream datatype is not used.
A name is only meaningful for OASIS files.
If "real" is true, the effective value is returned.
"""
def trans(self, real: bool) -> List[db.DCplxTrans]:
r"""
@brief Gets the transformations that the layer is transformed with
The transformations returned by this accessor is the one used for displaying this layer. The layout is transformed with each of these transformations before it is drawn.
If "real" is true, the effective value is returned.
"""
def transparent(self, real: bool) -> bool:
r"""
@brief Gets the transparency state
"""
def upper_hier_level(self, real: bool) -> int:
r"""
@brief Gets the upper hierarchy level shown
This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_upper_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level.
"""
@overload
def upper_hier_level_mode(self) -> int:
r"""
@ -2196,24 +2064,6 @@ class LayerProperties:
This method has been introduced in version 0.19.
"""
def valid(self, real: bool) -> bool:
r"""
@brief Gets the validity state
"""
def visible(self, real: bool) -> bool:
r"""
@brief Gets the visibility state
"""
def width(self, real: bool) -> int:
r"""
@brief Gets the line width
"""
def xfill(self, real: bool) -> bool:
r"""
@brief Gets a value indicating whether shapes are drawn with a cross
This attribute has been introduced in version 0.25.
"""
class LayerPropertiesNode(LayerProperties):
r"""
@ -12875,14 +12725,6 @@ class MainWindow(QMainWindow_Native):
This method has been introduced in version 0.26.
"""
def synchronous(self, sync_mode: bool) -> None:
r"""
@brief Puts the main window into synchronous mode
@param sync_mode 'true' if the application should behave synchronously
In synchronous mode, an application is allowed to block on redraw. While redrawing, no user interactions are possible. Although this is not desirable for smooth operation, it can be beneficial for test or automation purposes, i.e. if a screenshot needs to be produced once the application has finished drawing.
"""
def view(self, n: int) -> LayoutView:
r"""
@brief Returns a reference to a view object by index