~longsleep/snapcraft/snapcraft-debs-plugin

« back to all changes in this revision

Viewing changes to snapcraft/__init__.py

  • Committer: Snappy Tarmac
  • Author(s): Zygmunt Krynicki
  • Date: 2015-08-26 09:11:57 UTC
  • mfrom: (135.2.1 launchpad/fix-logging-calls)
  • Revision ID: snappy_tarmac-20150826091157-gvxmseyyx6pc2fqk
Correct all the logging calls to pass arguments directly by zyga approved by mvo

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
    def pull_hg(self, source, source_tag=None, source_branch=None):
79
79
        if source_tag and source_branch:
80
 
            logger.error("You can't specify both source-tag and source-branch for a mercurial source (part '%s')." % self.name)
 
80
            logger.error("You can't specify both source-tag and source-branch for a mercurial source (part '%s').", self.name)
81
81
            snapcraft.common.fatal()
82
82
 
83
83
        if os.path.exists(os.path.join(self.sourcedir, ".hg")):
96
96
 
97
97
    def pull_git(self, source, source_tag=None, source_branch=None):
98
98
        if source_tag and source_branch:
99
 
            logger.error("You can't specify both source-tag and source-branch for a git source (part '%s')." % self.name)
 
99
            logger.error("You can't specify both source-tag and source-branch for a git source (part '%s').", self.name)
100
100
            snapcraft.common.fatal()
101
101
 
102
102
        if os.path.exists(os.path.join(self.sourcedir, ".git")):
167
167
            elif source.startswith("git:"):
168
168
                source_type = 'git'
169
169
            elif self.isurl(source):
170
 
                logger.error("Unrecognized source '%s' for part '%s'." % (source, self.name))
 
170
                logger.error("Unrecognized source '%s' for part '%s'.", source, self.name)
171
171
                snapcraft.common.fatal()
172
172
 
173
173
        if source_type == 'bzr':
174
174
            if source_branch:
175
 
                logger.error("You can't specify source-branch for a bzr source (part '%s')." % self.name)
 
175
                logger.error("You can't specify source-branch for a bzr source (part '%s').", self.name)
176
176
                snapcraft.common.fatal()
177
177
            if not self.pull_bzr(source, source_tag=source_tag):
178
178
                return False
190
190
                return False
191
191
        elif source_type == 'tar':
192
192
            if source_branch:
193
 
                logger.error("You can't specify source-branch for a tar source (part '%s')." % self.name)
 
193
                logger.error("You can't specify source-branch for a tar source (part '%s').", self.name)
194
194
                snapcraft.common.fatal()
195
195
            if source_tag:
196
 
                logger.error("You can't specify source-tag for a tar source (part '%s')." % self.name)
 
196
                logger.error("You can't specify source-tag for a tar source (part '%s').", self.name)
197
197
                snapcraft.common.fatal()
198
198
            if not self.pull_tarball(source):
199
199
                return False