~ubuntu-branches/ubuntu/precise/bughelper/precise

« back to all changes in this revision

Viewing changes to bugHelper/infoFilesDefinitions.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-04-10 11:54:41 UTC
  • Revision ID: james.westby@ubuntu.com-20070410115441-7hix742g1qi8ztp7
Tags: 0.2~169
* Fixed numerous bugs. (LP: #93658, #89728, #95223, #81434, #99586, #102355,
  #99642, #103318, #102480, #107554 ,#107735, #107959, #99726, #79136,
  #79136, #79136, #79140, #109533, #79140, #109533).
* debian/control:
  - updated XS-Vcs-Bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# (C) Canonical, Ltd. Licensed under the GPL
3
3
 
4
4
class clueCondition(object):
5
 
    def __init__(self, and_cond, or_cond, simple_cond, not_cond):
 
5
    def __init__(self, and_cond, or_cond, simple_cond, not_cond, cond_field = None):
6
6
        self.and_cond = and_cond
7
7
        self.or_cond = or_cond
8
8
        self.simple_cond = simple_cond
9
9
        self.not_cond = not_cond
 
10
        self.cond_field = cond_field
10
11
 
11
12
    def __str__(self):
12
13
        if self.simple_cond:
13
14
            if self.not_cond:
14
 
                return "!clueCondition('%s')" % self.simple_cond
 
15
                return "!clueCondition(field='%s', '%s')" % self.cond_field, self.simple_cond
15
16
            else:
16
 
                return "clueCondition('%s')" % self.simple_cond
 
17
                return "clueCondition(field='%s', '%s')" % self.cond_field, self.simple_cond
17
18
        if self.and_cond:
18
19
            return "clueCondition(%s)" % ' && '.join([str(cond) 
19
20
                                                     for cond in self.and_cond])