~dktrkranz/debomatic/debomatic

« back to all changes in this revision

Viewing changes to modules/Mailer.py

  • Committer: Luca Falavigna
  • Date: 2013-06-05 13:18:02 UTC
  • mfrom: (1.4.56 debomatic)
  • Revision ID: dktrkranz@debian.org-20130605131802-og6623opcn2cv9mt
StableĀ releaseĀ 0.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
            substdict = dict(args)
46
46
            substdict['buildlog'] = buildlog
47
47
            substdict['fromaddr'] = self.fromaddr
 
48
            substdict['lintlog'] = 'No log'
 
49
            if self.lintlog:
 
50
                lintfile = os.path.join(self.resultdir, '%s.lintian'
 
51
                                        % args['package'])
 
52
                if os.path.isfile(lintfile):
 
53
                    with open(lintfile, 'r') as lintfd:
 
54
                        substdict['lintlog'] = lintfd.read()
48
55
            reply = fd.read() % substdict
49
56
        msg = Parser().parsestr(reply)
50
57
        return msg.as_string()
54
61
            return
55
62
        template = None
56
63
        uploader = args['uploader']
57
 
        resultdir = os.path.join(args['directory'], 'pool', args['package'])
 
64
        self.resultdir = os.path.join(args['directory'], 'pool',
 
65
                                      args['package'])
58
66
        if args['opts'].has_section('mailer'):
59
67
            for opt in self.DEFAULT_OPTIONS:
60
68
                setattr(self, opt, args['opts'].get('mailer', opt))
61
 
        for filename in os.listdir(resultdir):
 
69
            if args['opts'].has_option('mailer', 'lintlog'):
 
70
                self.lintlog = args['opts'].getint('mailer', 'lintlog')
 
71
        for filename in os.listdir(self.resultdir):
62
72
            if filename.endswith('.changes'):
63
73
                template = self.success
64
74
                break