diff -Nru tomate-0.3ubuntu1/README.TXT tomate-0.3.0/README.TXT
--- tomate-0.3ubuntu1/README.TXT 1970-01-01 00:00:00.000000000 +0000
+++ tomate-0.3.0/README.TXT 2013-12-03 02:06:16.000000000 +0000
@@ -0,0 +1,57 @@
+Tomate
+======
+
+A Pomodoro timer build in Python/Gtk3.
+This app will you help to mark the pomodoro times (pomodoro, short break and long break).
+
+
+Installation
+------------
+
+.. code-block:: bash
+
+ sudo add-apt-repository ppa:stvs/tomate
+ sudo apt-get update && sudo apt-get install -y tomate
+
+
+Requirements
+------------
+
+* python-distutils-extra
+* libgranite0
+* gir1.2-notify-0.7
+* gir1.2-gtk-3.0
+* gir1.2-glib-2.0
+* gir1.2-unity-5.0
+* gir1.2-gstreamer-1.0
+* gir1.2-gdkpixbuf-2.0
+* gir1.2-appindicator3-0.1
+* yelp
+
+
+Bugs and Suggetions
+-------------------
+
+Bugs and suggestions should be reported at: http://bugs.launchpad.net/tomate
+
+
+Authors
+-------
+
+`Elio Esteves Duarte`_ created Pomodoro.
+
+
+License
+-------
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 3, as published
+by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranties of
+MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program. If not, see .
Binary files /tmp/aK4tguqdI4/tomate-0.3ubuntu1/data/glib-2.0/schemas/gschemas.compiled and /tmp/eosINYNGO4/tomate-0.3.0/data/glib-2.0/schemas/gschemas.compiled differ
diff -Nru tomate-0.3ubuntu1/debian/bzr-builder.manifest tomate-0.3.0/debian/bzr-builder.manifest
--- tomate-0.3ubuntu1/debian/bzr-builder.manifest 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/debian/bzr-builder.manifest 2013-12-03 02:06:17.000000000 +0000
@@ -1,2 +1,2 @@
-# bzr-builder format 0.3 deb-version {debupstream}-0~39
-lp:tomate revid:elio.esteves.duarte@gmail.com-20130820010637-78ixkl5g7zdtw710
+# bzr-builder format 0.3 deb-version {debupstream}-0+10+201312030206
+lp:tomate/master revid:elio.esteves.duarte@gmail.com-20131203012030-hw55dryltbipb6js
diff -Nru tomate-0.3ubuntu1/debian/changelog tomate-0.3.0/debian/changelog
--- tomate-0.3ubuntu1/debian/changelog 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/debian/changelog 2013-12-03 02:06:17.000000000 +0000
@@ -1,11 +1,10 @@
-tomate (0.3ubuntu1-0~39~ubuntu13.04.1) raring; urgency=low
+tomate (0.3.0-0+10+201312030206~ubuntu13.04.1) raring; urgency=low
* Auto build.
- -- Elio Esteves Duarte Sat, 23 Nov 2013 05:55:34 +0000
-
-tomate (0.3ubuntu1) UNRELEASED; urgency=low
+ -- Elio Esteves Duarte Tue, 03 Dec 2013 02:06:17 +0000
+tomate (0.3.0) saucy; urgency=low
[ Frederik Elwert ]
* Automatically select the next timer.
* Fix indicator status attention.
@@ -15,7 +14,7 @@
* Lock the execution of more than one instance.
* Pops up window on finished.
- -- Elio Esteves Duarte Mon, 05 Nov 2012 20:53:06 -0200
+ -- Elio Esteves Duarte Sun, 01 Dec 2013 12:29:52 -0200
tomate (0.2.1) precise; urgency=low
diff -Nru tomate-0.3ubuntu1/debian/control tomate-0.3.0/debian/control
--- tomate-0.3ubuntu1/debian/control 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/debian/control 2013-12-03 02:06:16.000000000 +0000
@@ -5,13 +5,12 @@
python (>= 2.6.6-3~),
python-distutils-extra (>= 2.10)
Maintainer: Elio Esteves Duarte
-Standards-Version: 3.8.3
-XS-Python-Version: current
+Standards-Version: 3.9.4
+X-Python-Version: >= 2.6
Homepage: http://www.launchpad.net/tomate
Package: tomate
Architecture: all
-XB-Python-Version: ${python:Versions}
Depends: ${misc:Depends},
${python:Depends},
libgranite0,
@@ -19,10 +18,9 @@
gir1.2-gtk-3.0,
gir1.2-glib-2.0,
gir1.2-unity-5.0,
- python-gi,
- gir1.2-gdkpixbuf-2.0,
gir1.2-gstreamer-0.10,
- gir1.2-appindicator3-0.1,
- yelp
-Description: A Pomodoro timer build in Python/Gtk3.
- This app will you help to mark the pomodoro times (including the pomodoro, short break and long break)
+ gir1.2-gdkpixbuf-2.0,
+ gir1.2-appindicator3-0.1
+Description: A Pomodoro timer build in Python/Gtk.
+ This app will you help to mark the pomodoro times (pomodoro, short break
+ and long break).
diff -Nru tomate-0.3ubuntu1/po/tomate.pot tomate-0.3.0/po/tomate.pot
--- tomate-0.3ubuntu1/po/tomate.pot 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/po/tomate.pot 2013-12-03 02:06:16.000000000 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-08-13 11:31-0300\n"
+"POT-Creation-Date: 2013-11-28 22:43-0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -18,16 +18,16 @@
"Content-Transfer-Encoding: 8bit\n"
#. Show/Hide menuitem
-#: ../tomate/indicator.py:37 ../tomate/indicator.py:70
+#: ../tomate/indicator.py:39 ../tomate/indicator.py:70
msgid "Hide"
msgstr ""
#. Quit menuitem
-#: ../tomate/indicator.py:41
+#: ../tomate/indicator.py:43
msgid "Quit"
msgstr ""
-#: ../tomate/indicator.py:66 ../tomate/widgets/window.py:260
+#: ../tomate/indicator.py:66 ../tomate/widgets/window.py:258
msgid "Show"
msgstr ""
@@ -39,70 +39,70 @@
msgid "Pomodoro Timer build in Python/Gtk3"
msgstr ""
-#: ../tomate/widgets/window.py:82 ../tomate/widgets/window.py:199
+#: ../tomate/widgets/window.py:81 ../tomate/widgets/window.py:193
msgid "Starts the timer"
msgstr ""
-#: ../tomate/widgets/window.py:88
+#: ../tomate/widgets/window.py:87
msgid "Resets the count of the pomodoros"
msgstr ""
-#. Settings
-#: ../tomate/widgets/window.py:108 ../tomate/widgets/preferences.py:26
+#. Settings Menu
+#: ../tomate/widgets/window.py:105 ../tomate/widgets/preferences.py:28
msgid "Preferences"
msgstr ""
-#. Content
-#: ../tomate/widgets/window.py:113
+#. Help Menu
+#: ../tomate/widgets/window.py:110
msgid "Help"
msgstr ""
-#. About
-#: ../tomate/widgets/window.py:118
+#. About Menu
+#: ../tomate/widgets/window.py:115
msgid "About"
msgstr ""
-#: ../tomate/widgets/window.py:167 ../tomate/handler.py:32
+#: ../tomate/widgets/window.py:161 ../tomate/handler.py:33
msgid "Pomodoro"
msgstr ""
-#: ../tomate/widgets/window.py:168
+#: ../tomate/widgets/window.py:162
msgid "Short Break"
msgstr ""
-#: ../tomate/widgets/window.py:169
+#: ../tomate/widgets/window.py:163
msgid "Long Break"
msgstr ""
-#: ../tomate/widgets/window.py:194
+#: ../tomate/widgets/window.py:188
msgid "Stops the timer"
msgstr ""
-#: ../tomate/handler.py:33
+#: ../tomate/handler.py:34
msgid "It's time to work. Focus now!"
msgstr ""
-#: ../tomate/handler.py:34
+#: ../tomate/handler.py:35
msgid "Short break"
msgstr ""
-#: ../tomate/handler.py:35
+#: ../tomate/handler.py:36
msgid "Go take a coffee!"
msgstr ""
-#: ../tomate/handler.py:36
+#: ../tomate/handler.py:37
msgid "Long break"
msgstr ""
-#: ../tomate/handler.py:37
+#: ../tomate/handler.py:38
msgid "Time to rest. Go take a walk!"
msgstr ""
-#: ../tomate/handler.py:38
+#: ../tomate/handler.py:39
msgid "Alarm"
msgstr ""
-#: ../tomate/handler.py:39
+#: ../tomate/handler.py:40
msgid "The time is up!"
msgstr ""
@@ -114,42 +114,38 @@
msgid "Notifications"
msgstr ""
-#. Section Time
-#: ../tomate/widgets/preferences.py:62
-msgid "Timer Lenghts:"
+#: ../tomate/widgets/preferences.py:101
+msgid "Timer Lengths:"
msgstr ""
-#. Pomodoro
-#: ../tomate/widgets/preferences.py:68
+#: ../tomate/widgets/preferences.py:114
msgid "Pomodoro:"
msgstr ""
-#. Short break
-#: ../tomate/widgets/preferences.py:85
+#: ../tomate/widgets/preferences.py:136
msgid "Short break:"
msgstr ""
-#. Long break
-#: ../tomate/widgets/preferences.py:102
+#: ../tomate/widgets/preferences.py:158
msgid "Long break:"
msgstr ""
-#. Behaviour Section
-#: ../tomate/widgets/preferences.py:120
+#: ../tomate/widgets/preferences.py:181
msgid "Behaviours:"
msgstr ""
-#. Hide on delete
-#: ../tomate/widgets/preferences.py:126
-msgid "Close to the notification area:"
+#: ../tomate/widgets/preferences.py:194
+msgid "Show time progress in indicator:"
msgstr ""
-#. OSD notification options
-#: ../tomate/widgets/preferences.py:157
+#: ../tomate/widgets/preferences.py:242
msgid "Notify OSD:"
msgstr ""
-#. Ring notification options
-#: ../tomate/widgets/preferences.py:174
-msgid "Rings when time ends:"
+#: ../tomate/widgets/preferences.py:263
+msgid "Ring alarm when time ends:"
+msgstr ""
+
+#: ../tomate/__init__.py:44
+msgid "Another instance of Tomate is already running!"
msgstr ""
diff -Nru tomate-0.3ubuntu1/setup.py tomate-0.3.0/setup.py
--- tomate-0.3ubuntu1/setup.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/setup.py 2013-12-03 02:06:16.000000000 +0000
@@ -20,6 +20,8 @@
import os
import sys
+import tomate
+
try:
import DistUtilsExtra.auto
except ImportError:
@@ -27,16 +29,16 @@
sys.exit(1)
assert DistUtilsExtra.auto.__version__ >= '2.18', 'needs DistUtilsExtra.auto >= 2.18'
-def update_config(libdir, values = {}):
- filename = os.path.join(libdir, 'tomate/tomateconfig.py')
+def update_config(libdir, values={}):
+ filename = os.path.join(libdir, 'tomate/helpers.py')
oldvalues = {}
try:
fin = file(filename, 'r')
fout = file(filename + '.new', 'w')
for line in fin:
- fields = line.split(' = ') # Separate variable from value
+ fields = line.split(' = ') # Separate variable from value
if fields[0] in values:
oldvalues[fields[0]] = fields[1].strip()
line = "%s = %s\n" % (fields[0], values[fields[0]])
@@ -46,7 +48,7 @@
fout.close()
fin.close()
os.rename(fout.name, fin.name)
- except (OSError, IOError), e:
+ except (OSError, IOError):
print ("ERROR: Can't find %s" % filename)
sys.exit(1)
return oldvalues
@@ -80,6 +82,7 @@
return desktop_file
+
def update_desktop_file(filename, target_pkgdata, target_scripts):
try:
@@ -100,10 +103,11 @@
fout.close()
fin.close()
os.rename(fout.name, fin.name)
- except (OSError, IOError), e:
+ except (OSError, IOError):
print ("ERROR: Can't find %s" % filename)
sys.exit(1)
+
def compile_schemas(root, target_data):
if target_data == '/usr/':
return # /usr paths don't need this, they will be handled by dpkg
@@ -121,8 +125,8 @@
target_pkgdata = target_data + 'share/tomate/'
target_scripts = '/' + os.path.relpath(self.install_scripts, self.root) + '/'
- values = {'__tomate_data_directory__': "'%s'" % (target_pkgdata),
- '__version__': "'%s'" % self.distribution.get_version()}
+ values = {'__data_directory__': "'%s'" % (target_pkgdata)}
+
update_config(self.install_lib, values)
desktop_file = move_desktop_file(self.root, target_data, self.prefix)
@@ -156,18 +160,18 @@
(os.path.basename(theme),
os.path.basename(category),
os.path.basename(size)),
- icons))
+ icons))
return data_files
DistUtilsExtra.auto.setup(
- name='tomate',
- version='0.2',
- license='GPL-3',
- author='Elio Esteves Duarte',
- author_email='elio.esteves.duarte@gmail.com',
- description='A Pomodoro timer build in Python/Gtk.',
- #long_description='Here a longer description',
- url='https://launchpad.net/tomate',
+ name=tomate.__name__,
+ version=tomate.__version__,
+ license=tomate.__license__,
+ author=tomate.__author__,
+ author_email=tomate.__author_email__,
+ description=tomate.__description__,
+ long_description="This app will you help to mark the pomodoro times (pomodoro, short break and long break).",
+ url=tomate.__url__,
data_files=get_themed_icons(),
cmdclass={'install': InstallAndUpdateDataDirectory}
- )
+)
diff -Nru tomate-0.3ubuntu1/tomate/__init__.py tomate-0.3.0/tomate/__init__.py
--- tomate-0.3ubuntu1/tomate/__init__.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/__init__.py 2013-12-03 02:06:16.000000000 +0000
@@ -14,22 +14,34 @@
# with this program. If not, see .
### END LICENSE
-import os
-import fcntl
-from gi.repository import Gtk
import locale
+import os
from locale import gettext as _
+
+import fcntl
+
locale.textdomain('tomate')
+__name__ = 'tomate'
+__license__ = 'GPL-3'
+__author__ = 'Elio Esteves Duarte'
+__author_email__ = 'elio.esteves.duarte@gmail.com'
+__name__ = 'tomate'
+__version_info__ = (0, 3, 0)
+__version__ = '.'.join(map(str, __version_info__))
+__url__ = 'https://launchpad.net/tomate'
+__description__ = 'A Pomodoro timer build in Python/Gtk.'
+
def main():
"""Constructor for your class instances."""
+ from gi.repository import Gtk
fh = open('/tmp/tomate.pid', 'w')
try:
fcntl.lockf(fh, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
- print(_('Another instance of Tomate is running!'))
+ print(_('Another instance of Tomate is already running!'))
os._exit(0)
else:
from tomate.handler import Handler
diff -Nru tomate-0.3ubuntu1/tomate/handler.py tomate-0.3.0/tomate/handler.py
--- tomate-0.3ubuntu1/tomate/handler.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/handler.py 2013-12-03 02:06:16.000000000 +0000
@@ -13,15 +13,17 @@
# with this program. If not, see .
### END LICENSE
-from tomate.tomateconfig import SCHEMA_ID
-from tomate.timer import Timer
+import locale
+from locale import gettext as _
+
+from gi.repository import GObject
+from tomate.indicator import Indicator
from tomate.launcher import Launcher
from tomate.notification import OSDNotify, SoundNotify
-from tomate.indicator import Indicator
+from tomate.timer import Timer
+from tomate.helpers import get_settings
from tomate.widgets.window import Window
-from gi.repository import GObject, Gio
-import locale
-from locale import gettext as _
+
locale.textdomain('tomate')
@@ -44,17 +46,17 @@
self.indicator = Indicator(self)
self.ui = Window(self)
self._launcher = Launcher(self)
- self._settings = Gio.Settings.new(SCHEMA_ID)
+ self.settings = get_settings()
def start_timer(self):
"""Start the timer and show the osd notification."""
task = self.ui.selected_task
- minutes = self._settings.get_int(task + '-length')
+ minutes = self.settings.get_int(task + '-length')
seconds = minutes * 60
self.timer.start(seconds)
self.indicator.set_status_active()
- if self._settings.get_boolean('osd-notification'):
+ if self.settings.get_boolean('osd-notification'):
title, message = self._get_osd_messages(task)
self._osd.display(title, message)
@@ -70,7 +72,7 @@
# Update the UI (counter, active task, ...)
if self.ui.selected_task == Window.TASK_POMODORO:
self.ui.pomodoros_counter += 1
- n = self._settings.get_int('pomodoros-until-long-break')
+ n = self.settings.get_int('pomodoros-until-long-break')
if not self.ui.pomodoros_counter % n:
self.ui.selected_task = Window.TASK_LONG_BREAK
else:
@@ -82,12 +84,12 @@
self.__update()
# Show/play alarms
- if self._settings.get_boolean('osd-notification'):
+ if self.settings.get_boolean('osd-notification'):
self._osd.display(
self._ALARM_OSD_TITLE,
Handler._ALARM_OSD_MSG)
- if self._settings.get_boolean('tone-notification'):
+ if self.settings.get_boolean('tone-notification'):
self._sound.alarm()
# Do this after updating the UI, otherwise the indicator might get
diff -Nru tomate-0.3ubuntu1/tomate/helpers.py tomate-0.3.0/tomate/helpers.py
--- tomate-0.3ubuntu1/tomate/helpers.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/helpers.py 2013-12-03 02:06:16.000000000 +0000
@@ -15,19 +15,30 @@
### END LICENSE
"""Helpers for an Ubuntu application."""
+
import logging
import os
+from gi.repository import Gio
+
+__data_directory__ = '../data/'
+_settings = None
+SCHEMA_ID = 'net.launchpad.tomate'
-from tomate.tomateconfig import get_data_file
+
+def get_settings():
+ global _settings
+ if _settings is None:
+ _settings = Gio.Settings.new(SCHEMA_ID)
+ return _settings
# Owais Lone : To get quick access to icons and stuff.
def get_media_file(media_file_name):
- media_filename = get_data_file('media', '%s' % (media_file_name,))
+ media_filename = get_data_file('media', media_file_name)
if not os.path.exists(media_filename):
media_filename = None
- return media_filename
+ return os.path.join("file:///", media_filename)
class NullHandler(logging.Handler):
@@ -55,8 +66,7 @@
help_uri = os.path.abspath(os.path.join(here, '..', 'help', 'C'))
if not os.path.exists(help_uri):
- # installed so use gnome help tree - user's language
- help_uri = 'tomate'
+ help_uri = '/usr/share/help/C/tomate/'
# unspecified page is the index.page
if page is not None:
@@ -69,3 +79,36 @@
from gi.repository import Gtk
screen = parent.get_screen()
Gtk.show_uri(screen, link, Gtk.get_current_event_time())
+
+
+class project_path_not_found(Exception):
+ """Raised when we can't find the project directory."""
+
+
+def get_data_file(*path_segments):
+ """Get the full path to a data file.
+
+ Returns the path to a file underneath the data directory (as defined by
+ `get_data_path`). Equivalent to os.path.join(get_data_path(),
+ *path_segments).
+ """
+ return os.path.join(get_data_path(), *path_segments)
+
+
+def get_data_path():
+ """Retrieve foobar data path
+
+ This path is by default /../data/ in trunk
+ and /usr/share/foobar in an installed version but this path
+ is specified at installation time.
+ """
+
+ # Get pathname absolute or relative.
+ path = os.path.join(
+ os.path.dirname(__file__), __data_directory__)
+
+ abs_data_path = os.path.abspath(path)
+ if not os.path.exists(abs_data_path):
+ raise project_path_not_found(abs_data_path)
+
+ return abs_data_path
diff -Nru tomate-0.3ubuntu1/tomate/indicator.py tomate-0.3.0/tomate/indicator.py
--- tomate-0.3ubuntu1/tomate/indicator.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/indicator.py 2013-12-03 02:06:16.000000000 +0000
@@ -16,11 +16,12 @@
import locale
from locale import gettext as _
-locale.textdomain('tomate')
-from gi.repository import Gtk, AppIndicator3, Gio
+from gi.repository import AppIndicator3, Gtk
+from tomate.helpers import get_settings
from tomate.timer import Timer
-from tomate.tomateconfig import SCHEMA_ID
+
+locale.textdomain('tomate')
class Indicator(object):
@@ -32,7 +33,7 @@
def __init__(self, handler):
self.handler = handler
- self._settings = Gio.Settings.new(SCHEMA_ID)
+ self.settings = get_settings()
# Show/Hide menuitem
self.show_mnu = Gtk.MenuItem(_('Hide'))
@@ -70,7 +71,7 @@
def update(self):
"""Updates the indicator based on the timer."""
- if self._settings.get_boolean('show-progress-in-indicator'):
+ if self.settings.get_boolean('show-progress-in-indicator'):
if self.handler.timer.status == Timer.STATUS_RUNNING:
self.set_status_active()
percent = int(self.handler.timer.time_ratio * 100)
diff -Nru tomate-0.3ubuntu1/tomate/notification.py tomate-0.3.0/tomate/notification.py
--- tomate-0.3ubuntu1/tomate/notification.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/notification.py 2013-12-03 02:06:16.000000000 +0000
@@ -16,8 +16,6 @@
from tomate.helpers import get_media_file
import time
-import gi
-gi.require_version('Gst', '0.10')
from gi.repository import Notify, Gst
diff -Nru tomate-0.3ubuntu1/tomate/tomateconfig.py tomate-0.3.0/tomate/tomateconfig.py
--- tomate-0.3ubuntu1/tomate/tomateconfig.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/tomateconfig.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,62 +0,0 @@
-# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
-### BEGIN LICENSE
-# Copyright (C) 2012
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3, as published
-# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranties of
-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see .
-### END LICENSE
-
-# Where your project will look for your data (for instance, images and ui
-# files). By default, this is ../data, relative your trunk layout
-
-__tomate_data_directory__ = '../data/'
-__license__ = 'GPL-3'
-__version__ = '0.2'
-SCHEMA_ID = 'net.launchpad.tomate'
-
-import os
-
-
-class project_path_not_found(Exception):
- """Raised when we can't find the project directory."""
-
-
-def get_data_file(*path_segments):
- """Get the full path to a data file.
-
- Returns the path to a file underneath the data directory (as defined by
- `get_data_path`). Equivalent to os.path.join(get_data_path(),
- *path_segments).
- """
- return os.path.join(get_data_path(), *path_segments)
-
-
-def get_data_path():
- """Retrieve tomate data path
-
- This path is by default /../data/ in trunk
- and /usr/share/tomate in an installed version but this path
- is specified at installation time.
- """
-
- # Get pathname absolute or relative.
- path = os.path.join(
- os.path.dirname(__file__), __tomate_data_directory__)
-
- abs_data_path = os.path.abspath(path)
- if not os.path.exists(abs_data_path):
- raise project_path_not_found
-
- return abs_data_path
-
-
-def get_version():
- return __version__
diff -Nru tomate-0.3ubuntu1/tomate/widgets/about.py tomate-0.3.0/tomate/widgets/about.py
--- tomate-0.3ubuntu1/tomate/widgets/about.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/widgets/about.py 2013-12-03 02:06:16.000000000 +0000
@@ -14,9 +14,9 @@
# with this program. If not, see .
### END LICENSE
-from gi.repository import Granite, GdkPixbuf, Gtk
+import tomate
+from gi.repository import GdkPixbuf, Granite, Gtk
from tomate.helpers import get_media_file
-from tomate.tomateconfig import __version__, __license__
class AboutDialog(object):
@@ -28,16 +28,16 @@
self.about.set_transient_for(parent)
logo = GdkPixbuf.Pixbuf.new_from_file(AboutDialog._ICON)
self.about.set_logo(logo)
- authors = ['Elio Esteves Duarte ', ]
+ authors = [tomate.__author__ + ' <' + tomate.__author_email__ + '>', ]
self.about.set_property('authors', authors)
self.about.set_copyright('2012, Elio Esteves Duarte')
- self.about.set_program_name('Tomate')
- self.about.set_version(__version__)
- self.about.set_license(__license__)
+ self.about.set_program_name(tomate.__name__.capitalize())
+ self.about.set_version(tomate.__version__)
+ self.about.set_license(tomate.__license__)
self.about.set_license_type(Gtk.License.GPL_3_0)
- self.about.set_website('http://launchpad.net/tomate')
+ self.about.set_website(tomate.__url__)
self.about.set_website_label('Tomate on Launchpad')
- self.about.set_comments('A Pomodoro timer build in Python/Gtk.')
+ self.about.set_comments(tomate.__description__)
self.about.set_help('http://answers.launchpad.net/tomate')
self.about.set_translate('http://translations.launchpad.net/tomate')
self.about.set_bug('http://bugs.launchpad.net/tomate')
diff -Nru tomate-0.3ubuntu1/tomate/widgets/preferences.py tomate-0.3.0/tomate/widgets/preferences.py
--- tomate-0.3ubuntu1/tomate/widgets/preferences.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/widgets/preferences.py 2013-12-03 02:06:16.000000000 +0000
@@ -13,10 +13,12 @@
# with this program. If not, see .
### END LICENSE
-from tomate.tomateconfig import SCHEMA_ID
-from gi.repository import Gtk, Granite, Gio, Gdk
import locale
from locale import gettext as _
+
+from gi.repository import Gdk, Gio, Granite, Gtk
+from tomate.helpers import get_settings
+
locale.textdomain('tomate')
@@ -29,7 +31,7 @@
type_hint=Gdk.WindowTypeHint.DIALOG,
resizable=False)
self.set_size_request(370, 200)
- self.settings = Gio.Settings.new(SCHEMA_ID)
+ self.settings = get_settings()
self.create_layout()
def create_layout(self):
diff -Nru tomate-0.3ubuntu1/tomate/widgets/window.py tomate-0.3.0/tomate/widgets/window.py
--- tomate-0.3ubuntu1/tomate/widgets/window.py 2013-11-23 05:55:34.000000000 +0000
+++ tomate-0.3.0/tomate/widgets/window.py 2013-12-03 02:06:16.000000000 +0000
@@ -14,14 +14,16 @@
# with this program. If not, see .
### END LICENSE
-from tomate.tomateconfig import SCHEMA_ID
+import locale
+from locale import gettext as _
+
+from gi.repository import GdkPixbuf, Granite, Gtk
+from tomate.helpers import get_help_uri, get_media_file, show_uri
from tomate.timer import Timer
-from tomate.helpers import get_media_file, get_help_uri, show_uri
+from tomate.helpers import get_settings
from tomate.widgets.about import AboutDialog
from tomate.widgets.preferences import PreferencesDialog
-from gi.repository import Gtk, GdkPixbuf, Gio, Granite
-import locale
-from locale import gettext as _
+
locale.textdomain('tomate')
@@ -31,11 +33,9 @@
TASK_POMODORO = 'pomodoro'
TASK_SHORT_BREAK = 'short-break'
TASK_LONG_BREAK = 'long-break'
- TASK_INDEX = { # map names to the index of the modebutton
- TASK_POMODORO: 0,
- TASK_SHORT_BREAK: 1,
- TASK_LONG_BREAK: 2
- }
+ TASK_INDEX = {TASK_POMODORO: 0,
+ TASK_SHORT_BREAK: 1,
+ TASK_LONG_BREAK: 2}
TASK_NAME = dict((value, key) for key, value in TASK_INDEX.items())
_ICON = GdkPixbuf.Pixbuf.new_from_file(get_media_file('tomate-small.png'))
_MINUTE_TEMPLATE = '{0:0>2}:00'
@@ -53,7 +53,7 @@
self.handler = handler
self.pomodoros_counter = 0
- self._settings = Gio.Settings.new(SCHEMA_ID)
+ self.settings = get_settings()
self._create_layout()
def _create_layout(self):
@@ -172,7 +172,7 @@
time = self.handler.timer.time_mmss
time_markup = Window._MINUTE_SECOND_TEMPLATE.format(time)
else:
- time = self._settings.get_int(self.selected_task + '-length')
+ time = self.settings.get_int(self.selected_task + '-length')
time_markup = Window._MINUTE_TEMPLATE.format(time)
self.elapsed_time.set_markup(time_markup)