File: defaults.py

package info (click to toggle)
python-ase 3.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,192 kB
  • ctags: 8,112
  • sloc: python: 93,375; sh: 99; makefile: 94
file content (22 lines) | stat: -rw-r--r-- 739 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
""" This is a module to handle generic ASE (gui) defaults from a ~/.ase/gui.py configuration file, if it exists.
It is imported when opening ase-gui and can then be modified at runtime, if necessary.
syntax for each entry:

gui_default_settings['key'] = value
"""

gui_default_settings = {
    'gui_graphs_string' : 'i, e - E[-1]',   # default for the graph command in the gui
    'gui_foreground_color': '#000000',
    'gui_background_color': '#ffffff',
    'covalent_radii' : None,
    'radii_scale': 0.89,
    }

def read_defaults():
    import os.path
    name = os.path.expanduser('~/.ase/gui.py')
    config = gui_default_settings
    if os.path.exists(name):
        exec(compile(open(name).read(), name, 'exec'))
    return config