Update README.md to specify the python requirements
[time-slider.git] / usr / share / time-slider / lib / time_slider / __init__.py
1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 import sys
23 from os.path import abspath, dirname, join, pardir
24 sys.path.insert(0, join(dirname(__file__), pardir, "plugin"))
25
26 # here we define the path constants so that other modules can use it.
27 # this allows us to get access to the shared files without having to
28 # know the actual location, we just use the location of the current
29 # file and use paths relative to that.
30 SHARED_FILES = abspath(join(dirname(__file__), pardir, pardir))
31 LOCALE_PATH = join('/usr', 'share', 'locale')
32 RESOURCE_PATH = join(SHARED_FILES, 'res')
33
34 # the name of the gettext domain. because we have our translation files
35 # not in a global folder this doesn't really matter, setting it to the
36 # application name is a good idea tough.
37 GETTEXT_DOMAIN = 'time-slider'
38
39 # set up the gettext system and locales
40 import gettext
41 import locale
42
43 locale.setlocale(locale.LC_ALL, '')
44 gettext.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH)
45 gettext.textdomain(GETTEXT_DOMAIN)
46
47 # register the gettext function for the whole interpreter as "_"
48 import builtins
49 builtins._ = gettext.gettext
50
51
52