Add-on to previous commit: fixes some Python issues

The comments for LoadLayoutOptions#layer_map, #cif_layer_map
and #dxf_layer_map have been updated to reflect the new status
of these properties (which have been methods). The tests
are updated accordingly (layer_map() -> layer_map).
This commit is contained in:
Matthias Koefferlein 2018-10-09 00:18:45 +02:00
parent db981b0f7d
commit a7846ead9f
4 changed files with 13 additions and 7 deletions

View File

@ -115,6 +115,8 @@ gsi::ClassExt<db::LoadLayoutOptions> common_reader_options (
"@return A reference to the layer map\n" "@return A reference to the layer map\n"
"\n" "\n"
"Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration." "Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration."
"\n"
"Python note: this method has been turned into a property in version 0.26."
) + ) +
gsi::method_ext ("create_other_layers?", &create_other_layers, gsi::method_ext ("create_other_layers?", &create_other_layers,
"@brief Gets a value indicating whether other layers shall be created\n" "@brief Gets a value indicating whether other layers shall be created\n"

View File

@ -129,7 +129,9 @@ gsi::ClassExt<db::LoadLayoutOptions> cif_reader_options (
"@return A reference to the layer map\n" "@return A reference to the layer map\n"
"\n" "\n"
"This method has been added in version 0.25 and replaces the respective global option in \\LoadLayoutOptions " "This method has been added in version 0.25 and replaces the respective global option in \\LoadLayoutOptions "
"in a format-specific fashion." "in a format-specific fashion.\n"
"\n"
"Python note: this method has been turned into a property in version 0.26."
) + ) +
gsi::method_ext ("cif_create_other_layers?", &create_other_layers, gsi::method_ext ("cif_create_other_layers?", &create_other_layers,
"@brief Gets a value indicating whether other layers shall be created\n" "@brief Gets a value indicating whether other layers shall be created\n"

View File

@ -204,6 +204,8 @@ gsi::ClassExt<db::LoadLayoutOptions> dxf_reader_options (
"\n" "\n"
"This method has been added in version 0.25 and replaces the respective global option in \\LoadLayoutOptions " "This method has been added in version 0.25 and replaces the respective global option in \\LoadLayoutOptions "
"in a format-specific fashion." "in a format-specific fashion."
"\n"
"Python note: this method has been turned into a property in version 0.26."
) + ) +
gsi::method_ext ("dxf_create_other_layers?", &create_other_layers, gsi::method_ext ("dxf_create_other_layers?", &create_other_layers,
"@brief Gets a value indicating whether other layers shall be created\n" "@brief Gets a value indicating whether other layers shall be created\n"

View File

@ -31,14 +31,14 @@ class DBReadersTests(unittest.TestCase):
lm.map(pya.LayerInfo(1, 0), 2, pya.LayerInfo(42, 17)) lm.map(pya.LayerInfo(1, 0), 2, pya.LayerInfo(42, 17))
opt.set_layer_map(lm, True) opt.set_layer_map(lm, True)
self.assertEqual(opt.layer_map().to_string(), "1/0 : 42/17\n") self.assertEqual(opt.layer_map.to_string(), "1/0 : 42/17\n")
self.assertEqual(opt.create_other_layers, True) self.assertEqual(opt.create_other_layers, True)
opt.create_other_layers = False opt.create_other_layers = False
self.assertEqual(opt.create_other_layers, False) self.assertEqual(opt.create_other_layers, False)
opt.select_all_layers() opt.select_all_layers()
self.assertEqual(opt.layer_map().to_string(), "") self.assertEqual(opt.layer_map.to_string(), "")
self.assertEqual(opt.create_other_layers, True) self.assertEqual(opt.create_other_layers, True)
opt.text_enabled = True opt.text_enabled = True
@ -88,14 +88,14 @@ class DBReadersTests(unittest.TestCase):
lm.map(pya.LayerInfo(1, 0), 2, pya.LayerInfo(42, 17)) lm.map(pya.LayerInfo(1, 0), 2, pya.LayerInfo(42, 17))
opt.dxf_set_layer_map(lm, True) opt.dxf_set_layer_map(lm, True)
self.assertEqual(opt.dxf_layer_map().to_string(), "1/0 : 42/17\n") self.assertEqual(opt.dxf_layer_map.to_string(), "1/0 : 42/17\n")
self.assertEqual(opt.dxf_create_other_layers, True) self.assertEqual(opt.dxf_create_other_layers, True)
opt.dxf_create_other_layers = False opt.dxf_create_other_layers = False
self.assertEqual(opt.dxf_create_other_layers, False) self.assertEqual(opt.dxf_create_other_layers, False)
opt.dxf_select_all_layers() opt.dxf_select_all_layers()
self.assertEqual(opt.dxf_layer_map().to_string(), "") self.assertEqual(opt.dxf_layer_map.to_string(), "")
self.assertEqual(opt.dxf_create_other_layers, True) self.assertEqual(opt.dxf_create_other_layers, True)
opt.dxf_dbu = 0.5 opt.dxf_dbu = 0.5
@ -144,14 +144,14 @@ class DBReadersTests(unittest.TestCase):
lm.map(pya.LayerInfo(1, 0), 2, pya.LayerInfo(42, 17)) lm.map(pya.LayerInfo(1, 0), 2, pya.LayerInfo(42, 17))
opt.cif_set_layer_map(lm, True) opt.cif_set_layer_map(lm, True)
self.assertEqual(opt.cif_layer_map().to_string(), "1/0 : 42/17\n") self.assertEqual(opt.cif_layer_map.to_string(), "1/0 : 42/17\n")
self.assertEqual(opt.cif_create_other_layers, True) self.assertEqual(opt.cif_create_other_layers, True)
opt.cif_create_other_layers = False opt.cif_create_other_layers = False
self.assertEqual(opt.cif_create_other_layers, False) self.assertEqual(opt.cif_create_other_layers, False)
opt.cif_select_all_layers() opt.cif_select_all_layers()
self.assertEqual(opt.cif_layer_map().to_string(), "") self.assertEqual(opt.cif_layer_map.to_string(), "")
self.assertEqual(opt.cif_create_other_layers, True) self.assertEqual(opt.cif_create_other_layers, True)
opt.cif_keep_layer_names = True opt.cif_keep_layer_names = True