← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~danilo/launchpad/versioninfo-to-lpapp into lp:launchpad

 

Данило Шеган has proposed merging lp:~danilo/launchpad/versioninfo-to-lpapp into lp:launchpad with lp:~danilo/launchpad/bug-682186 as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


Move canonical.launchpad.versioninfo to lp.app.versioninfo.

As a follow-up branch for lp:~danilo/launchpad/bug-682186 I decided to move versioninfo to lp.app. I also considered lp.services but Gary agrees that lp.app is a better choice.

There's like a million lint errors out of this change, but I am not interested in the branch enough to want to fix them all, so if this is not considered an improvement enough, I'll probably just drop it.

To make sure nothing is broken, a full test suite will need to be run.

-- 
https://code.launchpad.net/~danilo/launchpad/versioninfo-to-lpapp/+merge/43550
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~danilo/launchpad/versioninfo-to-lpapp into lp:launchpad.
=== modified file 'lib/canonical/launchpad/__init__.py'
--- lib/canonical/launchpad/__init__.py	2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/__init__.py	2010-12-13 18:21:37 +0000
@@ -15,7 +15,3 @@
 # their own MessageFactory
 from zope.i18nmessageid import MessageFactory
 _ = MessageFactory("launchpad")
-
-# Load versioninfo.py so that we get errors on start-up rather than waiting
-# for first page load.
-import canonical.launchpad.versioninfo

=== modified file 'lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt'
--- lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt	2010-08-23 04:46:54 +0000
+++ lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt	2010-12-13 18:21:37 +0000
@@ -444,7 +444,7 @@
 
 Icing resources.
 
->>> from canonical.launchpad.versioninfo import revno
+>>> from lp.app.versioninfo import revno
 >>> check("/+icing/lazr/build/lazr.js")
 >>> check("/+icing-contrib/rev%s/JSONScriptRequest.js" % revno)
 >>> check("/+icing-contrib/rev%s/json2.js" % revno)

=== modified file 'lib/canonical/launchpad/rest/configuration.py'
--- lib/canonical/launchpad/rest/configuration.py	2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/rest/configuration.py	2010-12-13 18:21:37 +0000
@@ -12,7 +12,7 @@
 from zope.component import getUtility
 
 from canonical.config import config
-from canonical.launchpad import versioninfo
+from lp.app import versioninfo
 from canonical.launchpad.webapp.interfaces import ILaunchBag
 from canonical.launchpad.webapp.servers import (
     WebServiceClientRequest,

=== modified file 'lib/canonical/launchpad/webapp/errorlog.py'
--- lib/canonical/launchpad/webapp/errorlog.py	2010-10-14 16:43:41 +0000
+++ lib/canonical/launchpad/webapp/errorlog.py	2010-12-13 18:21:37 +0000
@@ -29,7 +29,7 @@
 from zope.traversing.namespace import view
 
 from canonical.config import config
-from canonical.launchpad import versioninfo
+from lp.app import versioninfo
 from canonical.launchpad.layers import WebServiceLayer
 from canonical.launchpad.webapp.adapter import (
     get_request_duration,

=== modified file 'lib/canonical/launchpad/webapp/tests/test_errorlog.py'
--- lib/canonical/launchpad/webapp/tests/test_errorlog.py	2010-10-26 15:47:24 +0000
+++ lib/canonical/launchpad/webapp/tests/test_errorlog.py	2010-12-13 18:21:37 +0000
@@ -30,7 +30,7 @@
 from zope.testing.loggingsupport import InstalledHandler
 
 from canonical.config import config
-from canonical.launchpad import versioninfo
+from lp.app import versioninfo
 from canonical.launchpad.layers import WebServiceLayer
 from canonical.launchpad.webapp.errorlog import (
     _is_sensitive,

=== modified file 'lib/lp/app/__init__.py'
--- lib/lp/app/__init__.py	2010-08-21 08:03:52 +0000
+++ lib/lp/app/__init__.py	2010-12-13 18:21:37 +0000
@@ -16,6 +16,8 @@
 # you want the old behavior, just like we do.
 from zope.app.form.browser import itemswidgets
 
-
 itemswidgets.EXPLICIT_EMPTY_SELECTION = False
 
+# Load versioninfo.py so that we get errors on start-up rather than waiting
+# for first page load.
+import lp.app.versioninfo

=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt	2010-11-16 18:44:52 +0000
+++ lib/lp/app/templates/base-layout-macros.pt	2010-12-13 18:21:37 +0000
@@ -39,7 +39,7 @@
 
 <metal:load-javascript define-macro="load-javascript"
   tal:define="
-      revno modules/canonical.launchpad.versioninfo/revno | string:unknown;
+      revno modules/lp.app.versioninfo/revno | string:unknown;
       icingroot string:/+icing/rev${revno};
       devmode modules/canonical.config/config/devmode;
       yui string:${icingroot}/yui;
@@ -672,7 +672,7 @@
 
 <metal:page-javascript define-macro="page-javascript"
   tal:define="
-      revno modules/canonical.launchpad.versioninfo/revno | string:unknown;
+      revno modules/lp.app.versioninfo/revno | string:unknown;
       icingroot_contrib string:/+icing-contrib/rev${revno};
       devmode modules/canonical.config/config/devmode;
       map_query string:&amp;file=api&amp;v=2&amp;key=${modules/canonical.config/config/google/maps_api_key};">
@@ -716,7 +716,7 @@
 
 <metal:launchpad-stylesheet-3-0 define-macro="launchpad-stylesheet-3-0"
   tal:define="
-    revno modules/canonical.launchpad.versioninfo/revno | string:unknown;
+    revno modules/lp.app.versioninfo/revno | string:unknown;
     icingroot string:/+icing/rev${revno}">
   <tal:comment replace="nothing">
     This macro loads a single css file containing all our stylesheets.

=== modified file 'lib/lp/app/templates/base-layout.pt'
--- lib/lp/app/templates/base-layout.pt	2010-11-30 12:53:20 +0000
+++ lib/lp/app/templates/base-layout.pt	2010-12-13 18:21:37 +0000
@@ -3,8 +3,8 @@
   xmlns:tal="http://xml.zope.org/namespaces/tal";
   define-macro="master"
   tal:define="
-    revno modules/canonical.launchpad.versioninfo/revno | string:unknown;
-    release modules/canonical.launchpad.versioninfo/release;
+    revno modules/lp.app.versioninfo/revno | string:unknown;
+    release modules/lp.app.versioninfo/release;
     version string:Launchpad ${release} (r${revno});
     devmode modules/canonical.config/config/devmode;
     rooturl modules/canonical.launchpad.webapp.vhosts/allvhosts/configs/mainsite/rooturl;

=== renamed file 'lib/canonical/launchpad/tests/test_versioninfo.py' => 'lib/lp/app/tests/test_versioninfo.py'
--- lib/canonical/launchpad/tests/test_versioninfo.py	2010-12-13 18:21:37 +0000
+++ lib/lp/app/tests/test_versioninfo.py	2010-12-13 18:21:37 +0000
@@ -8,7 +8,7 @@
 import unittest
 
 from canonical.config import TREE_ROOT
-from canonical.launchpad.versioninfo import revno
+from lp.app.versioninfo import revno
 
 
 class TestVersionInfo(unittest.TestCase):
@@ -17,7 +17,7 @@
         # Our cronscripts are executed with cwd != LP root.
         # Getting version info should still work in them.
         args = [os.path.join(TREE_ROOT, "bin/py"), "-c",
-                "from canonical.launchpad.versioninfo import revno;"
+                "from lp.app.versioninfo import revno;"
                 "print revno"]
         process = subprocess.Popen(args, cwd='/tmp', stdout=subprocess.PIPE)
         (output, errors) = process.communicate(None)

=== renamed file 'lib/canonical/launchpad/versioninfo.py' => 'lib/lp/app/versioninfo.py'
=== modified file 'lib/lp/services/mail/sendmail.py'
--- lib/lp/services/mail/sendmail.py	2010-10-20 01:23:52 +0000
+++ lib/lp/services/mail/sendmail.py	2010-12-13 18:21:37 +0000
@@ -49,7 +49,7 @@
 from zope.sendmail.interfaces import IMailDelivery
 
 from canonical.config import config
-from canonical.launchpad import versioninfo
+from lp.app import versioninfo
 from canonical.launchpad.helpers import is_ascii_only
 from canonical.lp import isZopeless
 from lp.services.mail.stub import TestMailer

=== modified file 'lib/lp/services/memcache/tales.py'
--- lib/lp/services/memcache/tales.py	2010-11-02 07:47:55 +0000
+++ lib/lp/services/memcache/tales.py	2010-12-13 18:21:37 +0000
@@ -29,7 +29,7 @@
 
 from canonical.base import base
 from canonical.config import config
-from canonical.launchpad import versioninfo
+from lp.app import versioninfo
 from canonical.launchpad.webapp.interfaces import ILaunchBag
 from lp.services.memcache.interfaces import IMemcacheClient
 

=== modified file 'lib/lp/shipit.py'
--- lib/lp/shipit.py	2010-11-23 23:22:27 +0000
+++ lib/lp/shipit.py	2010-12-13 18:21:37 +0000
@@ -1,4 +1,4 @@
-from canonical.launchpad import (
+from lp.app import (
     _,
     versioninfo,
     )
@@ -49,7 +49,7 @@
     tearDown as sd_tearDown,
     )
 from canonical.launchpad.validators import LaunchpadValidationError
-from canonical.launchpad.versioninfo import revno
+from lp.app.versioninfo import revno
 from canonical.launchpad.webapp import (
     canonical_url,
     Navigation,

=== modified file 'lib/lp/translations/utilities/gettext_po_parser.py'
--- lib/lp/translations/utilities/gettext_po_parser.py	2010-08-20 20:31:18 +0000
+++ lib/lp/translations/utilities/gettext_po_parser.py	2010-12-13 18:21:37 +0000
@@ -26,7 +26,7 @@
 from zope import datetime as zope_datetime
 from zope.interface import implements
 
-from canonical.launchpad.versioninfo import revno
+from lp.app.versioninfo import revno
 from lp.translations.interfaces.translationcommonformat import (
     ITranslationHeaderData,
     )