1 # -*- coding: utf-8 -*-
3 from __future__
import absolute_import
6 from jben
.preferences
import Preferences
7 from jben
.dict import DictManager
8 from jben
import global_refs
11 class Application(object):
13 def __init__(self
, interface
):
14 if interface
== "gtk":
15 from jben
.interface
import gtk
16 self
.interface
= gtk
.Interface(self
)
17 elif interface
== "console":
18 from jben
.interface
import console
19 self
.interface
= console
.Interface(self
)
21 raise ValueError(_("Interface not supported"), interface
)
23 self
.prefs
= Preferences(self
)
24 self
.dictmgr
= DictManager(self
)
25 global_refs
.app
= self
28 result
= self
.interface
.run()
32 def get_home_dir(self
):
39 assert home
, _("Could not get home directory from environment.")
42 def get_settings_dir(self
):
44 "nt": "J-Ben Settings",
47 path
= os
.path
.join(self
.get_home_dir(), dir_d
[os
.name
])