From e2fc155240fb3427308aca79aa36190fbd8eebbe Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Thu, 31 May 2012 15:22:03 +0000 Subject: [PATCH] GEPS008: Re-structure GUI logger files svn: r19726 --- configure.in | 2 +- src/DisplayState.py | 2 +- src/Makefile.am | 1 - src/gui/Makefile.am | 1 + src/gui/__init__.py | 3 ++- src/gui/grampsgui.py | 2 +- src/{GrampsLogger => gui/logger}/Makefile.am | 14 +++++++------- src/{GrampsLogger => gui/logger}/__init__.py | 7 +++---- .../logger/_errorreportassistant.py} | 1 - .../_ErrorView.py => gui/logger/_errorview.py} | 3 +-- .../_GtkHandler.py => gui/logger/_gtkhandler.py} | 3 +-- .../logger/_rotatehandler.py} | 1 - src/guiQML/grampsqml.py | 2 +- 13 files changed, 19 insertions(+), 23 deletions(-) rename src/{GrampsLogger => gui/logger}/Makefile.am (68%) rename src/{GrampsLogger => gui/logger}/__init__.py (92%) rename src/{GrampsLogger/_ErrorReportAssistant.py => gui/logger/_errorreportassistant.py} (99%) rename src/{GrampsLogger/_ErrorView.py => gui/logger/_errorview.py} (98%) rename src/{GrampsLogger/_GtkHandler.py => gui/logger/_gtkhandler.py} (96%) rename src/{GrampsLogger/_RotateHandler.py => gui/logger/_rotatehandler.py} (98%) diff --git a/configure.in b/configure.in index dcd277923..b583c59b1 100644 --- a/configure.in +++ b/configure.in @@ -125,6 +125,7 @@ src/gui/editors/displaytabs/Makefile src/gui/filters/Makefile src/gui/filters/sidebar/Makefile src/gui/glade/Makefile +src/gui/logger/Makefile src/gui/merge/Makefile src/gui/plug/Makefile src/gui/plug/report/Makefile @@ -132,7 +133,6 @@ src/gui/selectors/Makefile src/gui/views/Makefile src/gui/views/treemodels/Makefile src/gui/widgets/Makefile -src/GrampsLogger/Makefile src/docgen/Makefile src/Simple/Makefile src/GrampsLocale/Makefile diff --git a/src/DisplayState.py b/src/DisplayState.py index cdf7b4988..323b22381 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -305,7 +305,7 @@ def by_time(first, second): return cmp(second.get_time(), first.get_time()) -from GrampsLogger import RotateHandler +from gui.logger import RotateHandler class WarnHandler(RotateHandler): diff --git a/src/Makefile.am b/src/Makefile.am index 3cdaaf580..7a91f92a6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,6 @@ SUBDIRS = \ docgen \ gen \ GrampsLocale \ - GrampsLogger \ gui \ images \ plugins \ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 8c04e81e7..d5723d7af 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -8,6 +8,7 @@ SUBDIRS = \ editors \ filters \ glade \ + logger \ merge \ plug \ selectors \ diff --git a/src/gui/__init__.py b/src/gui/__init__.py index 5dc420914..d57dbac86 100644 --- a/src/gui/__init__.py +++ b/src/gui/__init__.py @@ -26,4 +26,5 @@ Package init for the gui package. # DO NOT IMPORT METHODS/CLASSES FROM src/gui HERE ! Only __all__ -__all__ = [ "editors", "filters", "merge", "selectors", "views", "widgets" ] +__all__ = [ "editors", "filters", "logger", "merge", "selectors", "views", + "widgets" ] diff --git a/src/gui/grampsgui.py b/src/gui/grampsgui.py index 470a21876..0bdac46b1 100644 --- a/src/gui/grampsgui.py +++ b/src/gui/grampsgui.py @@ -269,7 +269,7 @@ def __startgramps(errors, argparser): sys.exit(1) # add gui logger - from GrampsLogger import RotateHandler, GtkHandler + from gui.logger import RotateHandler, GtkHandler form = logging.Formatter(fmt="%(relativeCreated)d: %(levelname)s: " "%(filename)s: line %(lineno)d: %(message)s") # Create the log handlers diff --git a/src/GrampsLogger/Makefile.am b/src/gui/logger/Makefile.am similarity index 68% rename from src/GrampsLogger/Makefile.am rename to src/gui/logger/Makefile.am index 87fca987b..4d7884fc0 100644 --- a/src/GrampsLogger/Makefile.am +++ b/src/gui/logger/Makefile.am @@ -5,19 +5,19 @@ # If not using GNU make, then list all .py files individually pkgpython_PYTHON = \ - _ErrorReportAssistant.py\ - _ErrorView.py\ - _GtkHandler.py\ + _errorreportassistant.py\ + _errorview.py\ + _gtkhandler.py\ __init__.py\ - _RotateHandler.py + _rotatehandler.py -pkgpyexecdir = @pkgpyexecdir@/GrampsLogger -pkgpythondir = $(datadir)/@PACKAGE@/GrampsLogger +pkgpyexecdir = @pkgpyexecdir@/gui/logger +pkgpythondir = $(datadir)/@PACKAGE@/gui/logger # Clean up all the byte-compiled files MOSTLYCLEANFILES = *pyc *pyo -GRAMPS_PY_MODPATH = "../" +GRAMPS_PY_MODPATH = "../../" pycheck: (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ diff --git a/src/GrampsLogger/__init__.py b/src/gui/logger/__init__.py similarity index 92% rename from src/GrampsLogger/__init__.py rename to src/gui/logger/__init__.py index e2750dd93..2165debb7 100644 --- a/src/GrampsLogger/__init__.py +++ b/src/gui/logger/__init__.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# GrampsLogger/__init__.py # $Id$ """ @@ -41,7 +40,7 @@ Usage: Simple example: - from GrampsLogger import GtkHandler, RotateHandler + from gui.logger import GtkHandler, RotateHandler rh = RotateHandler(capacity=20) rh.setLevel(logging.DEBUG) @@ -65,5 +64,5 @@ Usage: """ -from _GtkHandler import GtkHandler -from _RotateHandler import RotateHandler +from _gtkhandler import GtkHandler +from _rotatehandler import RotateHandler diff --git a/src/GrampsLogger/_ErrorReportAssistant.py b/src/gui/logger/_errorreportassistant.py similarity index 99% rename from src/GrampsLogger/_ErrorReportAssistant.py rename to src/gui/logger/_errorreportassistant.py index 00cb4ea2a..1fbb3d0b9 100644 --- a/src/GrampsLogger/_ErrorReportAssistant.py +++ b/src/gui/logger/_errorreportassistant.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# GrampsLogger/_ErrorReportAssistant.py # $Id$ from gen.ggettext import gettext as _ diff --git a/src/GrampsLogger/_ErrorView.py b/src/gui/logger/_errorview.py similarity index 98% rename from src/GrampsLogger/_ErrorView.py rename to src/gui/logger/_errorview.py index 1accc503e..4801a27a3 100644 --- a/src/GrampsLogger/_ErrorView.py +++ b/src/gui/logger/_errorview.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# GrampsLogger/_ErrorView.py # $Id$ #------------------------------------------------------------------------- @@ -35,7 +34,7 @@ import gtk #------------------------------------------------------------------------- import const from gen.ggettext import sgettext as _ -from _ErrorReportAssistant import ErrorReportAssistant +from _errorreportassistant import ErrorReportAssistant import GrampsDisplay #------------------------------------------------------------------------- diff --git a/src/GrampsLogger/_GtkHandler.py b/src/gui/logger/_gtkhandler.py similarity index 96% rename from src/GrampsLogger/_GtkHandler.py rename to src/gui/logger/_gtkhandler.py index 0ca9ce366..e2336d4f5 100644 --- a/src/GrampsLogger/_GtkHandler.py +++ b/src/gui/logger/_gtkhandler.py @@ -18,13 +18,12 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# GrampsLogger/_GtkHandler.py # $Id$ import logging -from _ErrorView import ErrorView +from _errorview import ErrorView class GtkHandler(logging.Handler): diff --git a/src/GrampsLogger/_RotateHandler.py b/src/gui/logger/_rotatehandler.py similarity index 98% rename from src/GrampsLogger/_RotateHandler.py rename to src/gui/logger/_rotatehandler.py index 0bfaf0f76..7eeabfcde 100644 --- a/src/GrampsLogger/_RotateHandler.py +++ b/src/gui/logger/_rotatehandler.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# GrampsLogger/_RotateHandler.py # $Id$ import logging diff --git a/src/guiQML/grampsqml.py b/src/guiQML/grampsqml.py index 089c1d63b..d8e866fa5 100644 --- a/src/guiQML/grampsqml.py +++ b/src/guiQML/grampsqml.py @@ -116,7 +116,7 @@ def startqml(errors, argparser): sys.exit() # add gui logger - from GrampsLogger import RotateHandler + from gui.logger import RotateHandler form = logging.Formatter(fmt="%(relativeCreated)d: %(levelname)s: " "%(filename)s: line %(lineno)d: %(message)s") # Create the log handlers