~mvo/software-center/arb-partner-channels

« back to all changes in this revision

Viewing changes to softwarecenter/db/update.py

  • Committer: Michael Vogt
  • Date: 2012-01-27 09:28:46 UTC
  • Revision ID: michael.vogt@ubuntu.com-20120127092846-9aaz7dhlj2yoq2ci
GREEN: AppDetails understands that archive.canonical.com belongs to the -partner channel and sets the attribute correctly

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
from gettext import gettext as _
52
52
from glob import glob
 
53
from urlparse import urlparse
53
54
 
54
55
import softwarecenter.paths
55
56
 
165
166
                  }
166
167
 
167
168
    def __init__(self, sca_application):
 
169
        # the piston object we got from software-center-agent
168
170
        self.sca_application = sca_application
169
171
        self.origin = "software-center-agent"
170
172
        self._apply_exceptions()
191
193
        if not hasattr(self.sca_application, 'categories'):
192
194
            self.sca_application.categories = ""
193
195
 
 
196
        # detect if its for the partner channel and set the channel
 
197
        # attribute appropriately so that the channel-adding magic works
 
198
        u = urlparse(self.sca_application.archive_root)
 
199
        if u.scheme == "http" and u.netloc ==  "archive.canonical.com":
 
200
            distroseries = get_distro().get_codename()
 
201
            self.sca_application.channel = "%s-partner" % distroseries
 
202
            
 
203
 
194
204
    def get_desktop(self, key, translated=True):
195
205
        if key in self.STATIC_DATA:
196
206
            return self.STATIC_DATA[key]