~ubuntu-branches/ubuntu/precise/zeroinstall-injector/precise

« back to all changes in this revision

Viewing changes to zeroinstall/injector/handler.py

  • Committer: Package Import Robot
  • Author(s): Thomas Leonard
  • Date: 2012-02-12 15:19:54 UTC
  • mfrom: (1.1.28)
  • Revision ID: package-import@ubuntu.com-20120212151954-u5nef8c1381klr43
Tags: 1.6-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
                """@deprecated: use tasks.wait_for_blocker instead"""
82
82
                tasks.wait_for_blocker(blocker)
83
83
        
84
 
        def get_download(self, url, force = False, hint = None, factory = None):
85
 
                """Create a Download object to download 'url'.
86
 
                @rtype: L{download.Download}
87
 
                """
88
 
                import warnings
89
 
                warnings.warn("Handler.get_download is deprecated (use Fetcher.download_url instead)", DeprecationWarning, stacklevel = 2)
90
 
                if self.dry_run:
91
 
                        raise NeedDownload(url)
92
 
 
93
 
                if factory is None:
94
 
                        dl = download.Download(url, hint)
95
 
                else:
96
 
                        dl = factory(url, hint)
97
 
                self.monitor_download(dl)
98
 
                return dl
99
 
 
100
 
        # Allows code that used to take a Handler and now expects a Fetcher to
101
 
        # cope if it gets passed a Handler from some old code.
102
 
        download_url = get_download
103
 
 
104
84
        @tasks.async
105
85
        def confirm_import_feed(self, pending, valid_sigs):
106
86
                """Sub-classes should override this method to interact with the user about new feeds.