launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #01226
[Merge] lp:~sinzui/launchpad/logged-link-0 into lp:launchpad/devel
Curtis Hovey has proposed merging lp:~sinzui/launchpad/logged-link-0 into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#622326 Logged in user should link to the main stie
https://bugs.launchpad.net/bugs/622326
#647526 move tales to lp.app
https://bugs.launchpad.net/bugs/647526
This is my branch to fix the "logged in as" link and move tales to lp.app.
lp:~sinzui/launchpad/logged-link-0
Diff size: 1434 (900 zcml lines moved)
Launchpad bug:
https://bugs.launchpad.net/bugs/622326
https://bugs.launchpad.net/bugs/647526
Test command: ./bin/test -vv \
-t test_root -t pillar-views -t menu.txt -t lp.app.*doc/tales \
-t test_tales -t displaying-dates
Pre-implementation: no one
Target release: 10.10
Fix the "logged in as" link and move tales to lp.app
----------------------------------------------------
On every Launchpad page, on the top-right corner there's a link to your
account (/people/+me). A few days ago that link was pointing always to
launchpad.net. Now it points to the domain that you are currently
using, so for example if you are viewing a bug and click on the link,
bugs.launchpad.net/~lp-id is opened. This is wrong
The tales module and belongs in the lp.app package. Many class in the module
belong in other apps, but they can be moved in a second step.
Rules
-----
* Update the namelink method to pass mainsite so that the rule that
person links go to profile pages is honoured.
* Use the utilities/migrater/rename_module to move tale.py
* Moved the tales tests using bzr mv
QA
--
* Visit a bug or branch on edge.
* Follow your logged in as link.
* Verify you are seeing you profile page.
Lint
----
Linting changed files:
lib/canonical/launchpad/browser/launchpad.py
lib/canonical/launchpad/browser/vocabulary.py
lib/canonical/launchpad/browser/widgets.py
lib/canonical/launchpad/doc/displaying-dates.txt
lib/canonical/launchpad/webapp/configure.zcml
lib/canonical/launchpad/webapp/tests/test_tales.py
lib/canonical/lazr/doc/menus.txt
lib/canonical/lazr/testing/menus.py
lib/canonical/widgets/bugtask.py
lib/canonical/widgets/location.py
lib/lp/app/browser/configure.zcml
lib/lp/app/browser/stringformatter.py
lib/lp/app/browser/tales.py
lib/lp/app/doc/tales.txt
lib/lp/app/tests/test_doc.py
lib/lp/bugs/browser/bugtarget.py
lib/lp/bugs/browser/bugtask.py
lib/lp/code/browser/branchmergeproposal.py
lib/lp/code/browser/diff.py
lib/lp/code/mail/sourcepackagerecipebuild.py
lib/lp/registry/vocabularies.py
lib/lp/registry/browser/distributionsourcepackage.py
lib/lp/registry/browser/mailinglists.py
lib/lp/registry/browser/person.py
lib/lp/registry/browser/pillar.py
lib/lp/registry/browser/product.py
lib/lp/registry/browser/productseries.py
lib/lp/registry/browser/team.py
lib/lp/registry/browser/tests/pillar-views.txt
lib/lp/registry/model/teammembership.py
lib/lp/soyuz/model/binarypackagebuild.py
lib/lp/soyuz/scripts/queue.py
lib/lp/translations/browser/language.py
lib/lp/translations/browser/poexportrequest.py
lib/lp/translations/browser/potemplate.py
lib/lp/translations/browser/serieslanguage.py
lib/lp/translations/browser/translationimportqueue.py
lib/lp/vostok/browser/root.py
lib/lp/vostok/browser/tests/test_root.py
^ There is a huge amount of lint in these files that I want to fix after
the review.
Test
----
Added a test to verify that person/fmt:name_link creates a link to a users
profile page.
* lib/app/doc/tales.txt
Updated lp.app's doc test runner to run tales.txt on the Launchpad functional
layer.
* lib/lp/app/tests/test_doc.py
I cut and pasted the tales registrations from webapp to app
* lib/canonical/launchpad/webapp/configure.zcml
* lib/lp/app/browser/configure.zcml
All other test changes were made by the migrater to update imports.
Implementation
--------------
Updated the linkname() method to pass the mainsite arg to the link formatter.
Updated the path to the base template because the module moved
* lib/app/browser/tales.py
All other test changes were made by the migrater to update imports.
This is the diff of the functional change:
{{{
=== modified file 'lib/canonical/launchpad/doc/tales.txt'
--- lib/canonical/launchpad/doc/tales.txt 2010-08-30 02:07:38 +0000
+++ lib/canonical/launchpad/doc/tales.txt 2010-09-25 14:05:54 +0000
@@ -433,6 +433,9 @@
>>> print test_tales("person/fmt:link", person=mark)
<a ...http://launchpad.dev/~mark...
+ >>> print test_tales("person/fmt:name_link", person=mark)
+ <a ...http://launchpad.dev/~mark...
+
>>> print test_tales("team/fmt:link", team=ubuntu_team)
<a ...http://launchpad.dev/~ubuntu-team...
=== modified file 'lib/canonical/launchpad/webapp/tales.py'
--- lib/canonical/launchpad/webapp/tales.py 2010-08-30 11:46:44 +0000
+++ lib/canonical/launchpad/webapp/tales.py 2010-09-25 14:05:54 +0000
@@ -1130,7 +1130,7 @@
def nameLink(self, view_name):
"""Return the Launchpad id of the person, linked to their profile."""
- return self._makeLink(view_name, None, self._context.name)
+ return self._makeLink(view_name, 'mainsite', self._context.name)
}}}
--
https://code.launchpad.net/~sinzui/launchpad/logged-link-0/+merge/36638
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/logged-link-0 into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/browser/launchpad.py'
--- lib/canonical/launchpad/browser/launchpad.py 2010-09-24 00:45:05 +0000
+++ lib/canonical/launchpad/browser/launchpad.py 2010-09-25 15:11:09 +0000
@@ -95,7 +95,7 @@
# be factored out into a generally available adapter for both this
# code and for TALES namespace code to use.
# Same for MenuAPI.
-from canonical.launchpad.webapp.tales import (
+from lp.app.browser.tales import (
DurationFormatterAPI,
MenuAPI,
PageTemplateContextsAPI,
=== modified file 'lib/canonical/launchpad/browser/vocabulary.py'
--- lib/canonical/launchpad/browser/vocabulary.py 2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/browser/vocabulary.py 2010-09-25 15:11:09 +0000
@@ -34,7 +34,7 @@
from canonical.launchpad.webapp.batching import BatchNavigator
from canonical.launchpad.webapp.interfaces import NoCanonicalUrl
from canonical.launchpad.webapp.publisher import canonical_url
-from canonical.launchpad.webapp.tales import ObjectImageDisplayAPI
+from lp.app.browser.tales import ObjectImageDisplayAPI
from canonical.launchpad.webapp.vocabulary import IHugeVocabulary
from lp.app.errors import UnexpectedFormData
from lp.code.interfaces.branch import IBranch
=== modified file 'lib/canonical/launchpad/browser/widgets.py'
--- lib/canonical/launchpad/browser/widgets.py 2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/browser/widgets.py 2010-09-25 15:11:09 +0000
@@ -33,7 +33,7 @@
from canonical.launchpad.validators import LaunchpadValidationError
from canonical.launchpad.webapp.interfaces import ILaunchBag
from canonical.launchpad.webapp.menu import structured
-from canonical.launchpad.webapp.tales import BranchFormatterAPI
+from lp.app.browser.tales import BranchFormatterAPI
from canonical.widgets import StrippedTextWidget
from canonical.widgets.popup import VocabularyPickerWidget
from lp.code.enums import BranchType
=== modified file 'lib/canonical/launchpad/webapp/configure.zcml'
--- lib/canonical/launchpad/webapp/configure.zcml 2010-09-20 00:36:24 +0000
+++ lib/canonical/launchpad/webapp/configure.zcml 2010-09-25 15:11:09 +0000
@@ -122,437 +122,6 @@
factory="canonical.launchpad.webapp.publisher.LaunchpadContainer"
/>
- <!-- TALES namespaces. -->
-
- <!-- TALES lp: namespace (should be deprecated) -->
- <adapter
- for="zope.publisher.interfaces.IApplicationRequest"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.RequestAPI"
- name="lp"
- />
-
- <!-- TALES enum-value: namespace -->
- <adapter
- for="lazr.enum.BaseItem"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.EnumValueAPI"
- name="enumvalue"
- />
-
- <!-- TALES menu: namespace -->
- <adapter
- for="*"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.MenuAPI"
- name="menu"
- />
-
- <!-- TALES count: namespace -->
- <adapter
- for="*"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.CountAPI"
- name="count"
- />
-
- <!-- TALES macro: namespace -->
- <adapter
- for="*"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PageMacroDispatcher"
- name="macro"
- />
-
- <!-- TALES htmlform: namespace -->
- <adapter
- for="zope.publisher.interfaces.browser.IBrowserApplicationRequest"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.HTMLFormAPI"
- name="htmlform"
- />
-
- <!-- TALES image: namespace -->
- <adapter
- for="*"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.ObjectImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IKarmaCategory"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.KarmaCategoryImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IQuestion"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.QuestionImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IBugTask"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BugTaskImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="lp.bugs.browser.bugtask.BugTaskListingItem"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BugTaskListingItemImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IMilestone"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.MilestoneImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BuildImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="lp.soyuz.interfaces.archive.IArchive"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.ArchiveImageDisplayAPI"
- name="image"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.ISpecification"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SpecificationImageDisplayAPI"
- name="image"
- />
-
- <!-- TALES badges: namespace -->
-
- <adapter
- for="*"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BadgeDisplayAPI"
- name="badges"
- />
-
- <!-- TALES fmt: namespace -->
-
- <!-- The next directive is registered for all dicts, but we really only
- want it to apply to the page template's CONTEXTS dict.
- -->
- <adapter
- for="canonical.launchpad.interfaces.IPPA"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PPAFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="dict"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PageTemplateContextsAPI"
- name="fmt"
- />
-
- <adapter
- for="int"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.DBSchemaAPI"
- name="lp"
- />
-
- <adapter
- for="datetime.datetime"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.DateTimeFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="datetime.timedelta"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.DurationFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="int"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.NumberFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="long"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.NumberFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="float"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.NumberFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="types.NoneType"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.NoneFormatter"
- name="fmt"
- />
-
- <adapter
- for="*"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.ObjectFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IPerson"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PersonFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.ITeam"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.TeamFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IProduct"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PillarFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IProjectGroup"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PillarFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IDistribution"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PillarFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="lp.registry.interfaces.distroseries.IDistroSeries"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.DistroSeriesFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IBug"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BugFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="lp.code.interfaces.branch.IBranch"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BranchFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IBugBranch"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BugBranchFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IBugTask"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BugTaskFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="lp.code.interfaces.branchsubscription.IBranchSubscription"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BranchSubscriptionFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BranchMergeProposalFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="lp.code.interfaces.seriessourcepackagebranch.ISeriesSourcePackageBranch"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SeriesSourcePackageBranchFormatter"
- name="fmt"
- />
-
- <adapter
- for="lp.code.interfaces.codeimport.ICodeImport"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.CodeImportFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="lp.buildmaster.interfaces.packagebuild.IPackageBuild"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PackageBuildFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="lp.code.interfaces.codeimportmachine.ICodeImportMachine"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.CodeImportMachineFormatterAPI"
- name="fmt"
- />
-
- <adapter
- for="canonical.launchpad.interfaces.IMilestone"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.MilestoneFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.interfaces.IProductRelease"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.ProductReleaseFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.registry.interfaces.productrelease.IProductReleaseFile"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.ProductReleaseFileFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.interfaces.IProductSeries"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.ProductSeriesFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.interfaces.IQuestion"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.QuestionFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.code.interfaces.sourcepackagerecipe.ISourcePackageRecipe"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SourcePackageRecipeFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.code.interfaces.sourcepackagerecipebuild.ISourcePackageRecipeBuild"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SourcePackageRecipeBuildFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.interfaces.ISpecification"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SpecificationFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.interfaces.ISpecificationBranch"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SpecificationBranchFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.code.interfaces.codereviewcomment.ICodeReviewComment"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.CodeReviewCommentFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.registry.interfaces.sourcepackage.ISourcePackage"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SourcePackageFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.soyuz.interfaces.sourcepackagerelease.ISourcePackageRelease"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.SourcePackageReleaseFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.interfaces.IBugTracker"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BugTrackerFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.interfaces.IBugWatch"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.BugWatchFormatterAPI"
- name="fmt"
- />
- <adapter
- for="canonical.launchpad.webapp.interfaces.ILink"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.LinkFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.translations.interfaces.translationgroup.ITranslationGroup"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.TranslationGroupFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.services.worlddata.interfaces.language.ILanguage"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.LanguageFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.translations.interfaces.pofile.IPOFile"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.POFileFormatterAPI"
- name="fmt"
- />
- <adapter
- for="lp.soyuz.interfaces.packagediff.IPackageDiff"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PackageDiffFormatterAPI"
- name="fmt"
- />
- <adapter
- for="*"
- provides="zope.traversing.interfaces.IPathAdapter"
- factory="canonical.launchpad.webapp.tales.PermissionRequiredQuery"
- name="required"
- />
-
<!-- Authentication. -->
<utility
component="canonical.launchpad.webapp.authentication.authService"
@@ -711,10 +280,6 @@
/>
<adapter
- factory="canonical.launchpad.webapp.tales.LaunchpadLayerToMainTemplateAdapter"
- />
-
- <adapter
factory="canonical.launchpad.webapp.snapshot.snapshot_sql_result" />
<!-- It also works for the legacy SQLObject interface. -->
<adapter
=== modified file 'lib/canonical/lazr/doc/menus.txt'
--- lib/canonical/lazr/doc/menus.txt 2010-07-30 04:36:08 +0000
+++ lib/canonical/lazr/doc/menus.txt 2010-09-25 15:11:09 +0000
@@ -909,7 +909,7 @@
>>> from zope.traversing.adapters import DefaultTraversable
>>> from zope.traversing.interfaces import IPathAdapter, ITraversable
>>> from canonical.launchpad.ftests import test_tales
- >>> from canonical.launchpad.webapp.tales import MenuAPI
+ >>> from lp.app.browser.tales import MenuAPI
>>> from canonical.lazr.testing.menus import summarise_tal_links
# MenuAPI is normally registered as an IPathAdapter in ZCML. This
=== modified file 'lib/canonical/lazr/testing/menus.py'
--- lib/canonical/lazr/testing/menus.py 2009-09-17 14:23:16 +0000
+++ lib/canonical/lazr/testing/menus.py 2010-09-25 15:11:09 +0000
@@ -24,7 +24,7 @@
"""List the links and their attributes in the dict or list.
:param links: A dictionary or list of menu links returned by
- `canonical.launchpad.webapp.tales.MenuAPI`.
+ `lp.app.browser.tales.MenuAPI`.
"""
is_dict = zope_isinstance(links, dict)
if is_dict:
=== modified file 'lib/canonical/widgets/bugtask.py'
--- lib/canonical/widgets/bugtask.py 2010-08-11 15:35:29 +0000
+++ lib/canonical/widgets/bugtask.py 2010-09-25 15:11:09 +0000
@@ -26,7 +26,7 @@
IBugWatchSet, IDistributionSet, ILaunchBag, NoBugTrackerFound,
UnrecognizedBugTrackerURL)
from canonical.launchpad.webapp import canonical_url
-from canonical.launchpad.webapp.tales import TeamFormatterAPI
+from lp.app.browser.tales import TeamFormatterAPI
from canonical.widgets.helpers import get_widget_template
from canonical.widgets.itemswidgets import LaunchpadRadioWidget
from canonical.widgets.popup import VocabularyPickerWidget
=== modified file 'lib/canonical/widgets/location.py'
--- lib/canonical/widgets/location.py 2010-09-21 03:30:43 +0000
+++ lib/canonical/widgets/location.py 2010-09-25 15:11:09 +0000
@@ -27,7 +27,7 @@
from canonical.launchpad.validators import LaunchpadValidationError
from canonical.launchpad.webapp.interfaces import (
ILaunchBag, IMultiLineWidgetLayout)
-from canonical.launchpad.webapp.tales import ObjectImageDisplayAPI
+from lp.app.browser.tales import ObjectImageDisplayAPI
from lp.registry.interfaces.location import IObjectWithLocation
from lp.services.geoip.interfaces import IGeoIPRecord
=== modified file 'lib/lp/app/browser/configure.zcml'
--- lib/lp/app/browser/configure.zcml 2010-05-16 23:56:51 +0000
+++ lib/lp/app/browser/configure.zcml 2010-09-25 15:11:09 +0000
@@ -84,6 +84,437 @@
template="../templates/launchpad-search-form.pt"
permission="zope.Public" />
+ <!-- TALES namespaces. -->
+
+ <!-- TALES lp: namespace (should be deprecated) -->
+ <adapter
+ for="zope.publisher.interfaces.IApplicationRequest"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.RequestAPI"
+ name="lp"
+ />
+
+ <!-- TALES enum-value: namespace -->
+ <adapter
+ for="lazr.enum.BaseItem"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.EnumValueAPI"
+ name="enumvalue"
+ />
+
+ <!-- TALES menu: namespace -->
+ <adapter
+ for="*"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.MenuAPI"
+ name="menu"
+ />
+
+ <!-- TALES count: namespace -->
+ <adapter
+ for="*"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.CountAPI"
+ name="count"
+ />
+
+ <!-- TALES macro: namespace -->
+ <adapter
+ for="*"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PageMacroDispatcher"
+ name="macro"
+ />
+
+ <!-- TALES htmlform: namespace -->
+ <adapter
+ for="zope.publisher.interfaces.browser.IBrowserApplicationRequest"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.HTMLFormAPI"
+ name="htmlform"
+ />
+
+ <!-- TALES image: namespace -->
+ <adapter
+ for="*"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.ObjectImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IKarmaCategory"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.KarmaCategoryImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IQuestion"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.QuestionImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IBugTask"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BugTaskImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="lp.bugs.browser.bugtask.BugTaskListingItem"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BugTaskListingItemImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IMilestone"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.MilestoneImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BuildImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="lp.soyuz.interfaces.archive.IArchive"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.ArchiveImageDisplayAPI"
+ name="image"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.ISpecification"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SpecificationImageDisplayAPI"
+ name="image"
+ />
+
+ <!-- TALES badges: namespace -->
+
+ <adapter
+ for="*"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BadgeDisplayAPI"
+ name="badges"
+ />
+
+ <!-- TALES fmt: namespace -->
+
+ <!-- The next directive is registered for all dicts, but we really only
+ want it to apply to the page template's CONTEXTS dict.
+ -->
+ <adapter
+ for="canonical.launchpad.interfaces.IPPA"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PPAFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="dict"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PageTemplateContextsAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="int"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.DBSchemaAPI"
+ name="lp"
+ />
+
+ <adapter
+ for="datetime.datetime"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.DateTimeFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="datetime.timedelta"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.DurationFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="int"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.NumberFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="long"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.NumberFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="float"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.NumberFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="types.NoneType"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.NoneFormatter"
+ name="fmt"
+ />
+
+ <adapter
+ for="*"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.ObjectFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IPerson"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PersonFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.ITeam"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.TeamFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IProduct"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PillarFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IProjectGroup"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PillarFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IDistribution"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PillarFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.registry.interfaces.distroseries.IDistroSeries"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.DistroSeriesFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IBug"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BugFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.code.interfaces.branch.IBranch"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BranchFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IBugBranch"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BugBranchFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IBugTask"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BugTaskFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.code.interfaces.branchsubscription.IBranchSubscription"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BranchSubscriptionFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BranchMergeProposalFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.code.interfaces.seriessourcepackagebranch.ISeriesSourcePackageBranch"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SeriesSourcePackageBranchFormatter"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.code.interfaces.codeimport.ICodeImport"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.CodeImportFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.buildmaster.interfaces.packagebuild.IPackageBuild"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PackageBuildFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="lp.code.interfaces.codeimportmachine.ICodeImportMachine"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.CodeImportMachineFormatterAPI"
+ name="fmt"
+ />
+
+ <adapter
+ for="canonical.launchpad.interfaces.IMilestone"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.MilestoneFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.interfaces.IProductRelease"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.ProductReleaseFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.registry.interfaces.productrelease.IProductReleaseFile"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.ProductReleaseFileFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.interfaces.IProductSeries"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.ProductSeriesFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.interfaces.IQuestion"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.QuestionFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.code.interfaces.sourcepackagerecipe.ISourcePackageRecipe"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SourcePackageRecipeFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.code.interfaces.sourcepackagerecipebuild.ISourcePackageRecipeBuild"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SourcePackageRecipeBuildFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.interfaces.ISpecification"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SpecificationFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.interfaces.ISpecificationBranch"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SpecificationBranchFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.code.interfaces.codereviewcomment.ICodeReviewComment"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.CodeReviewCommentFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.registry.interfaces.sourcepackage.ISourcePackage"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SourcePackageFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.soyuz.interfaces.sourcepackagerelease.ISourcePackageRelease"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.SourcePackageReleaseFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.interfaces.IBugTracker"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BugTrackerFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.interfaces.IBugWatch"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.BugWatchFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="canonical.launchpad.webapp.interfaces.ILink"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.LinkFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.translations.interfaces.translationgroup.ITranslationGroup"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.TranslationGroupFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.services.worlddata.interfaces.language.ILanguage"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.LanguageFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.translations.interfaces.pofile.IPOFile"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.POFileFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="lp.soyuz.interfaces.packagediff.IPackageDiff"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PackageDiffFormatterAPI"
+ name="fmt"
+ />
+ <adapter
+ for="*"
+ provides="zope.traversing.interfaces.IPathAdapter"
+ factory="lp.app.browser.tales.PermissionRequiredQuery"
+ name="required"
+ />
+
<!-- TALES watermark: namespace -->
<adapter
for="*"
@@ -100,4 +531,7 @@
name="fmt"
/>
+ <adapter
+ factory="lp.app.browser.tales.LaunchpadLayerToMainTemplateAdapter"
+ />
</configure>
=== modified file 'lib/lp/app/browser/stringformatter.py'
--- lib/lp/app/browser/stringformatter.py 2010-08-20 20:31:18 +0000
+++ lib/lp/app/browser/stringformatter.py 2010-09-25 15:11:09 +0000
@@ -686,7 +686,7 @@
if person is not None and not person.hide_email_addresses:
# Circular dependancies now. Should be resolved by moving the
# object image display api.
- from canonical.launchpad.webapp.tales import (
+ from lp.app.browser.tales import (
ObjectImageDisplayAPI)
css_sprite = ObjectImageDisplayAPI(person).sprite_css()
text = text.replace(
=== renamed file 'lib/canonical/launchpad/webapp/tales.py' => 'lib/lp/app/browser/tales.py'
--- lib/canonical/launchpad/webapp/tales.py 2010-08-30 11:46:44 +0000
+++ lib/lp/app/browser/tales.py 2010-09-25 15:11:09 +0000
@@ -1130,7 +1130,7 @@
def nameLink(self, view_name):
"""Return the Launchpad id of the person, linked to their profile."""
- return self._makeLink(view_name, None, self._context.name)
+ return self._makeLink(view_name, 'mainsite', self._context.name)
class TeamFormatterAPI(PersonFormatterAPI):
@@ -2321,7 +2321,7 @@
def __init__(self, context):
here = os.path.dirname(os.path.realpath(__file__))
self.path = os.path.join(
- here, '../../../lp/app/templates/base-layout.pt')
+ here, '../templates/base-layout.pt')
class PageMacroDispatcher:
=== renamed file 'lib/canonical/launchpad/doc/displaying-dates.txt' => 'lib/lp/app/doc/displaying-dates.txt'
--- lib/canonical/launchpad/doc/displaying-dates.txt 2008-04-15 13:52:15 +0000
+++ lib/lp/app/doc/displaying-dates.txt 2010-09-25 15:11:09 +0000
@@ -39,7 +39,7 @@
>>> fixed_time_utc = datetime(2005, 12, 25, 12, 0, 0, tzinfo=UTC)
>>> fixed_time = datetime(2005, 12, 25, 12, 0, 0)
- >>> from canonical.launchpad.webapp.tales import DateTimeFormatterAPI
+ >>> from lp.app.browser.tales import DateTimeFormatterAPI
>>> class TestDateTimeFormatterAPI(DateTimeFormatterAPI):
... def _now(self):
... if self._datetime.tzinfo:
=== renamed file 'lib/canonical/launchpad/doc/tales-email-formatting.txt' => 'lib/lp/app/doc/tales-email-formatting.txt'
=== renamed file 'lib/canonical/launchpad/doc/tales-macro.txt' => 'lib/lp/app/doc/tales-macro.txt'
=== renamed file 'lib/canonical/launchpad/doc/tales.txt' => 'lib/lp/app/doc/tales.txt'
--- lib/canonical/launchpad/doc/tales.txt 2010-08-30 02:07:38 +0000
+++ lib/lp/app/doc/tales.txt 2010-09-25 15:11:09 +0000
@@ -433,6 +433,9 @@
>>> print test_tales("person/fmt:link", person=mark)
<a ...http://launchpad.dev/~mark...
+ >>> print test_tales("person/fmt:name_link", person=mark)
+ <a ...http://launchpad.dev/~mark...
+
>>> print test_tales("team/fmt:link", team=ubuntu_team)
<a ...http://launchpad.dev/~ubuntu-team...
=== modified file 'lib/lp/app/tests/test_doc.py'
--- lib/lp/app/tests/test_doc.py 2010-01-08 20:57:08 +0000
+++ lib/lp/app/tests/test_doc.py 2010-09-25 15:11:09 +0000
@@ -7,11 +7,27 @@
import os
+from canonical.launchpad.testing.systemdocs import (
+ LayeredDocFileSuite,
+ setUp,
+ tearDown,
+ )
+from canonical.testing import (
+ LaunchpadFunctionalLayer,
+ )
from lp.services.testing import build_test_suite
here = os.path.dirname(os.path.realpath(__file__))
+special = {
+ 'tales.txt': LayeredDocFileSuite(
+ '../doc/tales.txt',
+ setUp=setUp, tearDown=tearDown,
+ layer=LaunchpadFunctionalLayer,
+ ),
+ }
+
def test_suite():
- return build_test_suite(here)
+ return build_test_suite(here, special)
=== renamed file 'lib/canonical/launchpad/webapp/tests/test_tales.py' => 'lib/lp/app/tests/test_tales.py'
--- lib/canonical/launchpad/webapp/tests/test_tales.py 2010-08-12 16:17:15 +0000
+++ lib/lp/app/tests/test_tales.py 2010-09-25 15:11:09 +0000
@@ -15,7 +15,7 @@
def test_requestapi():
"""
- >>> from canonical.launchpad.webapp.tales import IRequestAPI, RequestAPI
+ >>> from lp.app.browser.tales import IRequestAPI, RequestAPI
>>> from canonical.launchpad.interfaces import IPerson
>>> from zope.interface.verify import verifyObject
@@ -53,7 +53,7 @@
available for the entire Launchpad site. It takes into account
the request URL and the cookie_domains setting in launchpad.conf.
- >>> from canonical.launchpad.webapp.tales import RequestAPI
+ >>> from lp.app.browser.tales import RequestAPI
>>> def cookie_scope(url):
... class FakeRequest:
... def getURL(self):
@@ -77,7 +77,7 @@
def test_dbschemaapi():
"""
- >>> from canonical.launchpad.webapp.tales import DBSchemaAPI
+ >>> from lp.app.browser.tales import DBSchemaAPI
>>> from lp.code.enums import BranchType
The syntax to get the title is: number/lp:DBSchemaClass
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2010-09-13 21:25:14 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2010-09-25 15:11:09 +0000
@@ -80,7 +80,7 @@
from canonical.launchpad.webapp.interfaces import ILaunchBag
from canonical.launchpad.webapp.menu import structured
from canonical.launchpad.webapp.publisher import HTTP_MOVED_PERMANENTLY
-from canonical.launchpad.webapp.tales import BugTrackerFormatterAPI
+from lp.app.browser.tales import BugTrackerFormatterAPI
from canonical.widgets.bug import (
BugTagsWidget,
LargeBugTagsWidget,
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2010-09-24 18:49:21 +0000
+++ lib/lp/bugs/browser/bugtask.py 2010-09-25 15:11:09 +0000
@@ -163,7 +163,7 @@
from canonical.launchpad.webapp.breadcrumb import Breadcrumb
from canonical.launchpad.webapp.interfaces import ILaunchBag
from canonical.launchpad.webapp.menu import structured
-from canonical.launchpad.webapp.tales import (
+from lp.app.browser.tales import (
FormattersAPI,
ObjectImageDisplayAPI,
PersonFormatterAPI,
=== modified file 'lib/lp/code/browser/branchmergeproposal.py'
--- lib/lp/code/browser/branchmergeproposal.py 2010-09-21 14:37:42 +0000
+++ lib/lp/code/browser/branchmergeproposal.py 2010-09-25 15:11:09 +0000
@@ -88,7 +88,7 @@
from canonical.launchpad.webapp.breadcrumb import Breadcrumb
from canonical.launchpad.webapp.interfaces import IPrimaryContext
from canonical.launchpad.webapp.menu import NavigationMenu
-from canonical.launchpad.webapp.tales import DateTimeFormatterAPI
+from lp.app.browser.tales import DateTimeFormatterAPI
from canonical.widgets.lazrjs import (
TextAreaEditorWidget,
vocabulary_to_choice_edit_items,
=== modified file 'lib/lp/code/browser/diff.py'
--- lib/lp/code/browser/diff.py 2010-02-23 20:02:07 +0000
+++ lib/lp/code/browser/diff.py 2010-09-25 15:11:09 +0000
@@ -13,7 +13,7 @@
from canonical.launchpad.browser.librarian import FileNavigationMixin
from canonical.launchpad.webapp import Navigation
from canonical.launchpad.webapp.publisher import canonical_url
-from canonical.launchpad.webapp.tales import ObjectFormatterAPI
+from lp.app.browser.tales import ObjectFormatterAPI
from lp.code.interfaces.diff import IPreviewDiff
from lp.services.browser_helpers import get_plural_text
=== modified file 'lib/lp/code/mail/sourcepackagerecipebuild.py'
--- lib/lp/code/mail/sourcepackagerecipebuild.py 2010-09-21 19:58:28 +0000
+++ lib/lp/code/mail/sourcepackagerecipebuild.py 2010-09-25 15:11:09 +0000
@@ -11,7 +11,7 @@
from canonical.config import config
from canonical.launchpad.webapp import canonical_url
-from canonical.launchpad.webapp.tales import DurationFormatterAPI
+from lp.app.browser.tales import DurationFormatterAPI
from lp.services.mail.basemailer import (
BaseMailer,
RecipientReason,
=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
--- lib/lp/registry/browser/distributionsourcepackage.py 2010-08-31 11:31:04 +0000
+++ lib/lp/registry/browser/distributionsourcepackage.py 2010-09-25 15:11:09 +0000
@@ -44,7 +44,7 @@
NavigationMenu,
)
from canonical.launchpad.webapp.sorting import sorted_dotted_numbers
-from canonical.launchpad.webapp.tales import CustomizableFormatter
+from lp.app.browser.tales import CustomizableFormatter
from canonical.lazr.utils import smartquote
from lp.answers.browser.questiontarget import (
QuestionTargetFacetMixin,
=== modified file 'lib/lp/registry/browser/mailinglists.py'
--- lib/lp/registry/browser/mailinglists.py 2010-08-24 10:45:57 +0000
+++ lib/lp/registry/browser/mailinglists.py 2010-09-25 15:11:09 +0000
@@ -28,7 +28,7 @@
LaunchpadView,
)
from canonical.launchpad.webapp.menu import structured
-from canonical.launchpad.webapp.tales import PersonFormatterAPI
+from lp.app.browser.tales import PersonFormatterAPI
from lp.app.errors import UnexpectedFormData
from lp.registry.interfaces.mailinglist import (
IHeldMessageDetails,
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2010-09-23 03:17:10 +0000
+++ lib/lp/registry/browser/person.py 2010-09-25 15:11:09 +0000
@@ -205,7 +205,7 @@
from canonical.launchpad.webapp.login import logoutPerson
from canonical.launchpad.webapp.menu import get_current_view
from canonical.launchpad.webapp.publisher import LaunchpadView
-from canonical.launchpad.webapp.tales import (
+from lp.app.browser.tales import (
DateTimeFormatterAPI,
PersonFormatterAPI,
)
=== modified file 'lib/lp/registry/browser/pillar.py'
--- lib/lp/registry/browser/pillar.py 2010-09-13 12:09:30 +0000
+++ lib/lp/registry/browser/pillar.py 2010-09-25 15:11:09 +0000
@@ -29,7 +29,7 @@
LaunchpadView,
nearest,
)
-from canonical.launchpad.webapp.tales import MenuAPI
+from lp.app.browser.tales import MenuAPI
from lp.app.enums import (
ServiceUsage,
service_uses_launchpad,
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2010-09-24 18:12:48 +0000
+++ lib/lp/registry/browser/product.py 2010-09-25 15:11:09 +0000
@@ -123,7 +123,7 @@
safe_action,
)
from canonical.launchpad.webapp.menu import NavigationMenu
-from canonical.launchpad.webapp.tales import MenuAPI
+from lp.app.browser.tales import MenuAPI
from canonical.widgets.date import DateWidget
from canonical.widgets.itemswidgets import (
CheckBoxMatrixWidget,
=== modified file 'lib/lp/registry/browser/productseries.py'
--- lib/lp/registry/browser/productseries.py 2010-09-23 03:17:10 +0000
+++ lib/lp/registry/browser/productseries.py 2010-09-25 15:11:09 +0000
@@ -81,7 +81,7 @@
ReturnToReferrerMixin,
)
from canonical.launchpad.webapp.menu import structured
-from canonical.launchpad.webapp.tales import MenuAPI
+from lp.app.browser.tales import MenuAPI
from canonical.widgets.itemswidgets import LaunchpadRadioWidget
from canonical.widgets.textwidgets import StrippedTextWidget
from lp.app.enums import ServiceUsage
=== modified file 'lib/lp/registry/browser/team.py'
--- lib/lp/registry/browser/team.py 2010-09-21 16:06:38 +0000
+++ lib/lp/registry/browser/team.py 2010-09-25 15:11:09 +0000
@@ -61,7 +61,7 @@
from canonical.launchpad.webapp.batching import BatchNavigator
from canonical.launchpad.webapp.interfaces import ILaunchBag
from canonical.launchpad.webapp.menu import structured
-from canonical.launchpad.webapp.tales import PersonFormatterAPI
+from lp.app.browser.tales import PersonFormatterAPI
from canonical.lazr.interfaces import IObjectPrivacy
from canonical.widgets import (
HiddenUserWidget,
=== modified file 'lib/lp/registry/browser/tests/pillar-views.txt'
--- lib/lp/registry/browser/tests/pillar-views.txt 2010-09-16 13:30:18 +0000
+++ lib/lp/registry/browser/tests/pillar-views.txt 2010-09-25 15:11:09 +0000
@@ -220,7 +220,7 @@
The pillar involvement view uses the InvolvedMenu when rendering links.
>>> from operator import attrgetter
- >>> from canonical.launchpad.webapp.tales import MenuAPI
+ >>> from lp.app.browser.tales import MenuAPI
The menu when viewed from a product page.
=== modified file 'lib/lp/registry/model/teammembership.py'
--- lib/lp/registry/model/teammembership.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/model/teammembership.py 2010-09-25 15:11:09 +0000
@@ -45,7 +45,7 @@
)
from canonical.launchpad.mailnotification import MailWrapper
from canonical.launchpad.webapp import canonical_url
-from canonical.launchpad.webapp.tales import DurationFormatterAPI
+from lp.app.browser.tales import DurationFormatterAPI
from lp.registry.interfaces.person import (
IPersonSet,
TeamMembershipRenewalPolicy,
=== modified file 'lib/lp/registry/vocabularies.py'
--- lib/lp/registry/vocabularies.py 2010-09-22 20:56:52 +0000
+++ lib/lp/registry/vocabularies.py 2010-09-25 15:11:09 +0000
@@ -109,7 +109,7 @@
IStoreSelector,
MAIN_STORE,
)
-from canonical.launchpad.webapp.tales import DateTimeFormatterAPI
+from lp.app.browser.tales import DateTimeFormatterAPI
from canonical.launchpad.webapp.vocabulary import (
BatchedCountableIterator,
CountableIterator,
=== modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
--- lib/lp/soyuz/model/binarypackagebuild.py 2010-09-16 12:27:46 +0000
+++ lib/lp/soyuz/model/binarypackagebuild.py 2010-09-25 15:11:09 +0000
@@ -66,7 +66,7 @@
IStoreSelector,
MAIN_STORE,
)
-from canonical.launchpad.webapp.tales import DurationFormatterAPI
+from lp.app.browser.tales import DurationFormatterAPI
from lp.app.errors import NotFoundError
from lp.archivepublisher.utils import get_ppa_reference
from lp.buildmaster.enums import (
=== modified file 'lib/lp/soyuz/scripts/queue.py'
--- lib/lp/soyuz/scripts/queue.py 2010-08-31 11:11:09 +0000
+++ lib/lp/soyuz/scripts/queue.py 2010-09-25 15:11:09 +0000
@@ -25,7 +25,7 @@
from zope.component import getUtility
from canonical.config import config
-from canonical.launchpad.webapp.tales import DurationFormatterAPI
+from lp.app.browser.tales import DurationFormatterAPI
from canonical.librarian.utils import filechunks
from lp.app.errors import NotFoundError
from lp.services.propertycache import cachedproperty
=== modified file 'lib/lp/translations/browser/language.py'
--- lib/lp/translations/browser/language.py 2010-08-24 10:45:57 +0000
+++ lib/lp/translations/browser/language.py 2010-09-25 15:11:09 +0000
@@ -36,7 +36,7 @@
NavigationMenu,
)
from canonical.launchpad.webapp.breadcrumb import Breadcrumb
-from canonical.launchpad.webapp.tales import LanguageFormatterAPI
+from lp.app.browser.tales import LanguageFormatterAPI
from canonical.widgets import LabeledMultiCheckBoxWidget
from lp.services.propertycache import cachedproperty
from lp.services.worlddata.interfaces.language import (
=== modified file 'lib/lp/translations/browser/poexportrequest.py'
--- lib/lp/translations/browser/poexportrequest.py 2010-08-24 10:45:57 +0000
+++ lib/lp/translations/browser/poexportrequest.py 2010-09-25 15:11:09 +0000
@@ -16,7 +16,7 @@
canonical_url,
LaunchpadView,
)
-from canonical.launchpad.webapp.tales import DurationFormatterAPI
+from lp.app.browser.tales import DurationFormatterAPI
from lp.services.propertycache import cachedproperty
from lp.translations.interfaces.poexportrequest import IPOExportRequestSet
from lp.translations.interfaces.potemplate import IHasTranslationTemplates
=== modified file 'lib/lp/translations/browser/potemplate.py'
--- lib/lp/translations/browser/potemplate.py 2010-09-14 08:22:18 +0000
+++ lib/lp/translations/browser/potemplate.py 2010-09-25 15:11:09 +0000
@@ -60,7 +60,7 @@
)
from canonical.launchpad.webapp.launchpadform import ReturnToReferrerMixin
from canonical.launchpad.webapp.menu import structured
-from canonical.launchpad.webapp.tales import DateTimeFormatterAPI
+from lp.app.browser.tales import DateTimeFormatterAPI
from canonical.lazr.utils import smartquote
from lp.app.enums import service_uses_launchpad
from lp.app.errors import NotFoundError
=== modified file 'lib/lp/translations/browser/serieslanguage.py'
--- lib/lp/translations/browser/serieslanguage.py 2010-08-24 10:45:57 +0000
+++ lib/lp/translations/browser/serieslanguage.py 2010-09-25 15:11:09 +0000
@@ -16,7 +16,7 @@
from canonical.launchpad.webapp import LaunchpadView
from canonical.launchpad.webapp.batching import BatchNavigator
from canonical.launchpad.webapp.publisher import Navigation
-from canonical.launchpad.webapp.tales import PersonFormatterAPI
+from lp.app.browser.tales import PersonFormatterAPI
from lp.services.propertycache import cachedproperty
from lp.translations.interfaces.distroserieslanguage import (
IDistroSeriesLanguage,
=== modified file 'lib/lp/translations/browser/translationimportqueue.py'
--- lib/lp/translations/browser/translationimportqueue.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/browser/translationimportqueue.py 2010-09-25 15:11:09 +0000
@@ -36,7 +36,7 @@
GetitemNavigation,
LaunchpadFormView,
)
-from canonical.launchpad.webapp.tales import DateTimeFormatterAPI
+from lp.app.browser.tales import DateTimeFormatterAPI
from lp.app.errors import (
NotFoundError,
UnexpectedFormData,
=== modified file 'lib/lp/vostok/browser/root.py'
--- lib/lp/vostok/browser/root.py 2010-08-20 20:31:18 +0000
+++ lib/lp/vostok/browser/root.py 2010-09-25 15:11:09 +0000
@@ -18,7 +18,7 @@
from zope.interface import implements
from canonical.launchpad.webapp import LaunchpadView
-from canonical.launchpad.webapp.tales import IMainTemplateFile
+from lp.app.browser.tales import IMainTemplateFile
from lp.registry.interfaces.distribution import IDistributionSet
from lp.vostok.publisher import VostokLayer
=== modified file 'lib/lp/vostok/browser/tests/test_root.py'
--- lib/lp/vostok/browser/tests/test_root.py 2010-08-20 20:31:18 +0000
+++ lib/lp/vostok/browser/tests/test_root.py 2010-09-25 15:11:09 +0000
@@ -14,7 +14,7 @@
extract_text,
find_tag_by_id,
)
-from canonical.launchpad.webapp.tales import IMainTemplateFile
+from lp.app.browser.tales import IMainTemplateFile
from canonical.testing.layers import (
DatabaseFunctionalLayer,
FunctionalLayer,