~ubuntu-branches/ubuntu/trusty/mayavi2/trusty

« back to all changes in this revision

Viewing changes to tvtk/vtk_parser.py

  • Committer: Package Import Robot
  • Author(s): Varun Hiremath
  • Date: 2012-04-23 16:36:45 UTC
  • mfrom: (1.1.11) (2.2.6 sid)
  • Revision ID: package-import@ubuntu.com-20120423163645-wojak95rklqlbi1y
Tags: 4.1.0-1
* New upstream release
* Bump Standards-Version to 3.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
        # methods is wrong since the child changes the trait definition
191
191
        # which breaks things.  We therefore do not remove any of the
192
192
        # Get/SetThings that are ignored due to them being in the
193
 
        # parent.
 
193
        # parent.  However one has to be careful about cases where these are
 
194
        # really Toggle (ThingOn) or State (SetThingToThong) etc. methods and
 
195
        # in those cases we really should ignore the method.  So in essence,
 
196
        # any Get/Set pair that is not a State or Toggle should be redefined.
194
197
        overrides = []
195
198
        for m in methods:
196
199
            check = False
202
205
                check = True
203
206
            if check:
204
207
                if m1 in methods and (m1 in ignore or m in ignore):
205
 
                    skip.extend([m1, m])
 
208
                    # Skips are stored as Set followed by Get.
 
209
                    skip.extend(['Set' +m[3:], 'Get'+m[3:]])
 
210
 
 
211
        for m in skip[:]:
 
212
            if m.startswith('Set'):
 
213
                base = m[3:]
 
214
                mg, ms = 'Get' + base, 'Set' + base
 
215
                m_st = 'Set' + base + 'To'
 
216
                m_t = base + 'Off'
 
217
                for method in methods:
 
218
                    if m_st in method or m_t == method:
 
219
                        skip.remove(ms)
 
220
                        skip.remove(mg)
 
221
                        break
206
222
 
207
223
        if 'GetViewProp' in methods and 'GetProp' in methods:
208
224
            ignore.extend(['GetProp', 'SetProp'])
518
534
                                meths.remove('Get' + key + 'AsString')
519
535
                            except ValueError:
520
536
                                pass
521
 
 
522
537
        # Find the values for each of the states, i.e. find that
523
538
        # vtkProperty.SetRepresentationToWireframe() corresponds to
524
539
        # vtkProperty.SetRepresentation(1).
525
540
        if sm:
526
541
            obj = self._get_instance(klass)
527
 
            if obj:
 
542
            klass_name = klass.__name__
 
543
            if obj and not klass_name.endswith('Viewer'):
 
544
                # We do not try to inspect viewers, because they'll
 
545
                # trigger segfaults during the inspection
528
546
                for key, values in sm.items():
529
547
                    default = getattr(obj, 'Get%s'%key)()
530
548
                    for x in values[:]: