gtg team mailing list archive
-
gtg team
-
Mailing list archive
-
Message #02481
[Merge] lp:~gtg-contributors/gtg/code-layout into lp:gtg
Paul Kishimoto has proposed merging lp:~gtg-contributors/gtg/code-layout into lp:gtg.
Requested reviews:
Gtg developers (gtg)
Partially implement the code layout change described in the discussion at: https://lists.launchpad.net/gtg-contributors/msg00174.html
It does not move the plugins directory, or the CLI. Those will happen in separate merges.
--
https://code.launchpad.net/~gtg-contributors/gtg/code-layout/+merge/26624
Your team Gtg developers is requested to review the proposed merge of lp:~gtg-contributors/gtg/code-layout into lp:gtg.
=== modified file 'GTG/gtg.py'
--- GTG/gtg.py 2010-05-26 09:54:42 +0000
+++ GTG/gtg.py 2010-06-02 18:29:20 +0000
@@ -55,13 +55,13 @@
from contextlib import contextmanager
#our own imports
-from GTG import _
-from GTG.viewmanager.manager import Manager
-from GTG.core.datastore import DataStore
-from GTG.core import CoreConfig
-from GTG.tools.logger import Log
-from GTG.tools import gtkcrashhandler
-from GTG import info
+from GTG import _
+from GTG.gtk.manager import Manager
+from GTG.core.datastore import DataStore
+from GTG.core import CoreConfig
+from GTG.tools.logger import Log
+from GTG.tools import gtkcrashhandler
+from GTG import info
#=== OBJECTS ==================================================================
=== added directory 'GTG/gtk'
=== renamed file 'GTG/viewmanager/__init__.py' => 'GTG/gtk/__init__.py'
--- GTG/viewmanager/__init__.py 2010-03-02 14:31:47 +0000
+++ GTG/gtk/__init__.py 2010-06-02 18:29:20 +0000
@@ -22,12 +22,13 @@
There should be no horizontal communication at all between views.
"""
-
import os
-from GTG import _
+from GTG import _
+
class ViewConfig:
current_rep = os.path.dirname(os.path.abspath(__file__))
DELETE_GLADE_FILE = os.path.join(current_rep, "deletion.glade")
PREFERENCES_GLADE_FILE = os.path.join(current_rep, "preferences.glade")
+
=== renamed directory 'GTG/taskbrowser' => 'GTG/gtk/browser'
=== modified file 'GTG/gtk/browser/CellRendererTags.py'
--- GTG/taskbrowser/CellRendererTags.py 2009-09-24 13:15:17 +0000
+++ GTG/gtk/browser/CellRendererTags.py 2010-06-02 18:29:20 +0000
@@ -183,3 +183,4 @@
return (self.xpad, self.ypad, self.xpad*2, self.ypad*2)
gobject.type_register(CellRendererTags)
+
=== modified file 'GTG/gtk/browser/__init__.py'
--- GTG/taskbrowser/__init__.py 2010-03-01 03:11:53 +0000
+++ GTG/gtk/browser/__init__.py 2010-06-02 18:29:20 +0000
@@ -16,8 +16,6 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
-
-
"""
The GTK frontend for browsing collections of tasks.
@@ -26,7 +24,7 @@
"""
import os
-from GTG import _
+from GTG import _
class GnomeConfig:
@@ -46,3 +44,4 @@
NEW_TASK_TOOLTIP = _("Create a new task")
NEW_SUBTASK_TOOLTIP = _("Create a new subtask")
WORKVIEW_TOGGLE_TOOLTIP = _("Display only the currently actionable tasks")
+
=== modified file 'GTG/gtk/browser/browser.py'
--- GTG/taskbrowser/browser.py 2010-05-28 23:47:15 +0000
+++ GTG/gtk/browser/browser.py 2010-06-02 18:29:20 +0000
@@ -22,39 +22,36 @@
#=== IMPORT ===================================================================
#system imports
+import locale
+import os
+import re
+import time
+import webbrowser
+
import pygtk
pygtk.require('2.0')
import gobject
-import os
import gtk
-import locale
-import re
-import time
-import webbrowser
#our own imports
import GTG
-from GTG import info
-from GTG import _
-from GTG import ngettext
-from GTG.tools.logger import Log
-from GTG.core.task import Task
-#from GTG.core.tagstore import Tag
-from GTG.taskbrowser import GnomeConfig
-from GTG.taskbrowser import tasktree
-#from GTG.taskbrowser.preferences import PreferencesDialog
-from GTG.taskbrowser.tasktree import TaskTreeModel,\
- ActiveTaskTreeView,\
- ClosedTaskTreeView
-from GTG.taskbrowser import tagtree
-from GTG.taskbrowser.tagtree import TagTreeModel,\
- TagTreeView
-from GTG.tools import openurl
-from GTG.tools.dates import strtodate,\
- no_date,\
- FuzzyDate, \
- get_canonical_date
-#from GTG.tools import clipboard
+from GTG import _, info, ngettext
+from GTG.core.task import Task
+#from GTG.core.tagstore import Tag
+from GTG.gtk.browser import GnomeConfig, tasktree, tagtree
+#from GTG.taskbrowser.preferences import PreferencesDialog
+from GTG.gtk.browser.tasktree import TaskTreeModel,\
+ ActiveTaskTreeView,\
+ ClosedTaskTreeView
+from GTG.gtk.browser.tagtree import TagTreeModel,\
+ TagTreeView
+from GTG.tools import openurl
+from GTG.tools.dates import strtodate,\
+ no_date,\
+ FuzzyDate, \
+ get_canonical_date
+from GTG.tools.logger import Log
+#from GTG.tools import clipboard
#=== MAIN CLASS ===============================================================
@@ -71,6 +68,7 @@
CONTENTS_PREVIEW = True
TIME = 0
+
class Timer:
def __init__(self,st):
self.st = st
@@ -78,6 +76,7 @@
def __exit__(self, *args):
print "%s : %s" %(self.st,time.time() - self.start)
+
class TaskBrowser:
""" The UI for browsing open and closed tasks, and listing tags in a tree """
=== modified file 'GTG/gtk/browser/tagtree.py'
--- GTG/taskbrowser/tagtree.py 2010-05-29 15:34:05 +0000
+++ GTG/gtk/browser/tagtree.py 2010-06-02 18:29:20 +0000
@@ -16,15 +16,17 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
+import xml.sax.saxutils as saxutils
+
import gtk
import gobject
-import xml.sax.saxutils as saxutils
from GTG import _
-from GTG.taskbrowser.CellRendererTags import CellRendererTags
-from GTG.taskbrowser.tasktree import COL_OBJ as TASKTREE_COL_OBJ
+from GTG.gtk.browser.CellRendererTags import CellRendererTags
+from GTG.gtk.browser.tasktree import COL_OBJ as TASKTREE_COL_OBJ
from GTG.tools.logger import Log
-
+
+
COL_ID = 0
COL_NAME = 1
COL_LABEL = 2
@@ -35,7 +37,6 @@
class TagTreeModel(gtk.GenericTreeModel):
-
column_types = (str,\
str,\
str,\
@@ -531,3 +532,4 @@
task.sync()
self.emit_stop_by_name('drag_data_received')
+
=== modified file 'GTG/gtk/browser/tasktree.py'
--- GTG/taskbrowser/tasktree.py 2010-05-26 07:50:36 +0000
+++ GTG/gtk/browser/tasktree.py 2010-06-02 18:29:20 +0000
@@ -16,19 +16,20 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
+import xml.sax.saxutils as saxutils
import gtk
import gobject
import pango
-import xml.sax.saxutils as saxutils
from GTG import _
from GTG.core.tree import Tree, TreeNode
+from GTG.core.task import Task
+from GTG.gtk.browser.CellRendererTags import CellRendererTags
from GTG.tools import colors
-from GTG.core.task import Task
-from GTG.taskbrowser.CellRendererTags import CellRendererTags
from GTG.tools.logger import Log
+
COL_TID = 0
COL_OBJ = 1
COL_TITLE = 2
@@ -41,6 +42,7 @@
COL_SDATE = 10
COL_DUE = 11
+
#A task can have multiple parent (thus multiple paths)
#We thus define an iter which is a tuple [node,path], defining one
#and only one position in the tree
@@ -59,8 +61,8 @@
def is_valid(self):
return self.path in self.tree.get_paths_for_node(self.node)
+
class TaskTreeModel(gtk.GenericTreeModel):
-
column_types = (\
str,\
gobject.TYPE_PYOBJECT,\
=== renamed file 'GTG/viewmanager/dbuswrapper.py' => 'GTG/gtk/dbuswrapper.py'
--- GTG/viewmanager/dbuswrapper.py 2010-05-02 06:49:17 +0000
+++ GTG/gtk/dbuswrapper.py 2010-06-02 18:29:20 +0000
@@ -1,11 +1,32 @@
+# -*- coding: utf-8 -*-
+# pylint: disable-msg=W0201
+# -----------------------------------------------------------------------------
+# Getting Things Gnome! - a personal organizer for the GNOME desktop
+# Copyright (c) 2008-2009 - Lionel Dricot & Bertrand Rousseau
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 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 <http://www.gnu.org/licenses/>.
+# -----------------------------------------------------------------------------
+import unicodedata
+
import dbus
import dbus.glib
import dbus.service
-import unicodedata
-from GTG.core import CoreConfig
+from GTG.core import CoreConfig
from GTG.tools import dates
+
BUSNAME = CoreConfig.BUSNAME
BUSFACE = CoreConfig.BUSINTERFACE
=== renamed file 'GTG/viewmanager/delete_dialog.py' => 'GTG/gtk/delete_dialog.py'
--- GTG/viewmanager/delete_dialog.py 2010-02-28 13:10:00 +0000
+++ GTG/gtk/delete_dialog.py 2010-06-02 18:29:20 +0000
@@ -17,11 +17,11 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
-
import gtk
-from GTG import _
-from GTG.viewmanager import ViewConfig
+from GTG import _
+from GTG.gtk import ViewConfig
+
class DeletionUI():
def __init__(self,req):
@@ -34,7 +34,6 @@
"on_delete_cancel": lambda x: x.hide,}
self.builder.connect_signals(signals)
-
def on_delete_confirm(self, widget):
"""if we pass a tid as a parameter, we delete directly
otherwise, we will look which tid is selected"""
=== renamed file 'GTG/viewmanager/deletion.glade' => 'GTG/gtk/deletion.glade'
=== renamed directory 'GTG/taskeditor' => 'GTG/gtk/editor'
=== modified file 'GTG/gtk/editor/__init__.py'
--- GTG/taskeditor/__init__.py 2010-03-01 01:56:43 +0000
+++ GTG/gtk/editor/__init__.py 2010-06-02 18:29:20 +0000
@@ -19,10 +19,10 @@
"""
The task editing GUI
"""
-
import os
-from GTG import _
+from GTG import _
+
class GnomeConfig:
current_rep = os.path.dirname(os.path.abspath(__file__))
=== modified file 'GTG/gtk/editor/editor.py'
--- GTG/taskeditor/editor.py 2010-04-26 20:34:14 +0000
+++ GTG/gtk/editor/editor.py 2010-06-02 18:29:20 +0000
@@ -16,25 +16,16 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
+"""
+This is the TaskEditor
-#This is the TaskEditor
-#
-#It's the window you see when you double-click on a Task
-#The main text widget is a home-made TextView called TaskView (see taskview.py)
-#The rest is the logic of the widget : date changing widgets, buttons, ...
+It's the window you see when you double-click on a Task
+The main text widget is a home-made TextView called TaskView (see taskview.py)
+The rest is the logic of the widget : date changing widgets, buttons, ...
+"""
import sys
import time
-from GTG import _
-from GTG import ngettext
-from GTG import PLUGIN_DIR
-from GTG import DATA_DIR
-from GTG.taskeditor import GnomeConfig
-from GTG.tools import dates
-from GTG.taskeditor.taskview import TaskView
-from GTG.core.plugins.engine import PluginEngine
-from GTG.core.plugins.api import PluginAPI
-from GTG.core.task import Task
try:
import pygtk
pygtk.require("2.0")
@@ -45,10 +36,23 @@
from gtk import gdk
except: # pylint: disable-msg=W0702
sys.exit(1)
-
+
+from GTG import _
+from GTG import ngettext
+from GTG import PLUGIN_DIR
+from GTG import DATA_DIR
+from GTG.gtk.editor import GnomeConfig
+from GTG.gtk.editor.taskview import TaskView
+from GTG.core.plugins.engine import PluginEngine
+from GTG.core.plugins.api import PluginAPI
+from GTG.core.task import Task
+from GTG.tools import dates
+
+
date_separator = "-"
-class TaskEditor :
+
+class TaskEditor:
#req is the requester
#vmanager is the view manager
#taskconfig is a ConfigObj dic to save infos about tasks
@@ -652,5 +656,3 @@
self.cal_widget.disconnect(self.sigid_month)
self.sigid_month = None
-
-
=== modified file 'GTG/gtk/editor/taskview.py'
--- GTG/taskeditor/taskview.py 2010-04-27 03:19:16 +0000
+++ GTG/gtk/editor/taskview.py 2010-06-02 18:29:20 +0000
@@ -35,16 +35,19 @@
import gobject
import pango
-from GTG.taskeditor import taskviewserial
-from GTG.tools import openurl
+from GTG.gtk.editor import taskviewserial
+from GTG.tools import openurl
+
separators = [' ', '.', ',', '/', '\n', '\t', '!', '?', ';', '\0']
url_separators = [' ', ',', '\n', '\t', '\0']
+
bullet1_ltr = 'â'
bullet1_rtl = 'â'
bullet2 = 'â³'
+
class TaskView(gtk.TextView):
__gtype_name__ = 'HyperTextView'
__gsignals__ = {'anchor-clicked': (gobject.SIGNAL_RUN_LAST, \
@@ -1299,5 +1302,6 @@
for key, val in prop.iteritems():
tag.set_property(key, val)
+
gobject.type_register(TaskView)
=== renamed file 'GTG/viewmanager/manager.py' => 'GTG/gtk/manager.py'
--- GTG/viewmanager/manager.py 2010-05-20 09:18:47 +0000
+++ GTG/gtk/manager.py 2010-06-02 18:29:20 +0000
@@ -17,8 +17,6 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
-
-
"""
Manager loads the prefs and launches the gtk main loop
"""
@@ -26,20 +24,19 @@
import gobject
import GTG
-from GTG.viewmanager.delete_dialog import DeletionUI
-from GTG.taskbrowser.browser import TaskBrowser
-from GTG.taskeditor.editor import TaskEditor
-from GTG.viewmanager.preferences import PreferencesDialog
-from GTG.viewmanager.dbuswrapper import DBusTaskWrapper
-from GTG.tools import clipboard
-from GTG.core.plugins.engine import PluginEngine
-from GTG.core.plugins.api import PluginAPI
-from GTG.tools.logger import Log
-
-class Manager():
-
+from GTG.gtk.delete_dialog import DeletionUI
+from GTG.gtk.browser.browser import TaskBrowser
+from GTG.gtk.editor.editor import TaskEditor
+from GTG.gtk.preferences import PreferencesDialog
+from GTG.gtk.dbuswrapper import DBusTaskWrapper
+from GTG.tools import clipboard
+from GTG.core.plugins.engine import PluginEngine
+from GTG.core.plugins.api import PluginAPI
+from GTG.tools.logger import Log
+
+
+class Manager:
############## init #####################################################
-
def __init__(self, req, config):
self.config = config.conf_dict
self.task_config = config.task_conf_dict
=== renamed file 'GTG/viewmanager/preferences.glade' => 'GTG/gtk/preferences.glade'
=== renamed file 'GTG/viewmanager/preferences.py' => 'GTG/gtk/preferences.py'
--- GTG/viewmanager/preferences.py 2010-04-29 09:23:34 +0000
+++ GTG/gtk/preferences.py 2010-06-02 18:29:20 +0000
@@ -17,15 +17,15 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------------
""" The Preferences Dialog for loading plugins and configuring GTG """
-
import os
+import shutil
+
import gtk
import pango
-import shutil
from xdg.BaseDirectory import xdg_config_home
from GTG.core.plugins import GnomeConfig
-from GTG.viewmanager import ViewConfig
+from GTG.gtk import ViewConfig
__all__ = [
=== removed directory 'GTG/viewmanager'
=== modified file 'gtg'
--- gtg 2010-03-02 01:37:05 +0000
+++ gtg 2010-06-02 18:29:20 +0000
@@ -28,15 +28,16 @@
"""
import sys
-
from optparse import OptionParser
+
def X_is_running():
from subprocess import Popen, PIPE
p = Popen(["xset", "-q"], stdout=PIPE, stderr=PIPE)
p.communicate()
return p.returncode == 0
+
try:
parser = OptionParser()
parser.add_option('-d', '--debug', action='store_true', dest='debug',
=== modified file 'setup.py'
--- setup.py 2010-04-30 16:20:32 +0000
+++ setup.py 2010-06-02 18:29:20 +0000
@@ -121,9 +121,9 @@
'GTG.backends',
'GTG.core',
'GTG.core.plugins',
- 'GTG.taskbrowser',
- 'GTG.viewmanager',
- 'GTG.taskeditor',
+ 'GTG.gtk',
+ 'GTG.gtk.editor',
+ 'GTG.gtk.browser',
'GTG.tools',
'GTG.plugins',
'GTG.plugins.bugzilla',
@@ -140,10 +140,10 @@
'GTG.plugins.import_json',
],
package_data = {
- 'GTG.taskbrowser': ['taskbrowser.glade'],
- 'GTG.taskeditor': ['taskeditor.glade'],
- 'GTG.viewmanager': ['preferences.glade', 'deletion.glade'],
'GTG.core.plugins': ['pluginmanager.glade'],
+ 'GTG.gtk': ['preferences.glade', 'deletion.glade'],
+ 'GTG.gtk.browser': ['taskbrowser.glade'],
+ 'GTG.gtk.editor': ['taskeditor.glade'],
'GTG.plugins': [
'bugzilla.gtg-plugin',
'export.gtg-plugin',
Follow ups