Font selection added. Preference saving/loading improved.
[jben2_gui.git] / jben_global.py
blob0f4d64de8cee8fb49f49b3bf8a6a62a74ddeadc0
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 # Project: J-Ben, Python front-end
5 # File: jben_global.py
6 # Author: Paul Goins
7 # Created on: 25 Nov 2008
9 import os
11 VERSION_STR = "1.99"
12 """This is the current version of J-Ben."""
14 # These were "constants" under the C++ interface.
15 # However, since J-Ben has an alternate Japanese name (J勉),
16 # and since my name can be written in katakana, or the copyright
17 # date written in other numbering systems (heisei-based, etc.),
18 # I'm now using gettext on these "constants".
19 PROGRAM_NAME = _("J-Ben/python")
20 """The name of this edition of J-Ben."""
21 AUTHOR_NAME = _("Paul Goins")
22 """The name of the author."""
23 COPYRIGHT_DATE = _("2007, 2008")
24 """Copyright date."""
27 JB_DATADIR = None
28 """
29 This represents the default data directory for J-Ben. For UNIX-type systems,
30 this typically is "/usr/local/share/jben" or "/usr/share/jben". For Windows
31 systems, it should be "..". (Note the /; J-Ben will convert /'s to \'s as
32 necessary.)
34 If JB_DATADIR is None, then J-Ben will try to search all these locations for
35 the data folder. This can be overridden by specifying a specific value here.
36 """
38 if JB_DATADIR is None:
39 if os.name == "nt":
40 JB_DATADIR = ".."
41 else:
42 if os.path.isdir("/usr/local/share/jben"):
43 JB_DATADIR = "/usr/local/share/jben"
44 elif os.path.isdir("/usr/share/jben"):
45 JB_DATADIR = "/usr/share/jben"
46 else:
47 JB_DATADIR = ".." # Fallback; this may be used on future Linux-based
48 # mobile installs.
49 pass
51 if os.name == "nt":
52 CFG_FILE = "pyjben.cfg"
53 HOME_ENV = "APPDATA"
54 else:
55 CFG_FILE = ".pyjben"
56 HOME_ENV = "HOME"