/usr/share/pyshared/mayavi/preferences/bindings.py is in mayavi2 4.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """
Code to setup the preferences for common objects.
"""
# Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
# Copyright (c) 2008, Prabhu Ramachandran
# License: BSD Style.
from preference_manager import preference_manager
def get_scene_preferences():
"""Return a dictionary of the scene's default preferences."""
pref = preference_manager.preferences
res = {}
res['stereo'] = eval(pref.get('tvtk.scene.stereo'))
res['magnification'] = \
eval(pref.get('tvtk.scene.magnification'))
res['foreground'] = eval(pref.get('tvtk.scene.foreground_color'))
res['background'] = eval(pref.get('tvtk.scene.background_color'))
return res
def set_scene_preferences(scene, prefs_dict=None):
"""Setup the preferences for a scene given a scene and an optional
dictionary with the preferences.
"""
if prefs_dict is None:
prefs_dict = get_scene_preferences()
# Set the preferences.
scene.set(**prefs_dict)
# If this isn't done the background isn't set.
scene.renderer.background = scene.background
|