~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/archiveuploader/changesfile.py

  • Committer: Abel Deuring
  • Date: 2009-03-24 12:43:49 UTC
  • mfrom: (8053 devel)
  • mto: This revision was merged to the branch mainline in revision 8328.
  • Revision ID: abel.deuring@canonical.com-20090324124349-xllu9kbw5ib27kno
RF merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
    ]
14
14
 
15
15
import os
16
 
import re
17
16
 
18
17
from canonical.archiveuploader.dscfile import DSCFile, SignableTagFile
19
18
from canonical.archiveuploader.nascentuploadfile import (
96
95
                "Format out of acceptable range for changes file. Range "
97
96
                "1.5 - 2.0, format %g" % format)
98
97
 
 
98
        if policy.unsigned_changes_ok:
 
99
            self.logger.debug("Changes file can be unsigned.")
 
100
        else:
 
101
            self.processSignature()
 
102
 
 
103
    def checkFileName(self):
 
104
        """Make sure the changes file name is well-formed.
 
105
        
 
106
        Please note: for well-formed changes file names the `filename_archtag`
 
107
        property will be set appropriately.
 
108
        """
99
109
        match_changes = re_changes_file_name.match(self.filename)
100
110
        if match_changes is None:
101
 
            raise UploadError(
 
111
            yield UploadError(
102
112
                '%s -> inappropriate changesfile name, '
103
113
                'should follow "<pkg>_<version>_<arch>.changes" format'
104
114
                % self.filename)
105
 
        self.filename_archtag = match_changes.group(3)
106
 
 
107
 
        if policy.unsigned_changes_ok:
108
 
            self.logger.debug("Changes file can be unsigned.")
109
115
        else:
110
 
            self.processSignature()
 
116
            self.filename_archtag = match_changes.group(3)
111
117
 
112
118
    def processAddresses(self):
113
119
        """Parse addresses and build person objects.
250
256
 
251
257
    @property
252
258
    def binary_package_files(self):
253
 
        """Return a list of BaseBinaryUploadFile initialized in this context."""
 
259
        """Get a list of BaseBinaryUploadFile initialized in this context."""
254
260
        return self._getFilesByType(BaseBinaryUploadFile)
255
261
 
256
262
    @property