~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/browser/archive.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-15 10:35:32 UTC
  • mfrom: (14517.1.3 new-bzr)
  • Revision ID: launchpad@pqm.canonical.com-20111215103532-q2m4uyk0r8ugiayx
[r=sinzui, poolie][bug=509016] Always load foreign plugins,
 but restrict probers to avoid accidentally opening foreign branches.
 (re-land)

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    stepthrough,
72
72
    )
73
73
from canonical.launchpad.webapp.authorization import check_permission
 
74
from canonical.launchpad.webapp.badge import HasBadgeBase
74
75
from canonical.launchpad.webapp.batching import BatchNavigator
75
76
from canonical.launchpad.webapp.interfaces import (
76
77
    ICanonicalUrlData,
80
81
    NavigationMenu,
81
82
    structured,
82
83
    )
83
 
from lp.app.browser.badge import HasBadgeBase
84
84
from lp.app.browser.launchpadform import (
85
85
    action,
86
86
    custom_widget,
1266
1266
def copy_asynchronously(source_pubs, dest_archive, dest_series, dest_pocket,
1267
1267
                        include_binaries, dest_url=None,
1268
1268
                        dest_display_name=None, person=None,
1269
 
                        check_permissions=True, sponsored=None):
 
1269
                        check_permissions=True):
1270
1270
    """Schedule jobs to copy packages later.
1271
1271
 
1272
1272
    :return: A `structured` with human-readable feedback about the
1288
1288
            dest_pocket, include_binaries=include_binaries,
1289
1289
            package_version=spph.sourcepackagerelease.version,
1290
1290
            copy_policy=PackageCopyPolicy.INSECURE,
1291
 
            requester=person, sponsored=sponsored)
 
1291
            requester=person)
1292
1292
 
1293
1293
    return copy_asynchronously_message(len(source_pubs))
1294
1294
 
1352
1352
    def do_copy(self, sources_field_name, source_pubs, dest_archive,
1353
1353
                dest_series, dest_pocket, include_binaries,
1354
1354
                dest_url=None, dest_display_name=None, person=None,
1355
 
                check_permissions=True, force_async=False,
1356
 
                sponsored_person=None):
 
1355
                check_permissions=True, force_async=False):
1357
1356
        """Copy packages and add appropriate feedback to the browser page.
1358
1357
 
1359
1358
        This may either copy synchronously, if there are few enough
1379
1378
            requester's permissions to copy should be checked.
1380
1379
        :param force_async: Force the copy to create package copy jobs and
1381
1380
            perform the copy asynchronously.
1382
 
        :param sponsored_person: An IPerson representing the person being
1383
 
            sponsored (for asynchronous copies only).
1384
1381
 
1385
1382
        :return: True if the copying worked, False otherwise.
1386
1383
        """
1387
 
        assert force_async or not sponsored_person, (
1388
 
            "sponsored must be None for sync copies")
1389
1384
        try:
1390
1385
            if (force_async == False and
1391
1386
                    self.canCopySynchronously(source_pubs)):
1399
1394
                    source_pubs, dest_archive, dest_series, dest_pocket,
1400
1395
                    include_binaries, dest_url=dest_url,
1401
1396
                    dest_display_name=dest_display_name, person=person,
1402
 
                    check_permissions=check_permissions,
1403
 
                    sponsored=sponsored_person)
 
1397
                    check_permissions=check_permissions)
1404
1398
        except CannotCopy, error:
1405
1399
            self.setFieldError(
1406
1400
                sources_field_name, render_cannotcopy_as_html(error))