示例#1
0
    def get_localepicker(self):
        """
        For a file that is part of a language pack, extract
        the chrome/localepicker.properties file and return as
        a string.
        """
        start = time.time()
        zip = SafeUnzip(self.file_path)
        if not zip.is_valid(fatal=False):
            return ''

        try:
            manifest = zip.extract_path('chrome.manifest')
        except KeyError, e:
            log.info('No file named: chrome.manifest in file: %s' % self.pk)
            return ''
示例#2
0
    def get_localepicker(self):
        """
        For a file that is part of a language pack, extract
        the chrome/localepicker.properties file and return as
        a string.
        """
        start = time.time()
        zip = SafeUnzip(self.file_path)
        if not zip.is_valid(fatal=False):
            return ''

        try:
            manifest = zip.extract_path('chrome.manifest')
        except KeyError, e:
            log.info('No file named: chrome.manifest in file: %s' % self.pk)
            return ''
示例#3
0
 def test_extract_path(self):
     zip_file = SafeUnzip(self.xpi_path('langpack-localepicker'))
     assert zip_file.is_valid()
     assert 'locale browser de' in zip_file.extract_path('chrome.manifest')
示例#4
0
 def test_extract_path(self):
     zip_file = SafeUnzip(self.xpi_path('langpack-localepicker'))
     assert zip_file.is_valid()
     assert'locale browser de' in zip_file.extract_path('chrome.manifest')