[meld] Move source into meld package, and split out ui and util subpackages
- From: Kai Willadsen <kaiw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [meld] Move source into meld package, and split out ui and util subpackages
- Date: Sun, 13 Sep 2009 07:43:26 +0000 (UTC)
commit 8086560032dc1fce3c66ca19616b8afe3014eb59
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Aug 19 13:43:24 2009 +1000
Move source into meld package, and split out ui and util subpackages
GNUmakefile | 27 ++++++++++++++++---------
bin/meld | 12 +++++-----
data/ui/dirdiff.glade | 6 ++--
data/ui/filediff.glade | 14 ++++++------
data/ui/meldapp.glade | 14 ++++++------
data/ui/vcview.glade | 4 +-
diffutil.py => meld/diffutil.py | 0
dirdiff.py => meld/dirdiff.py | 2 +-
filediff.py => meld/filediff.py | 6 ++--
meldapp.py => meld/meldapp.py | 8 +++---
melddoc.py => meld/melddoc.py | 0
misc.py => meld/misc.py | 0
paths.py => meld/paths.py | 2 +-
task.py => meld/task.py | 0
tree.py => meld/tree.py | 2 +-
findbar.py => meld/ui/findbar.py | 4 +-
gnomeglade.py => meld/ui/gnomeglade.py | 0
historyentry.py => meld/ui/historyentry.py | 0
msgarea.py => meld/ui/msgarea.py | 0
notebooklabel.py => meld/ui/notebooklabel.py | 0
undo.py => meld/undo.py | 0
prefs.py => meld/util/prefs.py | 0
sourceviewer.py => meld/util/sourceviewer.py | 0
{vc => meld/vc}/COPYING | 0
{vc => meld/vc}/README | 0
{vc => meld/vc}/__init__.py | 2 +-
{vc => meld/vc}/_null.py | 0
{vc => meld/vc}/_vc.py | 0
{vc => meld/vc}/bzr.py | 0
{vc => meld/vc}/cdv.py | 0
{vc => meld/vc}/cvs.py | 2 +-
{vc => meld/vc}/darcs.py | 0
{vc => meld/vc}/git.py | 0
{vc => meld/vc}/mercurial.py | 0
{vc => meld/vc}/monotone.py | 0
{vc => meld/vc}/rcs.py | 0
{vc => meld/vc}/svk.py | 2 +-
{vc => meld/vc}/svn.py | 0
{vc => meld/vc}/tla.py | 0
vcview.py => meld/vcview.py | 2 +-
40 files changed, 58 insertions(+), 51 deletions(-)
---
diff --git a/GNUmakefile b/GNUmakefile
index 28c6af4..3236fce 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -5,12 +5,12 @@
include INSTALL
#
-VERSION := $(shell grep "^version" meldapp.py | cut -d \" -f 2)
+VERSION := $(shell grep "^version" meld/meldapp.py | cut -d \" -f 2)
RELEASE := meld-$(VERSION)
MELD_CMD := ./meld #--profile
TESTNUM := 1
DEVELOPER := 0
-SPECIALS := bin/meld paths.py
+SPECIALS := bin/meld meld/paths.py
BROWSER := firefox
ifeq ($(DEVELOPER), 1)
@@ -29,7 +29,7 @@ all: $(addsuffix .install,$(SPECIALS)) meld.desktop
.PHONY:clean
clean:
- -rm -f *.pyc vc/*.pyc *.install data/meld.desktop *.bak data/ui/*.bak
+ -rm -f meld/*.pyc meld/ui/*.pyc meld/util/*.pyc meld/vc/*.pyc *.install data/meld.desktop *.bak data/ui/*.bak
$(MAKE) -C po clean
$(MAKE) -C help clean
@@ -38,7 +38,10 @@ install: $(addsuffix .install,$(SPECIALS)) meld.desktop
mkdir -m 755 -p \
$(DESTDIR)$(bindir) \
$(DESTDIR)$(libdir_) \
- $(DESTDIR)$(libdir_)/vc \
+ $(DESTDIR)$(libdir_)/meld \
+ $(DESTDIR)$(libdir_)/meld/ui \
+ $(DESTDIR)$(libdir_)/meld/util \
+ $(DESTDIR)$(libdir_)/meld/vc \
$(DESTDIR)$(sharedir_)/ui \
$(DESTDIR)$(sharedir_)/icons \
$(DESTDIR)$(docdir_) \
@@ -47,12 +50,16 @@ install: $(addsuffix .install,$(SPECIALS)) meld.desktop
$(DESTDIR)$(helpdir_)
install -m 755 bin/meld.install \
$(DESTDIR)$(bindir)/meld
- install -m 644 *.py \
- $(DESTDIR)$(libdir_)
- install -m 644 vc/*.py \
- $(DESTDIR)$(libdir_)/vc
- install -m 644 paths.py.install \
- $(DESTDIR)$(libdir_)/paths.py
+ install -m 644 meld/*.py \
+ $(DESTDIR)$(libdir_)/meld
+ install -m 644 meld/ui/*.py \
+ $(DESTDIR)$(libdir_)/meld/ui
+ install -m 644 meld/util/*.py \
+ $(DESTDIR)$(libdir_)/meld/util
+ install -m 644 meld/vc/*.py \
+ $(DESTDIR)$(libdir_)/meld/vc
+ install -m 644 meld/paths.py.install \
+ $(DESTDIR)$(libdir_)/meld/paths.py
install -m 644 data/meld.desktop \
$(DESTDIR)$(sharedir)/applications
$(PYTHON) -c 'import compileall; compileall.compile_dir("$(DESTDIR)$(libdir_)",10,"$(libdir_)")'
diff --git a/bin/meld b/bin/meld
index 2339b2c..129660c 100755
--- a/bin/meld
+++ b/bin/meld
@@ -38,11 +38,11 @@ else:
# i18n support
-import paths
+import meld.paths
import gettext
_ = gettext.gettext
-gettext.bindtextdomain("meld", paths.locale_dir())
+gettext.bindtextdomain("meld", meld.paths.locale_dir())
gettext.textdomain("meld")
# Check requirements: Python 2.4, pygtk 2.8
@@ -86,13 +86,13 @@ if gtk.pygtk_version < pygtkver:
# import warnings
# warnings.filterwarnings("ignore", category=DeprecationWarning)
-gtk.glade.bindtextdomain("meld", paths.locale_dir())
+gtk.glade.bindtextdomain("meld", meld.paths.locale_dir())
gtk.glade.textdomain("meld")
#
# main
#
-import meldapp
+import meld.meldapp
for ignore in "--sm-config-prefix", "--sm-client-id":
try: # ignore session management
smprefix = sys.argv.index(ignore)
@@ -104,7 +104,7 @@ try: # don't pass on the profiling flag
minusp = sys.argv.index("--profile")
del sys.argv[minusp]
import profile
- profile.run("meldapp.main()")
+ profile.run("meld.meldapp.main()")
except ValueError:
- meldapp.main()
+ meld.meldapp.main()
sys.exit(0)
diff --git a/data/ui/dirdiff.glade b/data/ui/dirdiff.glade
index 0327c40..09a7337 100644
--- a/data/ui/dirdiff.glade
+++ b/data/ui/dirdiff.glade
@@ -111,7 +111,7 @@
<child>
<widget class="Custom" id="fileentry0">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">direntry</property>
<property name="int1">1</property>
<signal name="activate" handler="on_fileentry_activate"/>
@@ -128,7 +128,7 @@
<child>
<widget class="Custom" id="fileentry1">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">direntry</property>
<property name="int1">1</property>
<signal name="activate" handler="on_fileentry_activate"/>
@@ -145,7 +145,7 @@
<child>
<widget class="Custom" id="fileentry2">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">direntry</property>
<property name="int1">1</property>
<signal name="activate" handler="on_fileentry_activate"/>
diff --git a/data/ui/filediff.glade b/data/ui/filediff.glade
index 78b0e6e..a156e79 100644
--- a/data/ui/filediff.glade
+++ b/data/ui/filediff.glade
@@ -20,7 +20,7 @@
<child>
<widget class="Custom" id="fileentry2">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">fileentry</property>
<signal name="activate" handler="on_fileentry_activate"/>
</widget>
@@ -34,7 +34,7 @@
<child>
<widget class="Custom" id="fileentry1">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">fileentry</property>
<signal name="activate" handler="on_fileentry_activate"/>
</widget>
@@ -48,7 +48,7 @@
<child>
<widget class="Custom" id="fileentry0">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">fileentry</property>
<signal name="activate" handler="on_fileentry_activate"/>
</widget>
@@ -253,7 +253,7 @@
<child>
<widget class="Custom" id="msgarea_mgr0">
<property name="visible">True</property>
- <property name="creation_function">msgarea.msgarea_mgr_create</property>
+ <property name="creation_function">meld.ui.msgarea.msgarea_mgr_create</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -266,7 +266,7 @@
<child>
<widget class="Custom" id="msgarea_mgr1">
<property name="visible">True</property>
- <property name="creation_function">msgarea.msgarea_mgr_create</property>
+ <property name="creation_function">meld.ui.msgarea.msgarea_mgr_create</property>
</widget>
<packing>
<property name="left_attach">3</property>
@@ -279,7 +279,7 @@
<child>
<widget class="Custom" id="msgarea_mgr2">
<property name="visible">True</property>
- <property name="creation_function">msgarea.msgarea_mgr_create</property>
+ <property name="creation_function">meld.ui.msgarea.msgarea_mgr_create</property>
</widget>
<packing>
<property name="left_attach">5</property>
@@ -310,7 +310,7 @@
<widget class="Custom" id="findbar">
<property name="height_request">12</property>
<property name="visible">True</property>
- <property name="creation_function">findbar.findbar_create</property>
+ <property name="creation_function">meld.ui.findbar.findbar_create</property>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/data/ui/meldapp.glade b/data/ui/meldapp.glade
index 73731d9..4f933b5 100644
--- a/data/ui/meldapp.glade
+++ b/data/ui/meldapp.glade
@@ -143,7 +143,7 @@ Adam Weinberger (en_CA)</property>
<child>
<widget class="Custom" id="fileentry2">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">file_comparison</property>
<property name="string2">My File</property>
<signal name="activate" handler="on_entry_activate"/>
@@ -159,7 +159,7 @@ Adam Weinberger (en_CA)</property>
<child>
<widget class="Custom" id="fileentry1">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">file_comparison</property>
<property name="string2">Original File</property>
<signal name="activate" handler="on_entry_activate"/>
@@ -176,7 +176,7 @@ Adam Weinberger (en_CA)</property>
<widget class="Custom" id="fileentry0">
<property name="visible">True</property>
<property name="sensitive">False</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">file_comparison</property>
<property name="string2">Other File</property>
<signal name="activate" handler="on_entry_activate"/>
@@ -281,7 +281,7 @@ Adam Weinberger (en_CA)</property>
<child>
<widget class="Custom" id="direntry2">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">dir_comparison</property>
<property name="string2">My Directory</property>
<property name="int1">1</property>
@@ -298,7 +298,7 @@ Adam Weinberger (en_CA)</property>
<child>
<widget class="Custom" id="direntry1">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">dir_comparison</property>
<property name="string2">Original Directory</property>
<property name="int1">1</property>
@@ -316,7 +316,7 @@ Adam Weinberger (en_CA)</property>
<widget class="Custom" id="direntry0">
<property name="visible">True</property>
<property name="sensitive">False</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">dir_comparison</property>
<property name="string2">Other Directory</property>
<property name="int1">1</property>
@@ -405,7 +405,7 @@ Adam Weinberger (en_CA)</property>
<child>
<widget class="Custom" id="vcentry0">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">vc_directory</property>
<property name="string2">VC Directory</property>
<property name="int1">1</property>
diff --git a/data/ui/vcview.glade b/data/ui/vcview.glade
index e1c8dc9..b07567a 100644
--- a/data/ui/vcview.glade
+++ b/data/ui/vcview.glade
@@ -33,7 +33,7 @@
<child>
<widget class="Custom" id="fileentry">
<property name="visible">True</property>
- <property name="creation_function">historyentry.create_fileentry</property>
+ <property name="creation_function">meld.ui.historyentry.create_fileentry</property>
<property name="string1">direntry</property>
<property name="int1">1</property>
<signal name="activate" handler="on_fileentry_activate"/>
@@ -452,7 +452,7 @@
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="string1">previousentry</property>
- <property name="creation_function">historyentry.create_entry</property>
+ <property name="creation_function">meld.ui.historyentry.create_entry</property>
<signal name="changed" handler="on_previousentry_activate"/>
</widget>
<packing>
diff --git a/meld/__init__.py b/meld/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/diffutil.py b/meld/diffutil.py
similarity index 100%
rename from diffutil.py
rename to meld/diffutil.py
diff --git a/dirdiff.py b/meld/dirdiff.py
similarity index 99%
rename from dirdiff.py
rename to meld/dirdiff.py
index 00d4d5f..092e8ad 100644
--- a/dirdiff.py
+++ b/meld/dirdiff.py
@@ -15,7 +15,7 @@
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import paths
-import gnomeglade
+from ui import gnomeglade
import gobject
import gtk
import gtk.keysyms
diff --git a/filediff.py b/meld/filediff.py
similarity index 99%
rename from filediff.py
rename to meld/filediff.py
index 1adb849..dbed731 100644
--- a/filediff.py
+++ b/meld/filediff.py
@@ -28,14 +28,14 @@ import gtk
import gtk.keysyms
import diffutil
-import gnomeglade
+from ui import gnomeglade
import misc
import melddoc
-import msgarea
+from ui import msgarea
import paths
import cairo
-from sourceviewer import srcviewer
+from util.sourceviewer import srcviewer
gdk = gtk.gdk
diff --git a/meldapp.py b/meld/meldapp.py
similarity index 99%
rename from meldapp.py
rename to meld/meldapp.py
index 3e760cb..17992ac 100644
--- a/meldapp.py
+++ b/meld/meldapp.py
@@ -35,17 +35,17 @@ except ImportError:
# project
import paths
-import prefs
-import gnomeglade
+from util import prefs
+from ui import gnomeglade
import misc
-import notebooklabel
+from ui import notebooklabel
import filediff
import vcview
import dirdiff
import task
import vc
-from sourceviewer import srcviewer
+from util.sourceviewer import srcviewer
version = "1.3.1"
diff --git a/melddoc.py b/meld/melddoc.py
similarity index 100%
rename from melddoc.py
rename to meld/melddoc.py
diff --git a/misc.py b/meld/misc.py
similarity index 100%
rename from misc.py
rename to meld/misc.py
diff --git a/paths.py b/meld/paths.py
similarity index 96%
rename from paths.py
rename to meld/paths.py
index 278cb5a..ab20ca3 100644
--- a/paths.py
+++ b/meld/paths.py
@@ -23,7 +23,7 @@ _help_dir = ( #HELPDIR#
_share_dir = ( #SHAREDIR#
)
-appdir = os.path.dirname(__file__)
+appdir = os.path.dirname(os.path.dirname(__file__))
if not _locale_dir: _locale_dir = os.path.join(appdir,"po")
if not _help_dir: _help_dir = os.path.join(appdir,"help")
diff --git a/task.py b/meld/task.py
similarity index 100%
rename from task.py
rename to meld/task.py
diff --git a/tree.py b/meld/tree.py
similarity index 99%
rename from tree.py
rename to meld/tree.py
index 7c36dbf..3b58927 100644
--- a/tree.py
+++ b/meld/tree.py
@@ -17,7 +17,7 @@
import os
import gobject
import gtk
-import gnomeglade
+from ui import gnomeglade
import paths
COL_PATH, COL_STATE, COL_TEXT, COL_ICON, COL_END = range(5)
diff --git a/meld/ui/__init__.py b/meld/ui/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/findbar.py b/meld/ui/findbar.py
similarity index 99%
rename from findbar.py
rename to meld/ui/findbar.py
index f425684..d6a324f 100644
--- a/findbar.py
+++ b/meld/ui/findbar.py
@@ -15,8 +15,8 @@
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import gnomeglade
-import paths
-import misc
+from meld import paths
+from meld import misc
import gtk
import re
from gettext import gettext as _
diff --git a/gnomeglade.py b/meld/ui/gnomeglade.py
similarity index 100%
rename from gnomeglade.py
rename to meld/ui/gnomeglade.py
diff --git a/historyentry.py b/meld/ui/historyentry.py
similarity index 100%
rename from historyentry.py
rename to meld/ui/historyentry.py
diff --git a/msgarea.py b/meld/ui/msgarea.py
similarity index 100%
rename from msgarea.py
rename to meld/ui/msgarea.py
diff --git a/notebooklabel.py b/meld/ui/notebooklabel.py
similarity index 100%
rename from notebooklabel.py
rename to meld/ui/notebooklabel.py
diff --git a/undo.py b/meld/undo.py
similarity index 100%
rename from undo.py
rename to meld/undo.py
diff --git a/meld/util/__init__.py b/meld/util/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/prefs.py b/meld/util/prefs.py
similarity index 100%
rename from prefs.py
rename to meld/util/prefs.py
diff --git a/sourceviewer.py b/meld/util/sourceviewer.py
similarity index 100%
rename from sourceviewer.py
rename to meld/util/sourceviewer.py
diff --git a/vc/COPYING b/meld/vc/COPYING
similarity index 100%
rename from vc/COPYING
rename to meld/vc/COPYING
diff --git a/vc/README b/meld/vc/README
similarity index 100%
rename from vc/README
rename to meld/vc/README
diff --git a/vc/__init__.py b/meld/vc/__init__.py
similarity index 97%
rename from vc/__init__.py
rename to meld/vc/__init__.py
index 3b39f25..ce2896a 100644
--- a/vc/__init__.py
+++ b/meld/vc/__init__.py
@@ -29,7 +29,7 @@ def load_plugins():
_vcdir = os.path.dirname(os.path.abspath(__file__))
ret = []
for plugin in glob.glob(os.path.join(_vcdir, "[a-z]*.py")):
- modname = "vc.%s" % os.path.basename(os.path.splitext(plugin)[0])
+ modname = "meld.vc.%s" % os.path.basename(os.path.splitext(plugin)[0])
ret.append( __import__(modname, globals(), locals(), "*") )
return ret
_plugins = load_plugins()
diff --git a/vc/_null.py b/meld/vc/_null.py
similarity index 100%
rename from vc/_null.py
rename to meld/vc/_null.py
diff --git a/vc/_vc.py b/meld/vc/_vc.py
similarity index 100%
rename from vc/_vc.py
rename to meld/vc/_vc.py
diff --git a/vc/bzr.py b/meld/vc/bzr.py
similarity index 100%
rename from vc/bzr.py
rename to meld/vc/bzr.py
diff --git a/vc/cdv.py b/meld/vc/cdv.py
similarity index 100%
rename from vc/cdv.py
rename to meld/vc/cdv.py
diff --git a/vc/cvs.py b/meld/vc/cvs.py
similarity index 99%
rename from vc/cvs.py
rename to meld/vc/cvs.py
index cab2fe6..010fce1 100644
--- a/vc/cvs.py
+++ b/meld/vc/cvs.py
@@ -25,7 +25,7 @@ import os
from gettext import gettext as _
import re
import time
-import misc
+from meld import misc
import _vc
class Vc(_vc.Vc):
diff --git a/vc/darcs.py b/meld/vc/darcs.py
similarity index 100%
rename from vc/darcs.py
rename to meld/vc/darcs.py
diff --git a/vc/git.py b/meld/vc/git.py
similarity index 100%
rename from vc/git.py
rename to meld/vc/git.py
diff --git a/vc/mercurial.py b/meld/vc/mercurial.py
similarity index 100%
rename from vc/mercurial.py
rename to meld/vc/mercurial.py
diff --git a/vc/monotone.py b/meld/vc/monotone.py
similarity index 100%
rename from vc/monotone.py
rename to meld/vc/monotone.py
diff --git a/vc/rcs.py b/meld/vc/rcs.py
similarity index 100%
rename from vc/rcs.py
rename to meld/vc/rcs.py
diff --git a/vc/svk.py b/meld/vc/svk.py
similarity index 99%
rename from vc/svk.py
rename to meld/vc/svk.py
index a62b057..435cc88 100644
--- a/vc/svk.py
+++ b/meld/vc/svk.py
@@ -21,7 +21,7 @@
### (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
### THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import misc
+from meld import misc
import svn
class Vc(svn.Vc):
diff --git a/vc/svn.py b/meld/vc/svn.py
similarity index 100%
rename from vc/svn.py
rename to meld/vc/svn.py
diff --git a/vc/tla.py b/meld/vc/tla.py
similarity index 100%
rename from vc/tla.py
rename to meld/vc/tla.py
diff --git a/vcview.py b/meld/vcview.py
similarity index 99%
rename from vcview.py
rename to meld/vcview.py
index 87247f8..0b05afa 100644
--- a/vcview.py
+++ b/meld/vcview.py
@@ -22,7 +22,7 @@ from gettext import gettext as _
import tree
import misc
-import gnomeglade
+from ui import gnomeglade
import melddoc
import paths
import vc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]