Merge lp://staging/~vaudano/babiloo/efl into lp://staging/babiloo

Proposed by zeusOne
Status: Needs review
Proposed branch: lp://staging/~vaudano/babiloo/efl
Merge into: lp://staging/babiloo
Diff against target: 2582 lines (+2149/-10)
48 files modified
.bzrignore (+34/-0)
core/dictionary/pystardict.py (+31/-2)
core/modules/configuration.py (+2/-0)
core/modules/constants.py (+22/-0)
core/modules/status.py (+70/-0)
debian/babiloo.install (+7/-0)
debian/babiloo.links (+1/-0)
debian/babiloo.manpages (+1/-0)
debian/babiloo.menu (+5/-0)
debian/changelog (+52/-0)
debian/compat (+1/-0)
debian/control (+20/-0)
debian/copyright (+84/-0)
debian/rules (+27/-0)
debian/watch (+3/-0)
doc/efl/babiloo.tex (+28/-0)
doc/efl/configuration.tex (+12/-0)
doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo (+8/-0)
doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo (+7/-0)
doc/efl/frontPage.tex (+3/-0)
doc/efl/genDoc.sh (+2/-0)
doc/efl/installation.tex (+34/-0)
doc/efl/intro.tex (+4/-0)
doc/efl/planning.tex (+125/-0)
doc/efl/source.tex (+7/-0)
doc/efl/version0.1.tex (+38/-0)
doc/efl/version0.2.tex (+39/-0)
doc/efl/version0.3.tex (+23/-0)
doc/efl/version0.4.tex (+15/-0)
efl/__init__.py (+21/-0)
efl/about_ui.py (+124/-0)
efl/babiloo-efl.bb (+41/-0)
efl/babiloo.desktop (+11/-0)
efl/config.py (+56/-0)
efl/constants.py (+67/-0)
efl/definition_ui.py (+173/-0)
efl/dictionaries_ui.py (+196/-0)
efl/main.py (+48/-0)
efl/main_model.py (+352/-0)
efl/main_ui.py (+117/-0)
efl/settings_ui.py (+140/-0)
efl/utils_ui.py (+77/-0)
qt/about_ui.py (+2/-2)
qt/chooseLanguage_ui.py (+2/-2)
qt/images_rc.py (+1/-1)
qt/main_ui.py (+1/-1)
qt/settings_ui.py (+2/-2)
run.py (+13/-0)
To merge this branch: bzr merge lp://staging/~vaudano/babiloo/efl
Reviewer Review Type Date Requested Status
The Developers of the Babiloo Project Pending
Review via email: mp+11119@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
zeusOne (vaudano) wrote :

Hi,
I noticed two things from the review.diff:

1 .bzignore is wrong (keep the trunk version)
2 the debian directory should be in another repository, I think

Cheers
Luca

On Thu, Sep 3, 2009 at 1:35 PM, zeusOne<email address hidden> wrote:
> zeusOne has proposed merging lp:~vaudano/babiloo/efl into lp:babiloo.
>
> Requested reviews:
>    The Developers of the Babiloo Project (babiloo-developers)
> --
> https://code.launchpad.net/~vaudano/babiloo/efl/+merge/11119
> You are the owner of lp:~vaudano/babiloo/efl.
>

lp://staging/~vaudano/babiloo/efl updated
266. By Luca Vaudano <vaudano@debian-navi>

Database not found error

267. By Luca Vaudano <vaudano@debian-navi>

ecore.idler_add doesn't work well on desktop

268. By Luca Vaudano <vaudano@debian-navi>

Comment

269. By Luca Vaudano <vaudano@debian-navi>

Nicer file structure (gui, controller, model)

270. By Luca Vaudano <vaudano@debian-navi>

Fix loading database frame

271. By Luca Vaudano <vaudano@debian-navi>

Fix loading frame problem

272. By Luca Vaudano <vaudano@debian-navi>

Empty windows for Settings and Dictionaries, configuration file not present error

273. By Luca Vaudano <vaudano@debian-navi>

Start the program without database, it shows warning not error

274. By zeusOne <zeusone@maggie>

Fix UI for Netbook

275. By zeusOne <zeusone@maggie>

Working on the dictionaries tab

276. By Luca Vaudano <vaudano@debian-navi>

Dictionaries tab - New dictionary via file selector

277. By Luca Vaudano <vaudano@debian-navi>

New configuration management - not working :)

278. By Luca Vaudano <vaudano@debian-navi>

New configuration mechanism merged

279. By Luca Vaudano <vaudano@debian-navi>

Adapt for using Progress Bar, touched the pyStarDict file

280. By root <root@maggie>

Sound dictionary configuration

281. By Luca Vaudano <vaudano@debian-navi>

Added documentation and released files

282. By zeusOne <zeusone@maggie>

No progress bar

283. By Luca Vaudano <vaudano@debian-navi>

Dictionaries for performance testing

284. By Luca Vaudano <vaudano@debian-navi>

Move files to the doc directory

285. By zeusOne <zeusone@maggie>

Validation dictionary entry, sound dictionary entry, using dialog for loading frame

286. By zeusOne <zeusone@maggie>

Pager instead of multiple windows

287. By Luca Vaudano <vaudano@debian-navi>

Settings - Player and about page

288. By Luca Vaudano <vaudano@debian-navi>

One page different boxes - No pager

289. By Luca Vaudano <vaudano@debian-navi>

Released file and images for v0.2

290. By Luca Vaudano <vaudano@debian-navi>

Fix - Sound setting problem

291. By Luca Vaudano <vaudano@debian-navi>

Alignment with new elm-entry behaviout without br

292. By Luca Vaudano <vaudano@debian-navi>

Fix bug - Dialog always on top

293. By Luca Vaudano <vaudano@debian-navi>

New released file 2.0.9-2b

294. By Luca Vaudano <vaudano@debian-navi>

2.0.9-3 version

295. By Luca Vaudano <vaudano@debian-navi>

Changed source tarball position

296. By Luca Vaudano <vaudano@debian-navi>

Version 2.0.9-4 python-elementary alignment

297. By Luca Vaudano <vaudano@debian-navi>

Updated documentation

298. By Elive User <luca@Elive>

New release

299. By Elive User <luca@Elive>

New release

300. By Luca Vaudano <vaudano@debian-navi>

Final release

Unmerged revisions

300. By Luca Vaudano <vaudano@debian-navi>

Final release

299. By Elive User <luca@Elive>

New release

298. By Elive User <luca@Elive>

New release

297. By Luca Vaudano <vaudano@debian-navi>

Updated documentation

296. By Luca Vaudano <vaudano@debian-navi>

Version 2.0.9-4 python-elementary alignment

295. By Luca Vaudano <vaudano@debian-navi>

Changed source tarball position

294. By Luca Vaudano <vaudano@debian-navi>

2.0.9-3 version

293. By Luca Vaudano <vaudano@debian-navi>

New released file 2.0.9-2b

292. By Luca Vaudano <vaudano@debian-navi>

Fix bug - Dialog always on top

291. By Luca Vaudano <vaudano@debian-navi>

Alignment with new elm-entry behaviout without br

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2009-03-09 00:05:55 +0000
+++ .bzrignore 2010-02-08 17:08:17 +0000
@@ -5,3 +5,37 @@
5dicts/en_vi5dicts/en_vi
6dicts/vi_en6dicts/vi_en
7dicts/vi_vi7dicts/vi_vi
8*.debhelper
9*.log
10debian/babiloo
11debian/files
12debian/babiloo.substvars
13qt
14qt/about.py
15qt/about.ui
16qt/about_ui.py
17qt/chooseLanguage.py
18qt/chooseLanguage.ui
19qt/chooseLanguage_ui.py
20qt/contentSearchModel.py
21qt/definitionView.py
22qt/dictfilemanager.py
23qt/dictionariesview.py
24qt/gui_widgets.py
25qt/historylistmodel.py
26qt/images_rc.py
27qt/__init__.py
28qt/main.py
29qt/main.ui
30qt/main_ui.py
31qt/Makefile
32qt/onlineDictionariesView.py
33qt/plugins
34qt/Qt2Po.py
35qt/settings.py
36qt/settings.ui
37qt/settings_ui.py
38qt/SplashScreen.py
39qt/wordlistmodel.py
40*.aux
41*.log
842
=== modified file 'core/dictionary/pystardict.py'
--- core/dictionary/pystardict.py 2009-05-25 12:31:48 +0000
+++ core/dictionary/pystardict.py 2010-02-08 17:08:17 +0000
@@ -26,6 +26,9 @@
26from dictionary import DictionaryType, DictFormatError, Definition26from dictionary import DictionaryType, DictFormatError, Definition
27import core.modules.utils as utils27import core.modules.utils as utils
2828
29from core.modules.constants import *
30from core.modules.status import Status
31
29try:32try:
30 from hashlib import md533 from hashlib import md5
31 new_hash = md534 new_hash = md5
@@ -34,6 +37,10 @@
34 import md537 import md5
35 new_hash = md5.new38 new_hash = md5.new
3639
40if PROGRESS_BAR == "on":
41 status = Status()
42 status.setSteps(2)
43
37class _StarDictIfo():44class _StarDictIfo():
38 """45 """
39 The .ifo file has the following format:46 The .ifo file has the following format:
@@ -174,12 +181,23 @@
174 raise Exception('words count is incorrect')181 raise Exception('words count is incorrect')
175182
176 # unpack parsed records183 # unpack parsed records
184 if PROGRESS_BAR == "on":
185 tot = len(matched_records)
186 i = 0
187 perc = 0
177 for matched_record in matched_records:188 for matched_record in matched_records:
189 if PROGRESS_BAR == "on":
190 currentPerc = (i * MAX_SINGLE_STEP) / tot
191 if currentPerc != perc:
192 perc = currentPerc
193 status.setStatus(0, perc)
194 i = i + 1
178 c = matched_record.find('\x00') + 1195 c = matched_record.find('\x00') + 1
179 record_tuple = unpack('!%sc%sL' % (c, idx_offset_format),196 record_tuple = unpack('!%sc%sL' % (c, idx_offset_format),
180 matched_record)197 matched_record)
181 word, cords = record_tuple[:c-1], record_tuple[c:]198 word, cords = record_tuple[:c-1], record_tuple[c:]
182 self._idx[word] = cords 199 self._idx[word] = cords
200
183201
184 def __getitem__(self, word):202 def __getitem__(self, word):
185 """203 """
@@ -461,15 +479,26 @@
461 479
462 #Sorting keys 480 #Sorting keys
463 self._DictionaryType__keys = self.keys()481 self._DictionaryType__keys = self.keys()
464 self._DictionaryType__keys.sort(utils.normalized_comparison)482 if STARDICT_SORT_KEY == "on":
483 self._DictionaryType__keys.sort(utils.normalized_comparison)
465# print self.idx._idx.keys()484# print self.idx._idx.keys()
466485
467 def keys(self):486 def keys(self):
468 """487 """
469 raises NotImplemented exception488 raises NotImplemented exception
470 """489 """
490 if PROGRESS_BAR == "on":
491 tot = len(self.dict.keys())
492 i = 0
493 perc = 0
471 keys = []494 keys = []
472 for tupled_word in self.dict.keys():495 for tupled_word in self.dict.keys():
496 if PROGRESS_BAR == "on":
497 currentPerc = (i * MAX_SINGLE_STEP) / tot
498 if currentPerc != perc:
499 perc = currentPerc
500 status.setStatus(1, perc)
501 i = i + 1
473 try:502 try:
474 keys.append("".join(tupled_word).decode(self.encoding))503 keys.append("".join(tupled_word).decode(self.encoding))
475 except:504 except:
476505
=== modified file 'core/modules/configuration.py'
--- core/modules/configuration.py 2009-03-28 01:13:40 +0000
+++ core/modules/configuration.py 2010-02-08 17:08:17 +0000
@@ -37,6 +37,8 @@
37 # internal application options37 # internal application options
38 make_option("-g", "--gui", dest="mode", action="store_const", const="gui", #default="cli",38 make_option("-g", "--gui", dest="mode", action="store_const", const="gui", #default="cli",
39 help="Run applicatin in GUI mode. This is the default"),39 help="Run applicatin in GUI mode. This is the default"),
40 make_option("-e", "--efl", dest="mode", action="store_const", const="efl", default="gui",
41 help="Run applicatin in EFL mode"),
40 make_option("-c", "--cli", dest="mode", action="store_const", const="cli", default="gui",42 make_option("-c", "--cli", dest="mode", action="store_const", const="cli", default="gui",
41 help="Run applicatin in CLI mode"),43 help="Run applicatin in CLI mode"),
42 make_option("-d", "--debug", dest="logging", default=logging.INFO, 44 make_option("-d", "--debug", dest="logging", default=logging.INFO,
4345
=== added file 'core/modules/constants.py'
--- core/modules/constants.py 1970-01-01 00:00:00 +0000
+++ core/modules/constants.py 2010-02-08 17:08:17 +0000
@@ -0,0 +1,22 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18STARDICT_SORT_KEY = 'off'
19
20# Progress bar
21PROGRESS_BAR = 'off' # values: 'on' or 'off'
22MAX_SINGLE_STEP = 25 # for sure less than 100!
0\ No newline at end of file23\ No newline at end of file
124
=== added file 'core/modules/status.py'
--- core/modules/status.py 1970-01-01 00:00:00 +0000
+++ core/modules/status.py 2010-02-08 17:08:17 +0000
@@ -0,0 +1,70 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18from core.modules.constants import *
19
20# Singleton
21class Status:
22
23 class __impl:
24
25 # Initialization
26 def __init__(self):
27 status = 0
28 steps = 1
29
30 # Get status
31 def getStatus(self):
32 return status
33
34 # Set UI
35 def setUI(self, ui):
36 self.ui = ui
37
38 # Set steps to do
39 def setSteps(self, steps):
40 self.steps = steps
41
42 # Set status
43 def setStatus(self, step, value):
44 singleStepMax = 100 / self.steps
45 multiple = singleStepMax / MAX_SINGLE_STEP
46 status = (singleStepMax * step) + (value * multiple)
47 if self.ui is not None:
48 self.ui.setStatus(status)
49
50 # storage for the instance reference
51 __instance = None
52
53 def __init__(self):
54
55 # Check whether we already have an instance
56 if Status.__instance is None:
57
58 # Create instance
59 Status.__instance = Status.__impl()
60
61 # Store instance reference as the only member in the handle
62 self.__dict__['_Singleton__instance'] = Status.__instance
63
64 def __getattr__(self, attr):
65 """ Delegate access to implementation """
66 return getattr(self.__instance, attr)
67
68 def __setattr__(self, attr, value):
69 """ Delegate access to implementation """
70 return setattr(self.__instance, attr, value)
071
=== added directory 'debian'
=== added file 'debian/babiloo.install'
--- debian/babiloo.install 1970-01-01 00:00:00 +0000
+++ debian/babiloo.install 2010-02-08 17:08:17 +0000
@@ -0,0 +1,7 @@
1efl /usr/share/babiloo
2core /usr/share/babiloo
3images /usr/share/babiloo
4dicts /usr/share/babiloo
5run.py /usr/share/babiloo
6efl/babiloo.desktop /usr/share/applications
7images/babiloo.png /usr/share/pixmaps/
08
=== added file 'debian/babiloo.links'
--- debian/babiloo.links 1970-01-01 00:00:00 +0000
+++ debian/babiloo.links 2010-02-08 17:08:17 +0000
@@ -0,0 +1,1 @@
1usr/share/babiloo/run.py /usr/bin/babiloo
02
=== added file 'debian/babiloo.manpages'
--- debian/babiloo.manpages 1970-01-01 00:00:00 +0000
+++ debian/babiloo.manpages 2010-02-08 17:08:17 +0000
@@ -0,0 +1,1 @@
1babiloo.1
02
=== added file 'debian/babiloo.menu'
--- debian/babiloo.menu 1970-01-01 00:00:00 +0000
+++ debian/babiloo.menu 2010-02-08 17:08:17 +0000
@@ -0,0 +1,5 @@
1?package(babiloo):needs="X11" \
2 section="Applications/Office" \
3 title="Babiloo 2" \
4 command="/usr/bin/babiloo" \
5 icon="/usr/share/pixmaps/babiloo.xpm"
06
=== added file 'debian/changelog'
--- debian/changelog 1970-01-01 00:00:00 +0000
+++ debian/changelog 2010-02-08 17:08:17 +0000
@@ -0,0 +1,52 @@
1babiloo (2.0.9-4) karmic; urgency=low
2
3 [ Luca Vaudano ]
4 * Python-elementary alignment
5
6 -- Luca Vaudano <vaudano@debian-navi> Tue, 01 Dec 2009 10:55:55 +0100
7
8babiloo (2.0.9-3) karmic; urgency=low
9
10 [ Luca Vaudano ]
11 * EFL bug fixing
12
13 -- Luca Vaudano <vaudano@debian-navi> Fri, 27 Nov 2009 12:05:17 +0100
14
15babiloo (2.0.9-1) unstable; urgency=low
16
17 [ Ryan Kavanagh ]
18 * New upstream release
19 * Bumped standards version to 3.8.2
20
21 -- Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org> Fri, 26 Jun 2009 21:44:44 -0400
22
23babiloo (2.0.8-1) unstable; urgency=low
24
25 * New upstream version.
26 * debian/control:
27 + Improve long description (Closes: #528202).
28 + Change XS-Python-Version to >= 2.5 and bump python dependency
29 to 2.5.2 as upstream needs python 2.5 to work correctly.
30
31 -- Marco Rodrigues <gothicx@sapo.pt> Thu, 28 May 2009 19:51:31 +0100
32
33babiloo (2.0.7-1) unstable; urgency=low
34
35 * New upstream version.
36 * XPM icon provided by upstream. Removed.
37 * debian/babiloo.install:
38 + Use upstream xpm icon.
39 * debian/control:
40 + Bump Standards-Version to 3.8.1 (no changes).
41 * debian/rules:
42 + Rebuild QT ui files.
43 * debian/copyright:
44 + Add myself to upstream authors :)
45
46 -- Marco Rodrigues <gothicx@sapo.pt> Tue, 28 Apr 2009 12:30:40 +0000
47
48babiloo (2.0.3.1-1) unstable; urgency=low
49
50 * Initial Release (Closes: #510132).
51
52 -- Marco Rodrigues <gothicx@sapo.pt> Tue, 10 Mar 2009 20:58:02 +0000
053
=== added file 'debian/compat'
--- debian/compat 1970-01-01 00:00:00 +0000
+++ debian/compat 2010-02-08 17:08:17 +0000
@@ -0,0 +1,1 @@
17
02
=== added file 'debian/control'
--- debian/control 1970-01-01 00:00:00 +0000
+++ debian/control 2010-02-08 17:08:17 +0000
@@ -0,0 +1,20 @@
1Source: babiloo
2Section: utils
3Priority: optional
4Maintainer: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org>
5Uploaders: Luca Vaudano <vaudano@gmail.com>
6Build-Depends: debhelper (>= 7), python (>= 2.5.2-3)
7Build-Depends-Indep: python-support (>= 0.5.6)
8Standards-Version: 3.8.2
9Homepage: http://www.babiloo-project.org/
10
11Package: babiloo
12Architecture: all
13Depends: python-compression, python-misc, python-netclient
14Description: dictionary viewer.
15 It supports dictionaries in SDictionary and StarDict format.
16 Features:
17 * Don't convert dictionaries, use originals.
18 * Phonetic sounds.
19 .
20 This package contains the GUI frontend and common files.
021
=== added file 'debian/copyright'
--- debian/copyright 1970-01-01 00:00:00 +0000
+++ debian/copyright 2010-02-08 17:08:17 +0000
@@ -0,0 +1,84 @@
1This package was debianized by Marco Rodrigues <gothicx@sapo.pt> on
2Mon, 05 Jan 2009 10:05:30 +0000.
3
4It was downloaded from http://www.babiloo-project.org/
5
6Upstream Author: Ivan Garcia <ivangarcia@gmail.com>
7 Marco Ferreira <mferreira@devion.org>
8 Marco Rodrigues <gothicx@sapo.pt>
9
10Copyright:
11
12 Copyright (C) 2008-2009 by Ivan Garcia <ivangarcia@gmail.com>
13 Copyright (C) 2008-2009 by Marco Ferreira <mferreira@devion.org>
14 Copyright (C) 2008-2009 by Marco Rodrigues <gothicx@sapo.pt>
15
16License:
17
18 This package is free software; you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation; either version 2 of the License, or
21 (at your option) any later version.
22
23 This package is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
27
28 You should have received a copy of the GNU General Public License
29 along with this package; if not, write to the Free Software
30 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
32On Debian systems, the complete text of the GNU General
33Public License can be found in `/usr/share/common-licenses/GPL-3'.
34
35* core/dictionary/psdict.py:
36 Copyright (C) 2006 Dmitri Brechalov
37 Copyright (C) Igor Tkach, 2006
38
39 This program is free software; you can redistribute it and/or modify
40 it under the terms of the GNU General Public License as published by
41 the Free Software Foundation; either version 2 of the License, or
42 (at your option) any later version.
43 The full license is in the file COPYING, distributed as part of
44 this software.
45
46* core/dictionary/pystardict.py:
47 Copyright 2008 Serge Matveenko
48
49 PyStarDict is free software: you can redistribute it and/or modify
50 it under the terms of the GNU General Public License as published by
51 the Free Software Foundation, either version 3 of the License, or
52 (at your option) any later version.
53
54* languages/autodetect_lang.py:
55 Copyright (c) 2006 Thomas Mangin
56
57 This program is distributed under Gnu General Public License
58 (cf. the file COPYING in distribution). Alternatively, you can use
59 the program under the conditions of the Artistic License (as Perl).
60
61* modules/progressbar.py:
62 Copyright (C) 2005 Nilton Volpato
63
64 This library is free software; you can redistribute it and/or
65 modify it under the terms of the GNU Lesser General Public
66 License as published by the Free Software Foundation; either
67 version 2.1 of the License, or (at your option) any later version.
68
69 On Debian systems, the complete text of the GNU Lesser General
70 Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
71
72* locale/*:
73 Copyright (c) 2008-2009 Rosetta Contributors and Canonical Ltd 2008
74
75* efl/*:
76 Copyright (c) 2009 Luca Vaudano
77
78 This program is free software; you can redistribute it and/or modify
79 it under the terms of the GNU General Public License as published by
80 the Free Software Foundation; either version 2 of the License, or
81 (at your option) any later version.
82
83The Debian packaging is © 2009, Marco Rodrigues <gothicx@sapo.pt> and
84is licensed under the GPL, see above.
085
=== added file 'debian/rules'
--- debian/rules 1970-01-01 00:00:00 +0000
+++ debian/rules 2010-02-08 17:08:17 +0000
@@ -0,0 +1,27 @@
1#!/usr/bin/make -f
2
3LANGUAGES=$(shell find locale/ -maxdepth 1 -mindepth 1 -type d -not -name \.svn -printf "%f ")
4
5build:
6 dh build
7
8clean:
9 make -C qt/ clean
10 dh clean
11 find . -name "*\.py[co]" -delete
12
13install: build
14 make -C qt/ all
15 dh --with python_support install
16
17 # Make it executable to run.py
18 chmod +x debian/babiloo/usr/bin/babiloo
19
20binary-indep: build install
21 dh --with python_support binary-indep
22
23binary-arch: build install
24
25binary: binary-indep binary-arch
26
27.PHONY: build clean binary-indep binary-arch binary
028
=== added file 'debian/watch'
--- debian/watch 1970-01-01 00:00:00 +0000
+++ debian/watch 2010-02-08 17:08:17 +0000
@@ -0,0 +1,3 @@
1version=3
2https://launchpad.net/babiloo/+download \
3http://launchpad.net/babiloo/(?:.*)/(?:.*)/\+download/babiloo-(.*)\.tar\.gz
04
=== added directory 'doc'
=== added directory 'doc/efl'
=== added file 'doc/efl/babiloo.pdf'
1Binary files doc/efl/babiloo.pdf 1970-01-01 00:00:00 +0000 and doc/efl/babiloo.pdf 2010-02-08 17:08:17 +0000 differ5Binary files doc/efl/babiloo.pdf 1970-01-01 00:00:00 +0000 and doc/efl/babiloo.pdf 2010-02-08 17:08:17 +0000 differ
=== added file 'doc/efl/babiloo.tex'
--- doc/efl/babiloo.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/babiloo.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,28 @@
1\documentclass[english,a4paper,10pt]{article}
2\usepackage{enumerate} % need for alphabetic list enumeration
3\usepackage{amsmath,amssymb,amsfonts} % Typical maths resource packages
4\usepackage{graphicx} % Packages to allow inclusion of graphics
5\usepackage{color} % For creating coloured text and background
6\usepackage{times} % True Type Font
7\usepackage{babel} % English language
8\usepackage{subfigure} % Sub-figure for screenshots
9
10\begin{document}
11
12\include{frontPage}
13
14\include{intro}
15\include{installation}
16\include{configuration}
17\include{source}
18
19\section{Changelog}
20\include{version0.1}
21\include{version0.2}
22\include{version0.3}
23\include{version0.4}
24\include{version1.0}
25
26\include{planning}
27
28\end{document}
0\ No newline at end of file29\ No newline at end of file
130
=== added file 'doc/efl/configuration.tex'
--- doc/efl/configuration.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/configuration.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,12 @@
1\section{Configuration}
2
3\subsection{Dictionaries}
4
5\begin{itemize}
6 \item Download from the Web a dictionary\\
7 (e.g. http://sourceforge.net/projects/stardict/files/stardict-dictionaries-dictd/)
8 \item Unzip the dictionary (e.g. bunzip2 stardict-longman-2.4.2.tar.bz2 then tar xvf stardict-longman-2.4.2.tar)
9 \item Optionally, download and unzip a sound dictionary \\
10 (e.g. from http://sourceforge.net/projects/stardict/files/ the WyabdcRealPeopleTTS section)
11 \item Configure the 'Dictonaries tab', see \ref{dictionaryTab}, in the Babiloo GUI
12\end{itemize}
0\ No newline at end of file13\ No newline at end of file
114
=== added directory 'doc/efl/dictTest'
=== added file 'doc/efl/dictTest/CollinsCOBUILD.dct'
2Binary files doc/efl/dictTest/CollinsCOBUILD.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/CollinsCOBUILD.dct 2010-02-08 17:08:18 +0000 differ15Binary files doc/efl/dictTest/CollinsCOBUILD.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/CollinsCOBUILD.dct 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/dictTest/English_Italian.dct'
3Binary files doc/efl/dictTest/English_Italian.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/English_Italian.dct 2010-02-08 17:08:18 +0000 differ16Binary files doc/efl/dictTest/English_Italian.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/English_Italian.dct 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct'
4Binary files doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct 2010-02-08 17:08:18 +0000 differ17Binary files doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct 2010-02-08 17:08:18 +0000 differ
=== added directory 'doc/efl/dictTest/stardict-longman-2.4.2'
=== added file 'doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz'
5Binary files doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz 2010-02-08 17:08:18 +0000 differ18Binary files doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/dictTest/stardict-longman-2.4.2/longman.idx'
6Binary files doc/efl/dictTest/stardict-longman-2.4.2/longman.idx 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-longman-2.4.2/longman.idx 2010-02-08 17:08:18 +0000 differ19Binary files doc/efl/dictTest/stardict-longman-2.4.2/longman.idx 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-longman-2.4.2/longman.idx 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo'
--- doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo 1970-01-01 00:00:00 +0000
+++ doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo 2010-02-08 17:08:18 +0000
@@ -0,0 +1,8 @@
1StarDict's dict ifo file
2version=2.4.2
3wordcount=43052
4idxfilesize=771616
5bookname=Longman Dictionary of Contemporary English
6description=Made by Hu Zheng
7date=2005.10.23
8sametypesequence=m
09
=== added directory 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2'
=== added file 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz'
1Binary files doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz 2010-02-08 17:08:18 +0000 differ10Binary files doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx'
2Binary files doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx 2010-02-08 17:08:18 +0000 differ11Binary files doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo'
--- doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo 1970-01-01 00:00:00 +0000
+++ doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo 2010-02-08 17:08:18 +0000
@@ -0,0 +1,7 @@
1StarDict's dict ifo file
2version=2.4.2
3wordcount=8338
4idxfilesize=180266
5bookname=Oxford English Collocation Dictionary
6description=Made by Hu Zheng, privoided by Dr.Treo and lewpda.
7sametypesequence=m
08
=== added file 'doc/efl/frontPage.tex'
--- doc/efl/frontPage.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/frontPage.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,3 @@
1\title{Babiloo-efl}
2\author{Luca Vaudano}
3\maketitle
0\ No newline at end of file4\ No newline at end of file
15
=== added file 'doc/efl/genDoc.sh'
--- doc/efl/genDoc.sh 1970-01-01 00:00:00 +0000
+++ doc/efl/genDoc.sh 2010-02-08 17:08:17 +0000
@@ -0,0 +1,2 @@
1#!/bin/bash
2pdflatex babiloo.tex
03
=== added directory 'doc/efl/images'
=== added directory 'doc/efl/images/v0.1'
=== added file 'doc/efl/images/v0.1/1.png'
1Binary files doc/efl/images/v0.1/1.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/1.png 2010-02-08 17:08:18 +0000 differ4Binary files doc/efl/images/v0.1/1.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/1.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.1/2.png'
2Binary files doc/efl/images/v0.1/2.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/2.png 2010-02-08 17:08:18 +0000 differ5Binary files doc/efl/images/v0.1/2.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/2.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.1/3.png'
3Binary files doc/efl/images/v0.1/3.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/3.png 2010-02-08 17:08:18 +0000 differ6Binary files doc/efl/images/v0.1/3.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/3.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.1/4.png'
4Binary files doc/efl/images/v0.1/4.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/4.png 2010-02-08 17:08:18 +0000 differ7Binary files doc/efl/images/v0.1/4.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/4.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.1/5.png'
5Binary files doc/efl/images/v0.1/5.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/5.png 2010-02-08 17:08:18 +0000 differ8Binary files doc/efl/images/v0.1/5.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/5.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.1/6.png'
6Binary files doc/efl/images/v0.1/6.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/6.png 2010-02-08 17:08:18 +0000 differ9Binary files doc/efl/images/v0.1/6.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/6.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.1/7.png'
7Binary files doc/efl/images/v0.1/7.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/7.png 2010-02-08 17:08:18 +0000 differ10Binary files doc/efl/images/v0.1/7.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/7.png 2010-02-08 17:08:18 +0000 differ
=== added directory 'doc/efl/images/v0.2'
=== added file 'doc/efl/images/v0.2/1.png'
8Binary files doc/efl/images/v0.2/1.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/1.png 2010-02-08 17:08:18 +0000 differ11Binary files doc/efl/images/v0.2/1.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/1.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.2/2.png'
9Binary files doc/efl/images/v0.2/2.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/2.png 2010-02-08 17:08:18 +0000 differ12Binary files doc/efl/images/v0.2/2.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/2.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.2/3.png'
10Binary files doc/efl/images/v0.2/3.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/3.png 2010-02-08 17:08:18 +0000 differ13Binary files doc/efl/images/v0.2/3.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/3.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.2/4.png'
11Binary files doc/efl/images/v0.2/4.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/4.png 2010-02-08 17:08:18 +0000 differ14Binary files doc/efl/images/v0.2/4.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/4.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.2/5.png'
12Binary files doc/efl/images/v0.2/5.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/5.png 2010-02-08 17:08:18 +0000 differ15Binary files doc/efl/images/v0.2/5.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/5.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.2/6.png'
13Binary files doc/efl/images/v0.2/6.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/6.png 2010-02-08 17:08:18 +0000 differ16Binary files doc/efl/images/v0.2/6.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/6.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.2/7.png'
14Binary files doc/efl/images/v0.2/7.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/7.png 2010-02-08 17:08:18 +0000 differ17Binary files doc/efl/images/v0.2/7.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/7.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/images/v0.2/8.png'
15Binary files doc/efl/images/v0.2/8.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/8.png 2010-02-08 17:08:18 +0000 differ18Binary files doc/efl/images/v0.2/8.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/8.png 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/installation.tex'
--- doc/efl/installation.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/installation.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,34 @@
1\section{Installation}
2
3\subsection{Neo frerunner SHR}
4
5\begin{itemize}
6 \item opkg install babiloo-efl
7\end{itemize}
8
9\subsection{Desktop}
10
11\subsubsection{Ubuntu 9.04}
12
13\begin{itemize}
14 \item Configure the enlightenment repository:\\
15 http://packages.enlightenment.org/
16 \item Install babiloo (it requires python-efl-elementary)
17 \item Launch babiloo -e (e switch launches the EFL interface, QT is the standard interface for desktop)
18\end{itemize}
19
20\subsubsection{Elive}
21
22\begin{itemize}
23 \item Install babiloo in Elive (http://www.elivecd.org/)
24 \item Launch babiloo -e (e switch launches the EFL interface, QT is the standard interface for desktop)
25\end{itemize}
26
27\subsubsection{OzOs}
28
29\begin{itemize}
30 \item Install python-elementary from SVN\\
31 svn co http://svn.enlightenment.org/svn/e/trunk/BINDINGS/python
32 \item Install babiloo
33 \item Launch babiloo -e (e switch launches the EFL interface, QT is the standard interface for desktop)
34\end{itemize}
0\ No newline at end of file35\ No newline at end of file
136
=== added file 'doc/efl/intro.tex'
--- doc/efl/intro.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/intro.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,4 @@
1\section{Intro}
2The objective of this module is creating a graphics user interface that emphasizes simplicity and lightness. As development focuses on keeping weight down to a minimum, only the most essential features are implemented. It should be simple to use, requires few libraries and starts up quickly.\\
3The main target is the openmoko Freerunner cellphone (http://www.openmoko.org) and secondly the netbook.\\
4If you need a full-features program, you have to use the QT interface.
0\ No newline at end of file5\ No newline at end of file
16
=== added file 'doc/efl/planning.tex'
--- doc/efl/planning.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/planning.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,125 @@
1\section{Planning}
2
3\subsection{Library}
4The first thing to choose is the python GUI library.
5Finally my decision is to use the Enlightenment Foundation Library (EFL) due his performance and because it fits very well with the embedded devices.\\
6But also in the EFL world there are many choice:
7
8\begin{enumerate}
9 \item Evas / edje\\
10 (http://trac.enlightenment.org/e/browser/trunk/BINDINGS/python/python-edje)
11 \item python-elementary\\
12 (http://trac.enlightenment.org/e/browser/trunk/BINDINGS/python/python-elementary)
13 \item python-terra\\
14 (http://code.openbossa.org/projects/python-terra)
15 \item guarana\\
16 (http://profusion.mobi/node/10)
17\end{enumerate}
18
19Among these solutions I discarded guarana because it doesn't have python bindings and evas / edje because python-elementary is born on top of it just for rendering the things simpler and it's more embedded devices oriented, especially touch screen.\\
20Therefore after the reply in the e-devel mailing list\\
21(http://www.mail-archive.com/enlightenment-devel@lists.sourceforge.net/msg21290.html)\\
22I decided to use:
23\begin{itemize}
24 \item elementary as a widget set
25 \item python-terra if I need some MVC logic (for e.g. for the file selector not implemented yet in the elementary library)
26\end{itemize}
27
28\subsection{Milestones}
29
30\subsubsection{0.1}
31\begin{itemize}
32 \item Improve the GUI
33 \item text size
34 \item adjust the interface for working well on Neo and on desktop
35 \begin{itemize}
36 \item enable / disable Illume keyboard on Neo, do nothing on desktop
37 \item scaling correctly the icon on Neo and on desktop
38 \item wrap line different constant value for Neo and desktop
39 \end{itemize}
40 \item Empty windows for Settings and Dictionaries
41 \item Link babiloo core:
42 \begin{itemize}
43 \item EFL switch in the command line
44 \item Install all the babiloo core dependencies in Neo
45 \begin{itemize}
46 \item python-compression: gzip, zipfile, tarfile
47 \item python-misc: platform, user
48 \item python-netclient: mimetypes
49 \end{itemize}
50 \end{itemize}
51 \item Message popup for babiloo-core error (like error during perform the search)
52 \item Nicer file structure (gui, controller, model)
53 \item Load database
54 \begin{itemize}
55 \item constant in a configuration file
56 \item Configuration file not present error
57 \item Dictionary file not present error
58 \end{itemize}
59 \item Link the GUI to the word search logic
60 \item Voice capability
61 \item Openmoko package
62 \begin{itemize}
63 \item Same process than deb package (we can skip qt and s60 directories and use the correct command line switch for launching it)
64 \end{itemize}
65\end{itemize}
66
67\subsubsection{0.2}
68\begin{itemize}
69 \item Improve the GUI
70 \begin{itemize}
71 \item Entry lost input data when switch between application
72 \end{itemize}
73 \item Start the program without database, it should show warning not error
74 \item Change configuration format: use cPickle
75 \item Set SINGLE database:
76 \begin{itemize}
77 \item he user clicks on the dictionaries icon
78 \item the user changes the dictionary value via file selector widget and confirms
79 \item the program in the 'Dictionaries tab' shows the selected dictionary
80 \item after the user confirm the choice:
81 \begin{itemize}
82 \item the program sets the dictionary in the config file
83 \item the program closes the 'Dictionaries tab' and shows the 'loading dictionary...' frame
84 \item the program calls babiloo core passing the file
85 \end{itemize}
86 \item test on Neo
87 \end{itemize}
88 \item Set sound dictionary:
89 \begin{itemize}
90 \item like single database
91 \end{itemize}
92 \item Settings, player
93 \begin{itemize}
94 \item like single database
95 \end{itemize}
96 \item About page
97 \item Performance problem for StarDict dictionary (due to the auto sorting feature)
98 \begin{verbatim}
99 Loading /home/root/babiloo/stardict-longman-2.4.2/longman.dict.dz ...
100 (Stardict) type detected
101 Dictionary loaded in 452.63 sec
102 \end{verbatim}
103 \item Desktop package (merge trunk repositories with efl branch then add efl directory in the control file)
104\end{itemize}
105
106\subsubsection{Out of target}
107\begin{itemize}
108 \item Load MULTI databases:
109 \begin{itemize}
110 \item the user clicks on the dictionaries icon
111 \item the program shows a table with all the available dictionaries and the default one
112 \item the user can change the default one -> program saves it on the config file
113 \item the user clicks on add icon
114 \item the program opens a file selector widget
115 \item after the user selected a dictionary the program calls babiloo core passing the file
116 \item if everything go smoothly, returns to the dictionary table with a new row and selected as default
117 \item the program adds the dictionary to the config file
118 \end{itemize}
119 \item Try to take off python-misc dependency ?
120 \item HTML rendering ?
121 \item GUI localization
122 \item Progress bar (need Enlightenment rev43106)
123 \item Multi dictionaries capability
124 \item Word search filter (using elementary hover)
125\end{itemize}
0\ No newline at end of file126\ No newline at end of file
1127
=== added directory 'doc/efl/releasedFiles'
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk'
2Binary files doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk 2010-02-08 17:08:18 +0000 differ128Binary files doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk'
3Binary files doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk 2010-02-08 17:08:18 +0000 differ129Binary files doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk'
4Binary files doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk 2010-02-08 17:08:18 +0000 differ130Binary files doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk'
5Binary files doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk 2010-02-08 17:08:18 +0000 differ131Binary files doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz'
6Binary files doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz 2010-02-08 17:08:18 +0000 differ132Binary files doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz 2010-02-08 17:08:18 +0000 differ
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk'
7Binary files doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk 2010-02-08 17:08:19 +0000 differ133Binary files doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk 2010-02-08 17:08:19 +0000 differ
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz'
8Binary files doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz 2010-02-08 17:08:19 +0000 differ134Binary files doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz 2010-02-08 17:08:19 +0000 differ
=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk'
9Binary files doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk 2010-02-08 17:08:19 +0000 differ135Binary files doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk 2010-02-08 17:08:19 +0000 differ
=== added file 'doc/efl/source.tex'
--- doc/efl/source.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/source.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,7 @@
1\section{Source code}
2bzr branch lp:~vaudano/babiloo/efl
3
4\subsection{Package}
5Make a package, create the debian directory with the correct files, then:\\
6\texttt{dpkg-buildpackage}\\
7the command generates files in the parent directory, keep the deb one and rename it with ipk extension.
0\ No newline at end of file8\ No newline at end of file
19
=== added file 'doc/efl/version0.1.tex'
--- doc/efl/version0.1.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/version0.1.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,38 @@
1\subsection{0.1}
2
3Babiloo version 2.0.9\\
4Bazaar revision: 272\\
5Release date: 16 September 2009\\
6
7\begin{itemize}
8 \item GUI fits for Neo freerunner and EFL desktop (especially Netbook)
9 \item Dictionaries configuration in a file (efl/config.cfg)
10 \item Voice capability
11\end{itemize}
12
13\subsubsection{Screenshots}
14Figure~\ref{screenshotVer0.1} SHR with SHR-simple theme and SHR-Simple elementary theme.\\
15
16\begin{figure}[htp]
17 \begin{center}
18 \subfigure[Babiloo icon]{\includegraphics[scale=0.2]{images/v0.1/1.png}}
19 \subfigure[Loading dictionary]{\includegraphics[scale=0.2]{images/v0.1/2.png}}
20 \subfigure[Babiloo main screen]{\includegraphics[scale=0.2]{images/v0.1/3.png}}\\
21 \subfigure[Dictionary tab]{\includegraphics[scale=0.2]{images/v0.1/4.png}}
22 \subfigure[Settings tab]{\includegraphics[scale=0.2]{images/v0.1/5.png}}
23 \subfigure[Search a word]{\includegraphics[scale=0.2]{images/v0.1/6.png}}\\
24 \subfigure[Show the definition]{\includegraphics[scale=0.2]{images/v0.1/7.png}}
25 \end{center}
26 \caption{Babiloo EFL 0.1}
27 \label{screenshotVer0.1}
28\end{figure}
29
30\subsubsection{Performance}
31\begin{tabular}{lllllll}
32Rev & Dictionary name & Dict type & Size & Words & PC & Neo\\
33272 & stardict-longman-2.4.2 & stardict & 6.8 Mb & 43K & 4.22 sec & 452.63 sec\\
34272 & Oxford English Collocation & stardict & 2.0 Mb & 8K & 0.75 sec & 76.07 sec\\
35272 & Collins Cobuild advanced...,4th & sDictionary & 9 Mb & 40K & 0.65 sec & 93.91 sec\\
36272 & Wikipedia en 2007-01-03 (simple) & sDictionary & 9 Mb & 18K & 0.54 sec & 74.57 sec\\
37272 & Englis-italian dictionary & sDictionary & 2 Mb & 33K & 0.49 sec & 70.74 sec\\
38\end{tabular}
0\ No newline at end of file39\ No newline at end of file
140
=== added file 'doc/efl/version0.2.tex'
--- doc/efl/version0.2.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/version0.2.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,39 @@
1\subsection{0.2}
2
3Babiloo version 2.0.9-2 \\
4Bazaar revision: 288 \\
5Release date: 3 November 2009
6
7\begin{itemize}
8 \item Bug fixing
9 \item Configuration via GUI
10 \item Performance improvements
11\end{itemize}
12
13\subsubsection{Screenshots}
14Figure~\ref{screenshotVer0.2} SHR with gry theme and gry elementary theme.\\
15
16\begin{figure}[htp]
17 \begin{center}
18 \subfigure[Babiloo icon]{\includegraphics[scale=0.2]{images/v0.2/1.png}}
19 \subfigure[Loading dictionary]{\includegraphics[scale=0.2]{images/v0.2/2.png}}
20 \subfigure[Babiloo main screen]{\includegraphics[scale=0.2]{images/v0.2/3.png}}\\
21 \subfigure[Dictionary tab]{\label{dictionaryTab} \includegraphics[scale=0.2]{images/v0.2/4.png}}
22 \subfigure[Settings tab]{\includegraphics[scale=0.2]{images/v0.2/5.png}}
23 \subfigure[File selector]{\includegraphics[scale=0.2]{images/v0.2/6.png}}\\
24 \subfigure[Search a word]{\includegraphics[scale=0.2]{images/v0.2/7.png}}
25 \subfigure[Show the definition]{\includegraphics[scale=0.2]{images/v0.2/8.png}}
26 \end{center}
27 \caption{Babiloo EFL 0.2}
28 \label{screenshotVer0.2}
29\end{figure}
30
31\subsubsection{Performance}
32\begin{tabular}{lllllll}
33Rev & Dictionary name & Dict type & Size & Words & PC & Neo\\
34288 & stardict-longman-2.4.2 & stardict & 6.8 Mb & 43K & less than 1 sec & 36 sec\\
35288 & Oxford English Collocation & stardict & 2.0 Mb & 8K & less than 1 sec & 7 sec\\
36288 & Collins Cobuild advanced...,4th & sDictionary & 9 Mb & 40K & less than 1 sec & 101 sec\\
37288 & Wikipedia en 2007-01-03 (simple) & sDictionary & 9 Mb & 18K & less than 1 sec & 84 sec\\
38288 & Englis-italian dictionary & sDictionary & 2 Mb & 33K & less than 1 sec & 79 sec\\
39\end{tabular}
040
=== added file 'doc/efl/version0.3.tex'
--- doc/efl/version0.3.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/version0.3.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,23 @@
1\subsection{0.3}
2
3Babiloo version 2.0.9-3 \\
4Bazaar revision: 295 \\
5Release date: 27 November 2009 \\
6
7\begin{itemize}
8 \item Bug fixing
9 \item Included in the SHR feed ( opkg install babiloo-efl )
10\end{itemize}
11
12\subsubsection{Screenshots}
13As before
14
15\subsubsection{Performance}
16\begin{tabular}{lllllll}
17Rev & Dictionary name & Dict type & Size & Words & PC & Neo\\
18295 & stardict-longman-2.4.2 & stardict & 6.8 Mb & 43K & less than 1 sec & 32 sec\\
19295 & Oxford English Collocation & stardict & 2.0 Mb & 8K & less than 1 sec & 7 sec\\
20295 & Collins Cobuild advanced...,4th & sDictionary & 9 Mb & 40K & less than 1 sec & 80 sec\\
21295 & Wikipedia en 2007-01-03 (simple) & sDictionary & 9 Mb & 18K & less than 1 sec & 69 sec\\
22295 & Englis-italian dictionary & sDictionary & 2 Mb & 33K & less than 1 sec & 66 sec\\
23\end{tabular}
0\ No newline at end of file24\ No newline at end of file
125
=== added file 'doc/efl/version0.4.tex'
--- doc/efl/version0.4.tex 1970-01-01 00:00:00 +0000
+++ doc/efl/version0.4.tex 2010-02-08 17:08:17 +0000
@@ -0,0 +1,15 @@
1\subsection{0.4}
2
3Babiloo version 2.0.9-4 \\
4Bazaar revision: 296 \\
5Release date: 1 December 2009 \\
6
7\begin{itemize}
8 \item python-elementary code alignment
9\end{itemize}
10
11\subsubsection{Screenshots}
12As before
13
14\subsubsection{Performance}
15As before
0\ No newline at end of file16\ No newline at end of file
117
=== added directory 'efl'
=== added file 'efl/__init__.py'
--- efl/__init__.py 1970-01-01 00:00:00 +0000
+++ efl/__init__.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,21 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18
19__author__ = "Luca Vaudano <vaudano@gmail.com>"
20__version__ = "0.2"
21__module_name = "efl"
022
=== added file 'efl/about_ui.py'
--- efl/about_ui.py 1970-01-01 00:00:00 +0000
+++ efl/about_ui.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,124 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import elementary
19
20import logging
21log = logging.getLogger("babiloo.efl.aboutPage")
22
23from efl.constants import *
24
25class AboutPage(object):
26 def __init__(self, main):
27 self.main = main
28 self.box = None
29
30 def setupUi(self):
31
32 # Box Window with scroller and quit button
33 self.box = elementary.Box(self.main.win)
34 self.box.horizontal_set(False)
35 self.main.win.resize_object_add(self.box)
36 self.box.size_hint_weight_set(1.0, 1.0)
37 self.box.size_hint_align_set(-1, -1)
38 self.box.show()
39
40 # Scroller
41 scroller = elementary.Scroller(self.main.win)
42 scroller.bounce_set(0, 0)
43 scroller.size_hint_weight_set(1.0, 1.0)
44 scroller.size_hint_align_set(-1.0, -1.0)
45 self.box.pack_end(scroller)
46 scroller.show()
47
48 # Quit button
49 self.quitAboutWin = elementary.Button(self.main.win)
50 self.quitAboutWin.label_set("Quit")
51 self.quitAboutWin.size_hint_align_set(-1.0, 0.0)
52 ic = elementary.Icon(self.quitAboutWin)
53 ic.file_set( QUIT_ICON)
54 ic.smooth_set(1)
55 ic.scale_set(1, 1)
56 self.quitAboutWin.icon_set(ic)
57 self.quitAboutWin.show()
58 self.box.pack_end(self.quitAboutWin)
59
60 # Box inside scroller
61 boxScroller = elementary.Box(self.main.win)
62 boxScroller.horizontal_set(False)
63 boxScroller.size_hint_weight_set(1.0, -1.0)
64 scroller.content_set(boxScroller)
65 boxScroller.show()
66
67 # Frame for dictionary section
68 self.createAboutFrame()
69 boxScroller.pack_end(self.frameAbout)
70
71 def createAboutFrame(self):
72 self.frameAbout = elementary.Frame(self.main.win)
73 self.frameAbout.label_set('%s %s' % (APP_NAME, APP_VERSION))
74 self.frameAbout.size_hint_align_set(-1.0, 0.0)
75 self.frameAbout.show()
76
77 about = """\
78Babiloo is a offline dictionaries reader.\
79<br><br>\
80<b>Copyright</> 2008-2009, Babiloo Developers<br>\
81<b>Licensed</> under the GNU GPL v3<br>\
82<b>Homepage</> http://babiloo-project.org</license>\
83<br><br>\
84The team would like to thank these 3 GPL projects where Babiloo has used part of their codes:\
85<br><br>\
86QStardict, OpenDict, Sdiqt
87<br><br>\
88========\
89<br><br>\
90<b>Elementary UI</>\
91<br><br>\
92The objective of this module is creating a graphics user interface that emphasizes simplicity and lightness.\
93<br><br>\
94As development focuses on keeping weight down to a minimum, only the most essential features are implemented.
95It should be simple to use, requires few libraries and starts up quickly.\
96<br><br>\
97The main target is the openmoko Freerunner cellphone and secondly the netbook.\
98<br><br>\
99If you need a full-features program, you have to use the QT interface.\
100<br><br>\
101========\
102<br><br>\
103<b>Elementary UI features</>\
104<br><br>\
105* Supports dictionaries in SDictionary and StarDict formats.\
106<br><br>\
107* Voice capability\
108"""
109 entry = elementary.Entry(self.main.win)
110 entry.editable_set(False)
111 entry.line_wrap_set(True)
112 entry.size_hint_align_set(-1, -1)
113 entry.entry_set(about)
114 entry.show()
115
116 self.frameAbout.content_set(entry)
117
118
119
120
121
122
123
124
0125
=== added file 'efl/babiloo-efl.bb'
--- efl/babiloo-efl.bb 1970-01-01 00:00:00 +0000
+++ efl/babiloo-efl.bb 2010-02-08 17:08:19 +0000
@@ -0,0 +1,41 @@
1DESCRIPTION = "EFL Dictionary Viewer. It supports dictionaries in SDictionary and StarDict format."
2SECTION = "devel/python"
3PRIORITY = "optional"
4LICENSE = "GPL"
5AUTHOR = "Luca Vaudano <vaudano@gmail.com>"
6HOMEPAGE = "http://babiloo-project.org"
7RDEPENDS = "python-elementary python-compression python-misc python-netclient"
8
9PACKAGE_ARCH = "all"
10
11DEFAULT_PREFERENCE = "-1"
12PV = "2.0.9-bzrr${SRCREV}"
13
14SRC_URI = "bzr://bazaar.launchpad.net/~vaudano/babiloo/efl"
15
16S = "${WORKDIR}/efl"
17
18do_install() {
19 install -d "${D}${datadir}/babiloo"
20 cp -a "${S}/core" "${D}${datadir}/babiloo/"
21 cp -a "${S}/efl" "${D}${datadir}/babiloo/"
22 cp -a "${S}/images" "${D}${datadir}/babiloo/"
23 cp -a "${S}/dicts" "${D}${datadir}/babiloo/"
24 install -m 0755 "${S}/run.py" "${D}${datadir}/babiloo/"
25 install -d "${D}${bindir}"
26 ln -s "${datadir}/babiloo/run.py" "${D}${bindir}/babiloo"
27 install -d "${D}${datadir}/pixmaps"
28 install -m 0644 "${S}/images/babiloo.png" "${D}${datadir}/pixmaps"
29 install -d "${D}${datadir}/applications"
30 install -m 0644 "${S}/babiloo.desktop" "${D}${datadir}/applications"
31
32 install -d "${D}${datadir}"
33 cp -a "${S}/locale" "${D}${datadir}/"
34 find ${D}${datadir}/locale -name *.po -exec rm {} \;
35 rm -f ${D}${datadir}/locale/babiloo.pot
36
37 install -d "${D}${datadir}/doc"
38 install -m 0644 "${S}/doc/efl/babiloo.pdf" "${D}${datadir}/doc/"
39}
40
41FILES_${PN} += "${datadir}/babiloo"
042
=== added file 'efl/babiloo.desktop'
--- efl/babiloo.desktop 1970-01-01 00:00:00 +0000
+++ efl/babiloo.desktop 2010-02-08 17:08:19 +0000
@@ -0,0 +1,11 @@
1[Desktop Entry]
2Name=Babiloo
3Comment=Application to view dictionaries
4Exec=/usr/bin/babiloo
5Icon=/usr/share/pixmaps/babiloo.png
6Terminal=false
7Type=Application
8Categories=Utility;
9SingleInstance=true
10StartupNotify=true
11
012
=== added file 'efl/config.py'
--- efl/config.py 1970-01-01 00:00:00 +0000
+++ efl/config.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,56 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import cPickle, os.path
19
20from efl.constants import *
21
22class Config():
23
24 # Initialization
25 def __init__(self):
26
27 # if the directory doesn't exist, create it
28 if not os.path.exists(CONFIG_DIR):
29 os.makedirs(CONFIG_DIR, 0755)
30
31 # if the file doesn't exist use default setting, otherwise use it
32 if not os.path.exists(CONFIG_FILE):
33 self.data = DEFAULT_CONFIGURATION
34 else:
35 self.data = cPickle.load(open(CONFIG_FILE, 'r'))
36
37 # Flag if the data are to save
38 self.toSave = False
39
40 # Save all the configuration settings into the file
41 def save(self):
42 if self.toSave:
43 cPickle.dump(self.data, open(CONFIG_FILE, 'w+'))
44 self.toSave = False
45
46 # Get the value from the configuration or default value
47 def get(self, name):
48 if name not in self.data.keys():
49 self.data[name] = DEFAULT_SETTINGS[name]
50 return self.data[name]
51
52 # Set a new value
53 def set(self, name, value):
54 if self.data[name] != value:
55 self.data[name] = value
56 self.toSave = True
0\ No newline at end of file57\ No newline at end of file
158
=== added file 'efl/constants.py'
--- efl/constants.py 1970-01-01 00:00:00 +0000
+++ efl/constants.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,67 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import os.path
19
20APP_NAME = 'Babiloo'
21APP_VERSION = '2.0.9'
22
23# Model
24ENV_PC = 'pc'
25ENV_NEO = 'neo'
26ROOT_DIR = '/usr/share/babiloo/'
27HOME_DIR = os.path.expanduser("~")
28CONFIG_DIR = os.path.join(HOME_DIR, ".config/%s" % APP_NAME.lower())
29CONFIG_FILE = os.path.join(CONFIG_DIR, "config.cfg")
30
31# UI
32WIDTH_PC = 60
33WIDTH_NEO = 33
34SCREEN_WIDTH = 480
35SCREEN_HEIGHT = 480
36ROOT_DIR = '/usr/share/babiloo/'
37DICTIONARIES_ICON = ROOT_DIR + 'images/system-installer.png'
38SETTINGS_ICON = ROOT_DIR + 'images/preferences-system.png'
39SPEAK_ICON = ROOT_DIR + 'images/speaker.png'
40CLEAR_ICON = ROOT_DIR + 'images/clear-right.png'
41SEARCH_ICON = ROOT_DIR + 'images/system-search.png'
42QUIT_ICON = ROOT_DIR + 'images/process-stop.png'
43ABOUT_ICON = ROOT_DIR + 'images/dialog-information.png'
44NEW_DICTIONARY_ICON = ROOT_DIR + 'images/dictionary-new.png'
45NEW_SOUND_DICTIONARY_ICON = ROOT_DIR + 'images/dictionary-new.png'
46NEW_PLAYER_ICON = ROOT_DIR + 'images/dictionary-new.png'
47
48# Set to PC value
49WIDTH = WIDTH_PC
50ENV = ENV_PC
51
52# Retrieve if the hardware is GTA01 or GTA02
53# if is, set to NEO value
54for line in open('/proc/cpuinfo'):
55 if line.startswith('Hardware'):
56 type = line.split()
57 type =type[len(type)-1]
58 if type.startswith('GTA0'):
59 ENV = ENV_NEO
60 WIDTH = WIDTH_NEO
61
62# Default configuration settings
63DEFAULT_CONFIGURATION = {
64 'dictionary_path': '',
65 'sound_dictionary_path': '',
66 'player': '/usr/bin/aplay',
67}
0\ No newline at end of file68\ No newline at end of file
169
=== added file 'efl/definition_ui.py'
--- efl/definition_ui.py 1970-01-01 00:00:00 +0000
+++ efl/definition_ui.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,173 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import elementary
19import textwrap
20import re
21import os
22
23import logging
24log = logging.getLogger("babiloo.efl.definition_ui")
25
26from efl.constants import *
27
28class DefinitionPage():
29
30 # Initialization
31 def __init__(self, main):
32 self.main = main
33 self.box = None
34
35 def setupUi(self):
36
37 # Box object
38 self.box = elementary.Box(self.main.win)
39 self.box.horizontal_set(False)
40 self.main.win.resize_object_add(self.box)
41 self.box.size_hint_weight_set(1.0, 1.0)
42 self.box.show()
43
44 # Horizontal box with clear, word field and search button
45 toolbarBox = elementary.Box(self.main.win)
46 toolbarBox.horizontal_set(True)
47 toolbarBox.homogenous_set(True)
48 toolbarBox.size_hint_weight_set(1.0, 0.0)
49 toolbarBox.size_hint_align_set(-1.0, 0.0)
50
51 # Dictionaries icon
52 self.dictionariesButton = elementary.Button(self.main.win)
53 dictionariesIcon = elementary.Icon(self.dictionariesButton)
54 dictionariesIcon.file_set(DICTIONARIES_ICON)
55 self.dictionariesButton.icon_set(dictionariesIcon)
56 self.dictionariesButton.size_hint_weight_set(1.0, 1.0)
57 self.dictionariesButton.size_hint_align_set(-1.0, -1.0)
58 toolbarBox.pack_end(self.dictionariesButton)
59 self.dictionariesButton.show()
60
61 # Settings toolbar icon
62 self.settingsButton = elementary.Button(self.main.win)
63 settingsIcon = elementary.Icon(self.settingsButton)
64 settingsIcon.file_set(SETTINGS_ICON)
65 self.settingsButton.icon_set(settingsIcon)
66 self.settingsButton.size_hint_weight_set(1.0, 1.0)
67 self.settingsButton.size_hint_align_set(-1.0, -1.0)
68 toolbarBox.pack_end(self.settingsButton)
69 self.settingsButton.show()
70
71 # Speak toolbar icon
72 self.speakButton = elementary.Button(self.main.win)
73 speakIcon = elementary.Icon(self.speakButton)
74 speakIcon.file_set(SPEAK_ICON)
75 self.speakButton.icon_set(speakIcon)
76 self.speakButton.size_hint_weight_set(1.0, 1.0)
77 self.speakButton.size_hint_align_set(-1.0, -1.0)
78 toolbarBox.pack_end(self.speakButton)
79 self.speakButton.show()
80
81 self.box.pack_end(toolbarBox)
82 toolbarBox.show()
83
84 # Horizontal box with clear, word field and search button
85 bx2 = elementary.Box(self.main.win)
86 bx2.horizontal_set(True)
87 #bx2.homogenous_set(True)
88 bx2.size_hint_weight_set(1.0, 0.0)
89 bx2.size_hint_align_set(-1.0, 0.0)
90
91 # Clear button
92 self.clearButton = elementary.Button(self.main.win)
93 ic = elementary.Icon(self.clearButton)
94 ic.file_set(CLEAR_ICON)
95 self.clearButton.icon_set(ic)
96 # workround for nice position
97 self.clearButton.label_set(" ")
98 self.clearButton.size_hint_weight_set(0.0, 1.0)
99 self.clearButton.size_hint_align_set(-1.0, -1.0)
100 bx2.pack_end(self.clearButton)
101 self.clearButton.show()
102
103 # Word field
104 self.word = elementary.Entry(self.main.win)
105 self.word.line_wrap_set(False)
106 self.word.entry_set("")
107 self.word.single_line_set(True)
108 self.word.scale_set(1.5)
109 self.word.size_hint_weight_set(1.0, 1.0)
110 self.word.size_hint_align_set(-1.0, -1.0)
111 bx2.pack_end(self.word)
112 self.word.show()
113
114 # Search button
115 self.searchButton = elementary.Button(self.main.win)
116 ic = elementary.Icon(self.main.win)
117 ic.file_set(SEARCH_ICON)
118 self.searchButton.icon_set(ic)
119 # workround for nice position
120 self.searchButton.label_set(" ")
121 self.searchButton.size_hint_weight_set(0.0, 1.0)
122 self.searchButton.size_hint_align_set(-1.0, -1.0)
123 bx2.pack_end(self.searchButton)
124 self.searchButton.show()
125
126 self.box.pack_end(bx2)
127 bx2.show()
128
129 # Frame
130 self.fr = elementary.Frame(self.main.win)
131 self.fr.label_set(' ')
132 self.fr.size_hint_weight_set(1.0, 1.0)
133 self.fr.size_hint_align_set(-1.0, -1.0)
134
135 # Entry scroller
136 sc = elementary.Scroller(self.main.win)
137 sc.size_hint_weight_set(1.0, 1.0)
138 sc.size_hint_align_set(-1.0, -1.0)
139 ## hide scrollbars
140 #sc.policy_set(2, 2)
141 ## make it non-bouncing
142 #sc.drag_bouncy_set(0)
143
144 # Definition text area
145 self.definition = elementary.Entry(self.main.win)
146 #self.definition.line_wrap_set(True)
147 self.definition.line_wrap_set(False)
148 self.definition.scale_set(1.25)
149 self.definition.entry_set("")
150 self.definition.single_line_set(False)
151 self.definition.editable_set(False)
152 self.definition.size_hint_weight_set(1.0, 1.0)
153 self.definition.size_hint_align_set(-1.0, -1.0)
154
155 sc.content_set(self.definition)
156 self.fr.content_set(sc)
157
158 self.definition.show()
159 self.fr.show()
160 sc.show()
161
162 self.box.pack_end(self.fr)
163
164 def frame_title_set(self, text):
165 if self.box:
166 if (len(text) > WIDTH):
167 text = text[:WIDTH-3] + '...'
168 self.fr.label_set(text)
169
170 def content_set(self, text):
171 definitionString = textwrap.fill(text, WIDTH)
172 definitionString = re.sub("\n", "<br>", definitionString)
173 self.definition.entry_set(definitionString)
0174
=== added file 'efl/dictionaries_ui.py'
--- efl/dictionaries_ui.py 1970-01-01 00:00:00 +0000
+++ efl/dictionaries_ui.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,196 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import elementary
19
20import logging
21log = logging.getLogger("babiloo.efl.dictionariesPage")
22
23from efl.constants import *
24
25class DictionariesPage():
26
27 # Initialization
28 def __init__(self, main):
29 self.main = main
30 self.box = None
31
32 #
33 # self.box
34 # scroller
35 # boxScroller
36 # for each Section
37 # frameSection
38 # boxSection
39 # quitDictionariesWin
40 def setupUi(self):
41
42 # Box Window with scroller and quit button
43 self.box = elementary.Box(self.main.win)
44 self.box.horizontal_set(False)
45 self.main.win.resize_object_add(self.box)
46 self.box.size_hint_weight_set(1.0, 1.0)
47 self.box.size_hint_align_set(-1, -1)
48 self.box.show()
49
50 # Scroller
51 scroller = elementary.Scroller(self.main.win)
52 scroller.bounce_set(0, 0)
53 scroller.size_hint_weight_set(1.0, 1.0)
54 scroller.size_hint_align_set(-1.0, -1.0)
55 self.box.pack_end(scroller)
56 scroller.show()
57
58 # Quit button
59 self.quitDictionariesWin = elementary.Button(self.main.win)
60 self.quitDictionariesWin.label_set("Quit")
61 self.quitDictionariesWin.size_hint_align_set(-1.0, 0.0)
62 ic = elementary.Icon(self.quitDictionariesWin)
63 ic.file_set( QUIT_ICON)
64 ic.smooth_set(1)
65 ic.scale_set(1, 1)
66 self.quitDictionariesWin.icon_set(ic)
67 self.quitDictionariesWin.show()
68 self.box.pack_end(self.quitDictionariesWin)
69
70 # Box inside scroller
71 boxScroller = elementary.Box(self.main.win)
72 boxScroller.horizontal_set(False)
73 boxScroller.size_hint_weight_set(1.0, -1.0)
74 scroller.content_set(boxScroller)
75 boxScroller.show()
76
77 # Frame for dictionary section
78 self.createDictionaryFrame()
79 boxScroller.pack_end(self.frameDictionary)
80
81 # Frame for sound dictionary section
82 self.createSoundDictionaryFrame()
83 boxScroller.pack_end(self.frameSoundDictionary)
84
85 def createDictionaryFrame(self):
86 self.frameDictionary = elementary.Frame(self.main.win)
87 self.frameDictionary.label_set("Dictionary FILE NAME")
88 self.frameDictionary.size_hint_align_set(-1.0, 0.0)
89 self.frameDictionary.show()
90
91 # Box for dictionary section
92 boxDictionary = elementary.Box(self.main.win)
93 boxDictionary.horizontal_set(False)
94 boxDictionary.size_hint_align_set(-1.0, 0.0)
95 boxDictionary.show()
96
97 # Box object with 'New dictionary' and 'DictionaryPathEntry'
98 boxDictionaryPathEntry= elementary.Box(self.main.win)
99 boxDictionaryPathEntry.horizontal_set(True)
100 boxDictionaryPathEntry.size_hint_weight_set(1.0, 1.0)
101 boxDictionaryPathEntry.show()
102
103 # New dictionary button
104 self.newDictionaryButton = elementary.Button(self.main.win)
105 ic = elementary.Icon(self.newDictionaryButton)
106 ic.file_set(NEW_DICTIONARY_ICON)
107 self.newDictionaryButton.icon_set(ic)
108 # workround for nice position
109 self.newDictionaryButton.label_set(" ")
110 self.newDictionaryButton.size_hint_weight_set(0.0, 1.0)
111 self.newDictionaryButton.size_hint_align_set(-1.0, -1.0)
112 self.newDictionaryButton.show()
113
114 # Dictionary path entry
115 self.dictionaryEntry = elementary.Entry(self.main.win)
116 self.dictionaryEntry.line_wrap_set(False)
117 self.dictionaryEntry.entry_set('')
118 self.dictionaryEntry.single_line_set(True)
119 self.dictionaryEntry.editable_set(False)
120 self.newDictionaryButton.size_hint_weight_set(0.0, 1.0)
121 self.dictionaryEntry.size_hint_align_set(-1.0, -1.0)
122 self.dictionaryEntry.scale_set(1.25)
123
124 self.dictionaryEntry.show()
125
126 boxDictionaryPathEntry.pack_end(self.newDictionaryButton)
127 boxDictionaryPathEntry.pack_end(self.dictionaryEntry)
128
129 # File selector
130 self.saveDictionary = elementary.Button(self.main.win)
131 self.saveDictionary.label_set("Save ( it takes time! )")
132 self.saveDictionary.size_hint_align_set(-1.0, 0.0)
133 self.saveDictionary.show()
134
135 boxDictionary.pack_end(boxDictionaryPathEntry)
136 boxDictionary.pack_end(self.saveDictionary)
137
138 self.frameDictionary.content_set(boxDictionary)
139
140
141 def createSoundDictionaryFrame(self):
142 self.frameSoundDictionary = elementary.Frame(self.main.win)
143 self.frameSoundDictionary.label_set("Sound dictionary PATH")
144 self.frameSoundDictionary.size_hint_align_set(-1.0, 0.0)
145 self.frameSoundDictionary.show()
146
147 # Box for sound dictionary section
148 boxSoundDictionary = elementary.Box(self.main.win)
149 boxSoundDictionary.horizontal_set(False)
150 boxSoundDictionary.size_hint_align_set(-1.0, 0.0)
151 boxSoundDictionary.show()
152
153 # Box object with 'New sound dictionary' and 'SoundDictionaryPathEntry'
154 boxSoundDictionaryPathEntry= elementary.Box(self.main.win)
155 boxSoundDictionaryPathEntry.horizontal_set(True)
156 boxSoundDictionaryPathEntry.size_hint_weight_set(1.0, 1.0)
157 boxSoundDictionaryPathEntry.show()
158
159 # New dictionary button
160 self.newSoundDictionaryButton = elementary.Button(self.main.win)
161 ic = elementary.Icon(self.newSoundDictionaryButton)
162 ic.file_set(NEW_SOUND_DICTIONARY_ICON)
163 self.newSoundDictionaryButton.icon_set(ic)
164 # workround for nice position
165 self.newSoundDictionaryButton.label_set(" ")
166 self.newSoundDictionaryButton.size_hint_weight_set(0.0, 1.0)
167 self.newSoundDictionaryButton.size_hint_align_set(-1.0, -1.0)
168 self.newSoundDictionaryButton.show()
169
170 # Dictionary path entry
171 self.soundDictionaryEntry = elementary.Entry(self.main.win)
172 self.soundDictionaryEntry.line_wrap_set(False)
173 self.soundDictionaryEntry.entry_set('')
174 self.soundDictionaryEntry.single_line_set(True)
175 self.soundDictionaryEntry.editable_set(False)
176 self.newSoundDictionaryButton.size_hint_weight_set(0.0, 1.0)
177 self.soundDictionaryEntry.size_hint_align_set(-1.0, -1.0)
178 self.soundDictionaryEntry.scale_set(1.25)
179
180 self.soundDictionaryEntry.show()
181
182 boxSoundDictionaryPathEntry.pack_end(self.newSoundDictionaryButton)
183 boxSoundDictionaryPathEntry.pack_end(self.soundDictionaryEntry)
184
185 # File selector
186 self.saveSoundDictionary = elementary.Button(self.main.win)
187 self.saveSoundDictionary.label_set("Save")
188 self.saveSoundDictionary.size_hint_align_set(-1.0, 0.0)
189 self.saveSoundDictionary.show()
190
191 boxSoundDictionary.pack_end(boxSoundDictionaryPathEntry)
192 boxSoundDictionary.pack_end(self.saveSoundDictionary)
193
194 self.frameSoundDictionary.content_set(boxSoundDictionary)
195
196
0\ No newline at end of file197\ No newline at end of file
1198
=== added file 'efl/main.py'
--- efl/main.py 1970-01-01 00:00:00 +0000
+++ efl/main.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,48 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18from main_ui import Ui_Main
19from main_model import Model
20import elementary
21
22import logging
23log = logging.getLogger("babiloo.efl.main")
24
25from efl.constants import *
26
27class Main(Ui_Main, Model):
28
29 def __init__(self, options):
30
31 # Create UI
32 elementary.init()
33 self.setupUi()
34
35 # Load database, if already set
36 self.loadDatabase()
37
38 # Destroy method binding
39 self.win.callback_destroy_add(self.destroy, (APP_NAME))
40
41 # Start elementary UI
42 elementary.run()
43 elementary.shutdown()
44
45def main(options):
46 log.debug("Building main dialog")
47 Main(options)
48
0\ No newline at end of file49\ No newline at end of file
150
=== added file 'efl/main_model.py'
--- efl/main_model.py 1970-01-01 00:00:00 +0000
+++ efl/main_model.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,352 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18from time import time
19import os
20
21import ecore
22import elementary
23
24from core.modules import *
25import core.dictionary.engine as engine
26
27import logging
28log = logging.getLogger("babiloo.efl.main_model")
29
30from efl.constants import *
31from efl.config import Config
32from core.modules.status import Status
33from utils_ui import UtilsUi
34
35config = Config()
36utils = UtilsUi()
37
38class Model():
39
40 # Destroy called on destroy window
41 def destroy(self, obj, data):
42
43 # Save settings
44 config.save()
45
46 # Exit
47 elementary.exit()
48
49 # Load database for Neo or Netbook
50 def loadDatabase(self):
51
52 # Load database
53 if config.get('dictionary_path') != '':
54
55 # Show ''Loading database ...''
56 self.create_loadingFrame("Please wait...<br>Loading dictionary...")
57
58 # it doesn't work well on OpenGeu / Ubuntu + OzOs
59 # it works well on Neo and Elive
60 ecore.idler_add(self.loadDatabaseCore)
61
62 else:
63 self.create_dialog("No dictionary to load")
64
65 # TODO Set percentage status
66 def setStatus(self, status):
67 print "%d" % status
68 #self.loadinglabel.label_set("Loading dictionary...<br> %d%%" %status)
69
70 # Call the babiloo core module for loading the database
71 def loadDatabaseCore(self):
72 nowtime = time()
73 self.dictionary_name = ' '
74 try:
75 self.engine = engine.DictionaryEngine()
76
77 self.testdict = self.engine.loadDictionary(config.get('dictionary_path'))
78 self.dictionary_name = self.engine.getDictionary( self.testdict['dict'].getUniqueId() ).getName()
79 except:
80 log.error("Dictionary can't be loaded!")
81 self.create_dialog("Dictionary can't be loaded!")
82
83 # Hide the loading frame
84 self.loading.hide()
85
86 # Put the database name on the frame title
87 self.definitionPage.frame_title_set(self.dictionary_name)
88 log.info("Dictionary loaded in %.2f sec" % (time() - nowtime) )
89
90 # Close the thread
91 return None
92
93 def speak(self, obj, data):
94
95 # check if the player exists
96 if not os.path.exists(config.get('player')):
97 self.create_dialog("Please install %s" %config.get('player'));
98 return
99
100 # check if the sound dictionary path is set
101 if config.get('sound_dictionary_path') == '':
102 self.create_dialog("Sound dictionary path not set");
103 return
104
105 # check if the sound dictionary path exists
106 if not os.path.exists(config.get('sound_dictionary_path')):
107 self.create_dialog("Sound dictionary path not valid %s" %config.get('sound_dictionary_path'));
108 return
109
110 # searched word
111 speakWord = data.entry_get()
112 speakWord = speakWord.strip()
113
114 # if the user inserted the word in the entry filed
115 if len(speakWord) != 0:
116 speakWord = config.get('sound_dictionary_path') + '/' + speakWord[0] + '/' + speakWord + '.wav'
117 log.debug("Speak %s" % speakWord)
118 if not os.path.exists(speakWord):
119 self.create_dialog("Word not found");
120 return
121 speakCmd = config.get('player') + " %s" % speakWord
122 log.debug(speakCmd)
123 os.system(speakCmd + ' &')
124
125 def clear_text_field(self, obj, data):
126 data.entry_set("")
127
128 def search_word(self, obj, input):
129
130 # if the database is loaded
131 if config.get('dictionary_path') != '':
132
133 # searched word
134 self.word = input.entry_get()
135 self.word = self.word.strip()
136
137 # if the user inserted the word in the entry filed
138 if len(self.word) != 0:
139 log.debug("Searched word: %s" % self.word)
140
141 try:
142 result = self.engine.search(self.word, self.testdict['dict'].getUniqueId())
143
144 # Format the dictionary result
145 self.definitionPage.content_set( result.content() )
146
147 except KeyError:
148 self.create_dialog("Word %s not found" %self.word)
149 except:
150 self.create_dialog("Error during the search of %s" %self.word)
151
152 else:
153 self.create_dialog("You have to load the dictionary")
154
155 # Browse for selecting the dictionary file
156 def newDictionaryClicked(self, obj):
157 utils.fileSelectorUI()
158
159 def fs_cb_done(obj, event_info, data):
160 if event_info is not None:
161
162 # Cut br. Depends of the Elementary version!
163 event_info = event_info.replace('<br>', '')
164
165 # If is not a directory
166 if event_info[-1] != '/':
167 # Used in the save action
168 self.newDictionary = event_info
169 utils.filename_set(self.dictionariesPage.dictionaryEntry, self.newDictionary)
170 utils.fileSelectorWindow.hide()
171 else:
172 self.create_dialog("You have to select the dictionary file.")
173 else:
174 data.delete()
175 utils.fileSelector.callback_done_add(fs_cb_done, utils.fileSelectorWindow)
176
177 # Browse for selecting the sound dictionary path
178 def newSoundDictionaryClicked(self, obj):
179 utils.fileSelectorUI()
180
181 def fs_cb_done(obj, event_info, data):
182 if event_info is not None:
183
184 # Cut br. Depends of the Elementary version!
185 event_info = event_info.replace('<br>', '')
186
187 # If is a directory
188 if event_info[-1] == '/':
189 # Used in the save action
190 self.newSoundDictionary = event_info
191 utils.filename_set(self.dictionariesPage.soundDictionaryEntry, self.newSoundDictionary)
192 utils.fileSelectorWindow.hide()
193 else:
194 self.create_dialog("You have to select a dictionary.<br>\
195The directory should contain folders<br>\
196a, b, c and so on")
197 else:
198 data.delete()
199 utils.fileSelector.callback_done_add(fs_cb_done, utils.fileSelectorWindow)
200
201 # Browse for selecting the player
202 def newPlayerClicked(self, obj):
203 utils.fileSelectorUI()
204
205 def fs_cb_done(obj, event_info, data):
206 if event_info is not None:
207
208 # Cut br. Depends of the Elementary version!
209 event_info = event_info.replace('<br>', '')
210
211 # If is not a directory
212 if event_info[-1] != '/':
213 # Used in the save action
214 self.newPlayer = event_info
215 utils.filename_set(self.settingsPage.playerEntry, self.newPlayer)
216 utils.fileSelectorWindow.hide()
217 else:
218 self.create_dialog("You have to select player executable file.")
219 else:
220 data.delete()
221 utils.fileSelector.callback_done_add(fs_cb_done, utils.fileSelectorWindow)
222
223 # Load the new dictionary
224 def saveDictionaryClicked(self, obj):
225 self.promoteDefinitionPage()
226 if self.newDictionary is not None:
227 log.info("Save dictionary in the configuration %s" % self.newDictionary)
228 config.set('dictionary_path', self.newDictionary)
229 self.loadDatabase()
230
231 # Load the new sound dictionary
232 def saveSoundDictionaryClicked(self, obj):
233 self.promoteDefinitionPage()
234 if self.newSoundDictionary is not None:
235 log.info("Save sound dictionary in the configuration %s" % self.newSoundDictionary)
236 config.set('sound_dictionary_path', self.newSoundDictionary)
237
238 # Load player
239 def savePlayerClicked(self, obj):
240 self.promoteDefinitionPage()
241 if self.newPlayer is not None:
242 log.info("Save player in the configuration %s" % self.newPlayer)
243 config.set('player', self.newPlayer)
244
245 def promote(self, boxToPromote):
246 if self.definitionPage.box:
247 self.definitionPage.box.hide()
248 if self.dictionariesPage.box:
249 self.dictionariesPage.box.hide()
250 if self.settingsPage.box:
251 self.settingsPage.box.hide()
252 if self.aboutPage.box:
253 self.aboutPage.box.hide()
254 self.win.resize(SCREEN_WIDTH, SCREEN_HEIGHT)
255 boxToPromote.show()
256
257 def promoteDefinitionPage(self, obj=None, event=None, data=None):
258
259 if not self.definitionPage.box:
260
261 # Setup UI
262 self.definitionPage.setupUi()
263
264 # Bind methods
265 self.definitionPage.dictionariesButton.callback_clicked_add(self.promoteDictionariesPage)
266 self.definitionPage.settingsButton.callback_clicked_add(self.promoteSettingsPage)
267 self.definitionPage.speakButton.callback_clicked_add(self.speak, self.definitionPage.word)
268 self.definitionPage.clearButton.callback_clicked_add(self.clear_text_field, self.definitionPage.word)
269 self.definitionPage.searchButton.callback_clicked_add(self.search_word, self.definitionPage.word)
270 self.definitionPage.definition.callback_activated_add(self.search_word, self.definitionPage.word)
271
272 # Put the definition page on the top of the pager
273 self.promote(self.definitionPage.box)
274
275 def promoteDictionariesPage(self, obj=None, event=None, data=None):
276
277 if not self.dictionariesPage.box:
278
279 # Setup UI
280 self.dictionariesPage.setupUi()
281
282 # Set quit function
283 self.dictionariesPage.quitDictionariesWin.callback_clicked_add(self.promoteDefinitionPage)
284
285 # Show the loaded dictionary
286 self.newDictionary = config.get('dictionary_path')
287
288 # Set dictionary filename from configuration
289 utils.filename_set(self.dictionariesPage.dictionaryEntry, self.newDictionary)
290
291 # Set new dictionary function
292 self.dictionariesPage.newDictionaryButton.callback_clicked_add(self.newDictionaryClicked)
293
294 # Set save function
295 self.dictionariesPage.saveDictionary.callback_clicked_add(self.saveDictionaryClicked)
296
297 # Set the loaded sound dictionary path
298 self.newSoundDictionary = config.get('sound_dictionary_path')
299
300 # Set dictionary filename from configuration
301 utils.filename_set(self.dictionariesPage.soundDictionaryEntry, self.newSoundDictionary)
302
303 # Set new dictionary function
304 self.dictionariesPage.newSoundDictionaryButton.callback_clicked_add(self.newSoundDictionaryClicked)
305
306 # Set save function
307 self.dictionariesPage.saveSoundDictionary.callback_clicked_add(self.saveSoundDictionaryClicked)
308
309 # Put the dictionaries page on the top of the pager
310 self.promote(self.dictionariesPage.box)
311
312 def promoteSettingsPage(self, obj=None, event=None, data=None):
313
314 if not self.settingsPage.box:
315
316 # Setup UI
317 self.settingsPage.setupUi()
318
319 # Quit button
320 self.settingsPage.quitSettingsWin.callback_clicked_add(self.promoteDefinitionPage)
321
322 # Show the loaded player
323 self.newPlayer = config.get('player')
324
325 # Set dictionary filename from configuration
326 utils.filename_set(self.settingsPage.playerEntry, self.newPlayer)
327
328 # Set new dictionary function
329 self.settingsPage.newPlayerButton.callback_clicked_add(self.newPlayerClicked)
330
331 # Set save function
332 self.settingsPage.savePlayer.callback_clicked_add(self.savePlayerClicked)
333
334 # About button
335 self.settingsPage.aboutPageWin.callback_clicked_add(self.promoteAboutPage)
336
337 # Put the setting page on the top of the pager
338 self.promote(self.settingsPage.box)
339
340 def promoteAboutPage(self, obj=None, event=None, data=None):
341
342 if not self.aboutPage.box:
343
344 # Setup UI
345 self.aboutPage.setupUi()
346
347 # Quit button
348 self.aboutPage.quitAboutWin.callback_clicked_add(self.promoteDefinitionPage)
349
350 # Put the setting page on the top of the pager
351 self.promote(self.aboutPage.box)
352
0\ No newline at end of file353\ No newline at end of file
1354
=== added file 'efl/main_ui.py'
--- efl/main_ui.py 1970-01-01 00:00:00 +0000
+++ efl/main_ui.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,117 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import elementary
19
20import logging
21log = logging.getLogger("babiloo.efl.definition_ui")
22
23from definition_ui import DefinitionPage
24from dictionaries_ui import DictionariesPage
25from settings_ui import SettingsPage
26from about_ui import AboutPage
27
28from efl.constants import *
29
30class Ui_Main(object):
31
32 def setupUi(self):
33
34 # Basic window - name, title
35 self.win = elementary.Window(APP_NAME, elementary.ELM_WIN_BASIC)
36 self.win.title_set(APP_NAME)
37
38 # Standard background
39 bg = elementary.Background(self.win)
40 self.win.resize_object_add(bg)
41 bg.size_hint_weight_set(1.0, 1.0)
42 bg.show()
43
44 # Different contents on the same page
45 self.definitionPage = DefinitionPage(self)
46 self.dictionariesPage = DictionariesPage(self)
47 self.settingsPage = SettingsPage(self)
48 self.aboutPage = AboutPage(self)
49
50 # Show definition page
51 self.promoteDefinitionPage()
52
53 # Window size (size for pc application, for neo means full screen)
54 self.win.resize(SCREEN_WIDTH, SCREEN_HEIGHT)
55 self.win.show()
56
57 def create_dialog(self, text):
58 self.dialog = elementary.Box(self.win)
59
60 loadingframe = elementary.Frame(self.win)
61 loadingframe.style_set("outdent_bottom")
62 loadingframe2 = elementary.Frame(self.win)
63 loadingframe2.style_set("outdent_top")
64 loadingframe2.size_hint_weight_set(0.0, 0.0)
65 loadingframe2.size_hint_align_set(0.5, 0.5)
66
67 # Internal box object
68 self.internalBox = elementary.Box(self.win)
69 self.messageEntry = elementary.Entry(self.win)
70 self.messageEntry.line_wrap_set(False)
71 self.messageEntry.entry_set(text)
72 self.messageEntry.editable_set(False)
73 self.internalBox.pack_end(self.messageEntry)
74 self.messageEntry.show()
75 self.okButton = elementary.Button(self.win)
76 self.okButton.label_set('OK')
77 self.okButton.size_hint_weight_set(0.0, 0.0)
78 self.okButton.size_hint_align_set(0.5, 0.5)
79 self.internalBox.pack_end(self.okButton)
80 self.okButton.show()
81
82 loadingframe.content_set(loadingframe2)
83 loadingframe2.content_set(self.internalBox)
84 self.win.resize_object_add(self.dialog)
85 self.dialog.pack_start(loadingframe)
86 self.internalBox.show()
87 loadingframe.show()
88 loadingframe2.show()
89 self.dialog.show()
90
91 self.okButton.callback_clicked_add(self.dialogClicked, self.dialog)
92
93 def dialogClicked(self, obj, data):
94 data.hide()
95
96 def create_loadingFrame(self, text):
97
98 self.loading = elementary.Box(self.win)
99
100 loadingframe = elementary.Frame(self.win)
101 loadingframe.style_set("outdent_bottom")
102 loadingframe2 = elementary.Frame(self.win)
103 loadingframe2.style_set("outdent_top")
104 loadingframe2.size_hint_weight_set(0.0, 0.0)
105 loadingframe2.size_hint_align_set(0.5, 0.5)
106
107 loadinglabel = elementary.Label(self.win)
108 loadinglabel.label_set(text)
109
110 loadingframe.content_set(loadingframe2)
111 loadingframe2.content_set(loadinglabel)
112 self.win.resize_object_add(self.loading)
113 self.loading.pack_start(loadingframe)
114 loadinglabel.show()
115 loadingframe.show()
116 loadingframe2.show()
117 self.loading.show()
0118
=== added file 'efl/settings_ui.py'
--- efl/settings_ui.py 1970-01-01 00:00:00 +0000
+++ efl/settings_ui.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,140 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import elementary
19
20import logging
21log = logging.getLogger("babiloo.efl.settingsPage")
22
23from efl.constants import *
24
25class SettingsPage():
26
27 # Initialization
28 def __init__(self, main):
29 self.main = main
30 self.box = None
31
32 # Setup user interface
33 def setupUi(self):
34
35 # Box Window with scroller and quit button
36 self.box = elementary.Box(self.main.win)
37 self.box.horizontal_set(False)
38 self.main.win.resize_object_add(self.box)
39 self.box.size_hint_weight_set(1.0, 1.0)
40 self.box.size_hint_align_set(-1, -1)
41 self.box.show()
42
43 # Scroller
44 scroller = elementary.Scroller(self.main.win)
45 scroller.bounce_set(0, 0)
46 scroller.size_hint_weight_set(1.0, 1.0)
47 scroller.size_hint_align_set(-1.0, -1.0)
48 self.box.pack_end(scroller)
49 scroller.show()
50
51 # About button
52 self.aboutPageWin = elementary.Button(self.main.win)
53 self.aboutPageWin.label_set("About")
54 self.aboutPageWin.size_hint_align_set(-1.0, 0.0)
55 ic = elementary.Icon(self.aboutPageWin)
56 ic.file_set( ABOUT_ICON)
57 ic.smooth_set(1)
58 ic.scale_set(1, 1)
59 self.aboutPageWin.icon_set(ic)
60 self.aboutPageWin.show()
61 self.box.pack_end(self.aboutPageWin)
62
63 # Quit button
64 self.quitSettingsWin = elementary.Button(self.main.win)
65 self.quitSettingsWin.label_set("Quit")
66 self.quitSettingsWin.size_hint_align_set(-1.0, 0.0)
67 ic = elementary.Icon(self.quitSettingsWin)
68 ic.file_set( QUIT_ICON)
69 ic.smooth_set(1)
70 ic.scale_set(1, 1)
71 self.quitSettingsWin.icon_set(ic)
72 self.quitSettingsWin.show()
73 self.box.pack_end(self.quitSettingsWin)
74
75 # Box inside scroller
76 boxScroller = elementary.Box(self.main.win)
77 boxScroller.horizontal_set(False)
78 boxScroller.size_hint_weight_set(1.0, -1.0)
79 scroller.content_set(boxScroller)
80 boxScroller.show()
81
82 # Frame for dictionary section
83 self.createPlayerFrame()
84 boxScroller.pack_end(self.framePlayer)
85
86 def createPlayerFrame(self):
87 self.framePlayer = elementary.Frame(self.main.win)
88 self.framePlayer.label_set("Player FILE NAME")
89 self.framePlayer.size_hint_align_set(-1.0, 0.0)
90 self.framePlayer.show()
91
92 # Box for dictionary section
93 boxPlayer = elementary.Box(self.main.win)
94 boxPlayer.horizontal_set(False)
95 boxPlayer.size_hint_align_set(-1.0, 0.0)
96 boxPlayer.show()
97
98 # Box object with 'New player' and 'PlayerPathEntry'
99 boxPlayerPathEntry= elementary.Box(self.main.win)
100 boxPlayerPathEntry.horizontal_set(True)
101 boxPlayerPathEntry.size_hint_weight_set(1.0, 1.0)
102 boxPlayerPathEntry.show()
103
104 # New player button
105 self.newPlayerButton = elementary.Button(self.main.win)
106 ic = elementary.Icon(self.newPlayerButton)
107 ic.file_set(NEW_PLAYER_ICON)
108 self.newPlayerButton.icon_set(ic)
109 # workround for nice position
110 self.newPlayerButton.label_set(" ")
111 self.newPlayerButton.size_hint_weight_set(0.0, 1.0)
112 self.newPlayerButton.size_hint_align_set(-1.0, -1.0)
113 self.newPlayerButton.show()
114
115 # Player path entry
116 self.playerEntry = elementary.Entry(self.main.win)
117 self.playerEntry.line_wrap_set(False)
118 self.playerEntry.entry_set('')
119 self.playerEntry.single_line_set(True)
120 self.playerEntry.editable_set(False)
121 self.newPlayerButton.size_hint_weight_set(0.0, 1.0)
122 self.playerEntry.size_hint_align_set(-1.0, -1.0)
123 self.playerEntry.scale_set(1.25)
124
125 self.playerEntry.show()
126
127 boxPlayerPathEntry.pack_end(self.newPlayerButton)
128 boxPlayerPathEntry.pack_end(self.playerEntry)
129
130 # File selector
131 self.savePlayer = elementary.Button(self.main.win)
132 self.savePlayer.label_set("Save")
133 self.savePlayer.size_hint_align_set(-1.0, 0.0)
134 self.savePlayer.show()
135
136 boxPlayer.pack_end(boxPlayerPathEntry)
137 boxPlayer.pack_end(self.savePlayer)
138
139 self.framePlayer.content_set(boxPlayer)
140
0141
=== added file 'efl/utils_ui.py'
--- efl/utils_ui.py 1970-01-01 00:00:00 +0000
+++ efl/utils_ui.py 2010-02-08 17:08:19 +0000
@@ -0,0 +1,77 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
18import elementary
19
20import logging
21log = logging.getLogger("babiloo.efl.utils")
22
23from efl.constants import *
24
25class UtilsUi():
26
27 # UI for the file selector window
28 def fileSelectorUI(self):
29 self.fileSelectorWindow = elementary.Window("fileselector", elementary.ELM_WIN_BASIC)
30 self.fileSelectorWindow.title_set("File selector")
31 self.fileSelectorWindow.autodel_set(True)
32
33 bg = elementary.Background(self.fileSelectorWindow)
34 self.fileSelectorWindow.resize_object_add(bg)
35 bg.size_hint_weight_set(1.0, 1.0)
36 bg.show()
37
38 vbox = elementary.Box(self.fileSelectorWindow)
39 self.fileSelectorWindow.resize_object_add(vbox)
40 vbox.size_hint_weight_set(1.0, 1.0)
41 vbox.show()
42
43 self.fileSelector = elementary.Fileselector(self.fileSelectorWindow)
44 # is_save_set what means?
45 self.fileSelector.is_save_set(True)
46 self.fileSelector.expandable_set(False)
47 self.fileSelector.path_set(os.getenv("HOME"))
48 self.fileSelector.size_hint_weight_set(1.0, 1.0)
49 self.fileSelector.size_hint_align_set(-1.0, -1.0)
50 vbox.pack_end(self.fileSelector)
51 self.fileSelector.show()
52
53 hbox = elementary.Box(self.fileSelectorWindow)
54 hbox.horizontal_set(True)
55 vbox.pack_end(hbox)
56 hbox.show()
57
58 self.fileSelectorWindow.resize(SCREEN_WIDTH, SCREEN_HEIGHT)
59 self.fileSelectorWindow.show()
60
61 # Show only the filename or part of it if longer than width
62 def filename_set(self, entry, filename):
63 if filename != "":
64
65 # If is a directory
66 if filename[-1] == '/':
67 # Cut last slash
68 filename = filename[0:-1]
69
70 # Cut the path
71 lastSlash = filename.rfind('/')
72 filename = filename[lastSlash+1:].strip()
73
74 if (len(filename) > WIDTH):
75 filename = filename[:WIDTH-3] + '...'
76 entry.entry_set(filename)
77 log.debug("Selected %s" % filename)
078
=== added file 'images/babiloo.png'
1Binary files images/babiloo.png 1970-01-01 00:00:00 +0000 and images/babiloo.png 2010-02-08 17:08:19 +0000 differ79Binary files images/babiloo.png 1970-01-01 00:00:00 +0000 and images/babiloo.png 2010-02-08 17:08:19 +0000 differ
=== modified file 'qt/about_ui.py'
--- qt/about_ui.py 2009-04-28 12:15:50 +0000
+++ qt/about_ui.py 2010-02-08 17:08:19 +0000
@@ -2,8 +2,8 @@
22
3# Form implementation generated from reading ui file 'about.ui'3# Form implementation generated from reading ui file 'about.ui'
4#4#
5# Created: Tue Apr 28 13:12:48 20095# Created: Tue Sep 1 20:42:24 2009
6# by: PyQt4 UI code generator 4.4.36# by: PyQt4 UI code generator 4.4.4
7#7#
8# WARNING! All changes made in this file will be lost!8# WARNING! All changes made in this file will be lost!
99
1010
=== modified file 'qt/chooseLanguage_ui.py'
--- qt/chooseLanguage_ui.py 2009-04-28 12:15:50 +0000
+++ qt/chooseLanguage_ui.py 2010-02-08 17:08:19 +0000
@@ -2,8 +2,8 @@
22
3# Form implementation generated from reading ui file 'chooseLanguage.ui'3# Form implementation generated from reading ui file 'chooseLanguage.ui'
4#4#
5# Created: Tue Apr 28 13:12:48 20095# Created: Tue Sep 1 20:42:24 2009
6# by: PyQt4 UI code generator 4.4.36# by: PyQt4 UI code generator 4.4.4
7#7#
8# WARNING! All changes made in this file will be lost!8# WARNING! All changes made in this file will be lost!
99
1010
=== modified file 'qt/images_rc.py'
--- qt/images_rc.py 2009-05-31 22:13:44 +0000
+++ qt/images_rc.py 2010-02-08 17:08:19 +0000
@@ -2,7 +2,7 @@
22
3# Resource object code3# Resource object code
4#4#
5# Created: Mon Jun 1 04:37:24 20095# Created: Tue Sep 1 20:42:23 2009
6# by: The Resource Compiler for PyQt (Qt v4.5.0)6# by: The Resource Compiler for PyQt (Qt v4.5.0)
7#7#
8# WARNING! All changes made in this file will be lost!8# WARNING! All changes made in this file will be lost!
99
=== modified file 'qt/main_ui.py'
--- qt/main_ui.py 2009-05-31 22:13:44 +0000
+++ qt/main_ui.py 2010-02-08 17:08:19 +0000
@@ -2,7 +2,7 @@
22
3# Form implementation generated from reading ui file 'main.ui'3# Form implementation generated from reading ui file 'main.ui'
4#4#
5# Created: Mon Jun 1 04:37:24 20095# Created: Tue Sep 1 20:42:23 2009
6# by: PyQt4 UI code generator 4.4.46# by: PyQt4 UI code generator 4.4.4
7#7#
8# WARNING! All changes made in this file will be lost!8# WARNING! All changes made in this file will be lost!
99
=== modified file 'qt/settings_ui.py'
--- qt/settings_ui.py 2009-04-28 14:06:16 +0000
+++ qt/settings_ui.py 2010-02-08 17:08:19 +0000
@@ -2,8 +2,8 @@
22
3# Form implementation generated from reading ui file 'settings.ui'3# Form implementation generated from reading ui file 'settings.ui'
4#4#
5# Created: Tue Apr 28 16:03:26 20095# Created: Tue Sep 1 20:42:23 2009
6# by: PyQt4 UI code generator 4.4.36# by: PyQt4 UI code generator 4.4.4
7#7#
8# WARNING! All changes made in this file will be lost!8# WARNING! All changes made in this file will be lost!
99
1010
=== modified file 'run.py'
--- run.py 2009-03-28 01:13:40 +0000
+++ run.py 2010-02-08 17:08:17 +0000
@@ -39,8 +39,19 @@
39parser = OptionParser(description=conf.General.description, version=conf.General.version, option_list=conf.Terminal.option_list)39parser = OptionParser(description=conf.General.description, version=conf.General.version, option_list=conf.Terminal.option_list)
40(options, args) = parser.parse_args()40(options, args) = parser.parse_args()
4141
42# Retrieve if the hardware is GTA01 or GTA02
43# if is, set to gui mode to efl
44for line in open('/proc/cpuinfo'):
45 if line.startswith('Hardware'):
46 type = line.split()
47 type =type[len(type)-1]
48 if type.startswith('GTA0'):
49 options.mode = 'efl'
50
42if options.mode == 'gui':51if options.mode == 'gui':
43 import qt.main52 import qt.main
53elif options.mode == 'efl':
54 import efl.main
44#elif options.mode == 'cli':55#elif options.mode == 'cli':
45# import cli.main56# import cli.main
4657
@@ -75,5 +86,7 @@
7586
76 if options.mode == 'gui':87 if options.mode == 'gui':
77 qt.main.main(options)88 qt.main.main(options)
89 if options.mode == 'efl':
90 efl.main.main(options)
7891
79 log.info('Babiloo closed for mantainance.')92 log.info('Babiloo closed for mantainance.')

Subscribers

People subscribed via source and target branches