Rev 4666: Start trying to put together a 'windows' front end in http://bazaar.launchpad.net/~jameinel/bzr/2.0.0-bzr-explorer-exe

John Arbash Meinel john at arbash-meinel.com
Thu Sep 17 13:20:01 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.0.0-bzr-explorer-exe

------------------------------------------------------------
revno: 4666
revision-id: john at arbash-meinel.com-20090917121947-u2uncmw2d1b2x3xi
parent: pqm at pqm.ubuntu.com-20090910080745-k8goiygxnjh7hlae
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.0.0-bzr-explorer-exe
timestamp: Thu 2009-09-17 07:19:47 -0500
message:
  Start trying to put together a 'windows' front end
  that won't create the dos box.
  I think it would work, but py2exe is confused about my current version
  of PyQt, which has some py3k code that can't be imported, but if
  I list it in 'excludes' then it complains that the code isn't there...
-------------- next part --------------
=== added file 'bzr_explorer'
--- a/bzr_explorer	1970-01-01 00:00:00 +0000
+++ b/bzr_explorer	2009-09-17 12:19:47 +0000
@@ -0,0 +1,28 @@
+#! /usr/bin/env python
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
+#
+# 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 2 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+"""Bazaar Explorer -- a free distributed version-control tool"""
+
+import sys
+
+from PyQt4 import QtCore, QtGui
+
+app = QtGui.QApplication(sys.argv)
+password, ok = QtGui.QInputDialog.getText(None,
+                                          "Foo to you baby",
+                                          "maybe you didn't hear my foo",
+                                          QtGui.QLineEdit.Password)

=== modified file 'setup.py'
--- a/setup.py	2009-09-03 12:10:38 +0000
+++ b/setup.py	2009-09-17 12:19:47 +0000
@@ -408,6 +408,24 @@
     # PyQt4 itself still escapes the plugin detection code for some reason...
     packages.append('PyQt4')
     excludes.append('PyQt4.elementtree.ElementTree')
+    # PyQt4.5.2 seems to have a bunch of python v3 syntax stuff. Combined with
+    # py2exe 0.6.9, it seems to try and import the code, but then dies because
+    # it isn't syntax 2.0 compatible. You have to list the individual 'uic.*'
+    # for some reason...
+    excludes.append('PyQt4.uic.port_v3') # this is v3 syntax stuff
+    excludes.append('PyQt4.uic.port_v3.ascii_upper') # this is v3 syntax stuff
+    excludes.append('PyQt4.uic.port_v3.load_plugin') # this is v3 syntax stuff
+    excludes.append('PyQt4.uic.port_v3.proxy_base') # this is v3 syntax stuff
+    excludes.append('PyQt4.uic.port_v3.encode_utf8') # this is v3 syntax stuff
+    excludes.append('PyQt4.uic.port_v3.string_io') # this is v3 syntax stuff
+    excludes.append('PyQt4.uic.port_v3.invoke') # this is v3 syntax stuff
+    # excludes.append('uic.port_v3.ascii_upper') # this is v3 syntax stuff
+    # excludes.append('uic.port_v3.load_plugin') # this is v3 syntax stuff
+    # excludes.append('uic.port_v3.proxy_base') # this is v3 syntax stuff
+    # excludes.append('uic.port_v3.encode_utf8') # this is v3 syntax stuff
+    # excludes.append('uic.port_v3.string_io') # this is v3 syntax stuff
+    # excludes.append('uic.port_v3.invoke') # this is v3 syntax stuff
+    # excludes.append('uic.port_v3') # this is v3 syntax stuff
     includes.append('sip') # extension module required for Qt.
     packages.append('pygments') # colorizer for qbzr
     packages.append('docutils') # html formatting
@@ -463,6 +481,31 @@
     packages.append('subvertpy')
 
 
+def get_explorer_py2exe_info(includes, excludes, packages, data_files,
+                             gui_targets):
+    # First off, we assume that if bzr-explorer is being packaged, that qbzr is
+    # also being packaged, so we don't repeat those dependencies.
+    bzr_explorer = dict(
+        name='Bazaar Explorer',
+        description='Bazaar Explorer',
+        # TODO: this should be a part of explorer, rather than bzrlib
+        # script='bzrlib/plugins/explorer/bzr_explorer',
+        script='bzr_explorer',
+        other_resources=[ # do we need an RT_MANIFEST ?
+        ],
+        icon_resources=[(1, icon)],
+        # dest_base = ???
+        # TODO: Mabye this should be the plugin version?
+        version=bzrlib.__version__,
+        copyright="(c) Canonical Ltd, 2005-2009",
+        company_name="Canonical Ltd.",
+        author_email="bazaar at lists.canonical.com",
+        license = "GNU GPL v2",
+        url="https://launchpad.net/bzr-explorer",
+    )
+    gui_targets.append(bzr_explorer)
+
+
 if 'bdist_wininst' in sys.argv:
     def find_docs():
         docs = []
@@ -644,6 +687,10 @@
     if 'svn' in plugins:
         get_svn_py2exe_info(includes, excludes, packages)
 
+    if 'explorer' in plugins:
+        get_explorer_py2exe_info(includes, excludes, packages, data_files,
+                                 gui_targets)
+
     if "TBZR" in os.environ:
         # TORTOISE_OVERLAYS_MSI_WIN32 must be set to the location of the
         # TortoiseOverlays MSI installer file. It is in the TSVN svn repo and



More information about the bazaar-commits mailing list