UpstreamSource: add 'archive_fmt' and 'compression' properties
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 9 Jul 2012 14:16:21 +0000 (17:16 +0300)
committerJun Wang <junbill.wang@samsung.com>
Wed, 27 Jan 2016 10:03:05 +0000 (18:03 +0800)
New properties for easily getting the archive format (tar, zip, ...) and
compression format (gzip, bzip2, ...) of the sources.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Conflicts:
gbp/pkg/__init__.py

gbp/pkg/__init__.py

index 0b20a9c..2ed43d0 100644 (file)
@@ -441,11 +441,25 @@ class UpstreamSource(object):
     @property
     def archive_fmt(self):
         """Archive format of the sources, e.g. 'tar'"""
+        """
+        >>> UpstreamSource('foo/bar.tar.gz').archive_fmt
+        'tar'
+        >>> UpstreamSource('foo.bar.zip').archive_fmt
+        'zip'
+        >>> UpstreamSource('foo.bar.baz').archive_fmt
+        """
         return self._archive_fmt
 
     @property
     def compression(self):
         """Compression format of the sources, e.g. 'gzip'"""
+        """
+        >>> UpstreamSource('foo/bar.tar.gz').compression
+        'gzip'
+        >>> UpstreamSource('foo.bar.zip').compression
+        >>> UpstreamSource('foo.bz2').compression
+        'bzip2'
+        """
         return self._compression
 
     @property