Skip to content

Commit

Permalink
Remove unused imports, single line stmts and closed handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsurti committed Jul 29, 2015
1 parent b3fa503 commit f6c8a1a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
3 changes: 3 additions & 0 deletions mayavi/core/engine.py
Expand Up @@ -580,6 +580,9 @@ def _closed_fired(self):
"""
self._viewer_ref.clear()
self.scenes = []
preference_manager.root.on_trait_change(self._show_helper_nodes_changed,
'show_helper_nodes',
remove=True)
registry.unregister_engine(self)

def _show_helper_nodes_changed(self):
Expand Down
3 changes: 2 additions & 1 deletion mayavi/core/registry.py
Expand Up @@ -73,7 +73,8 @@ def unregister_engine(self, engine_or_name):
name = key
break

if name: del engines[name]
if name:
del engines[name]
logger.debug('Engine named %s unregistered', name)

def get_file_reader(self, filename):
Expand Down
4 changes: 0 additions & 4 deletions mayavi/tests/test_mlab_scene_model.py
@@ -1,15 +1,11 @@
"""
Testing the MlabSceneModel
"""
import gc
import unittest
import weakref

import numpy as np

from traits.api import HasTraits, Instance
from traits.etsconfig.api import ETSConfig
from tvtk.tests.common import restore_gc_state
from mayavi.tools.mlab_scene_model import MlabSceneModel
from mayavi import mlab

Expand Down
6 changes: 0 additions & 6 deletions tvtk/pyface/scene_model.py
Expand Up @@ -62,9 +62,6 @@ class SceneModel(TVTKScene):
# The control is going to be closed.
closing = Event()

# The control has been closed.
closed = Event()

# This exists just to mirror the TVTKWindow api.
scene = Property

Expand Down Expand Up @@ -333,9 +330,6 @@ def _get_light_manager(self):
######################################################################
# SceneModel API.
######################################################################
def _closed_fired(self):
super(SceneModel, self)._closed_fired()

def _get_scene(self):
"""Getter for the scene property."""
return self
Expand Down
3 changes: 0 additions & 3 deletions tvtk/pyface/ui/qt4/decorated_scene.py
Expand Up @@ -71,9 +71,6 @@ def __get_pure_state__(self):
##########################################################################
# Non-public interface.
##########################################################################
def _closed_fired(self):
super(DecoratedScene, self)._closed_fired()

def _create_control(self, parent):
""" Create the toolkit-specific control that represents the widget.
Expand Down
3 changes: 0 additions & 3 deletions tvtk/pyface/ui/wx/decorated_scene.py
Expand Up @@ -81,9 +81,6 @@ def __get_pure_state__(self):
##########################################################################
# Non-public interface.
##########################################################################
def _closed_fired(self):
super(DecoratedScene, self)._closed_fired()

def _create_control(self, parent):
""" Create the toolkit-specific control that represents the widget.
Expand Down
3 changes: 2 additions & 1 deletion tvtk/tests/common.py
Expand Up @@ -48,7 +48,8 @@ def object_collected_callback(weakref):
def do():
obj = obj_create_fn()
reference = weakref.ref(obj, object_collected_callback)
if obj_close_fn: obj_close_fn(obj)
if obj_close_fn:
obj_close_fn(obj)
return reference

# when
Expand Down

0 comments on commit f6c8a1a

Please sign in to comment.