~vcs-imports/gnome-mag/master

« back to all changes in this revision

Viewing changes to colorblind/__init__.py

  • Committer: Carlos Eduardo Rodrigues Diógenes
  • Date: 2007-06-03 23:52:07 UTC
  • Revision ID: git-v1:42a8898cb38357218626e4c81555423da8ab37cd
Tags: GNOME_MAG_0_14_5
commit the changes of the colorblind applet

svn path=/trunk/; revision=515

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os, sys
 
2
from os.path import join, exists, isdir, isfile, dirname, abspath, expanduser
 
3
 
 
4
import gtk, gtk.gdk, gconf
 
5
 
 
6
# Autotools set the actual data_dir in defs.py
 
7
from defs import *
 
8
 
 
9
try:
 
10
        # Allows to load uninstalled .la libs
 
11
        import ltihooks
 
12
except ImportError:
 
13
        pass
 
14
 
 
15
# Allow to use uninstalled deskbar --------------------------------------------
 
16
UNINSTALLED_COLORBLIND = False
 
17
def _check(path):
 
18
        return exists(path) and isdir(path) and isfile(path+"/AUTHORS")
 
19
        
 
20
name = join(dirname(__file__), '..')
 
21
if _check(name):
 
22
        UNINSTALLED_COLORBLIND = True
 
23
        
 
24
# Sets SHARED_DATA_DIR to local copy, or the system location
 
25
# Shared data dir is most the time /usr/share/colorblind-applet
 
26
if UNINSTALLED_COLORBLIND:
 
27
        SHARED_DATA_DIR = abspath(join(dirname(__file__), 'data'))
 
28
else:
 
29
        SHARED_DATA_DIR = join(DATA_DIR, "colorblind")
 
30
print "Data Dir: %s" % SHARED_DATA_DIR
 
31
 
 
32
# Set the cwd to the home directory so spawned processes behave correctly
 
33
# when presenting save/open dialogs
 
34
os.chdir(expanduser("~"))
 
35
 
 
36
# Path to images, icons
 
37
ART_DATA_DIR = join(SHARED_DATA_DIR, "art")
 
38
# Default icon size in the entry
 
39
ICON_WIDTH = 24
 
40
ICON_HEIGHT = 24
 
41
 
 
42
#Gconf client
 
43
GCONF_CLIENT = gconf.client_get_default()
 
44
 
 
45
# GConf directory for colorblind in window mode and shared settings
 
46
GCONF_DIR = "/apps/colorblind"
 
47
 
 
48
# GConf key for global keybinding
 
49
GCONF_KEYBINDING_ONOFF = GCONF_DIR + "/keybinding_on_off"
 
50
GCONF_KEYBINDING_SWITCH = GCONF_DIR + "/keybinding_switch"
 
51
 
 
52
#GConf key for colorblind filter
 
53
GCONF_COLORBLIND_FILTER = GCONF_DIR + "/colorblind_filter"
 
54
 
 
55
#GConf key for default colorblind filter
 
56
GCONF_DEFAULT_FILTER = GCONF_DIR + "/default_filter"
 
57
 
 
58
#GConf key for combobox check to change default filter
 
59
GCONF_CHECK_DEFAULT = GCONF_DIR + "/check_default"
 
60
 
 
61
# Global overrides for command line mode
 
62
UI_OVERRIDE = None