~ubuntu-branches/debian/squeeze/bzr-builddeb/squeeze

« back to all changes in this revision

Viewing changes to changes.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-01-18 19:15:26 UTC
  • mfrom: (5.1.5 karmic)
  • Revision ID: james.westby@ubuntu.com-20100118191526-fzyw0n60z6vrhhhn
Tags: 2.2
* Upload to unstable.
* Bump standards version to 3.8.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
from bzrlib.trace import mutter
27
27
 
28
 
from bzrlib.plugins.builddeb.errors import DebianError
 
28
from bzrlib.plugins.builddeb.errors import DebianError, MissingChanges
29
29
 
30
30
class DebianChanges(deb822.Changes):
31
 
  """Abstraction of the .changes file. Use it to find out what files were 
32
 
  built."""
 
31
  """Abstraction of the .changes file used to find out what files were built."""
33
32
 
34
33
  def __init__(self, package, version, dir, arch=None):
35
34
    """
36
 
    >>> c = DebianChanges('bzr-builddeb', '0.1-1', None, 'i386')
 
35
    >>> import os.path
 
36
    >>> file_dir = os.path.dirname(__file__)
 
37
    >>> c = DebianChanges('bzr-builddeb', '0.1-1', file_dir, 'i386')
37
38
    >>> fs = c.files()
38
39
    >>> f = fs[0]
39
40
    >>> f['name']
57
58
      changes = os.path.join(dir,changes)
58
59
    mutter("Looking for %s", changes)
59
60
    if not os.path.exists(changes):
60
 
      raise DebianError("Could not find .changes file: %s" % changes)
 
61
      raise MissingChanges(changes)
61
62
    fp = open(changes)
62
63
    deb822.Changes.__init__(self, fp)
63
64
    self._filename = changes
64
 
    
 
65
 
65
66
  def files(self):
66
67
    return self['Files']
67
68
 
75
76
 
76
77
if __name__ == "__main__":
77
78
  _test()
78
 
  
 
79
 
79
80
# vim: ts=2 sts=2 sw=2