aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-07-30 10:17:25 +0200
committerGuido Günther <agx@sigxcpu.org>2011-07-30 14:38:32 +0200
commit1804b1f64d33291f1b6832384d56a7ed16fa47e6 (patch)
tree0b8ba7b28b4039ddb2954691701b8552e2b228e8
parent2fbac773f79a4c6cf074e29804244ea90b9b1cb4 (diff)
Epydoc indentation
Git-Dch: Ignore
-rw-r--r--gbp/deb.py11
-rw-r--r--gbp/git.py4
-rw-r--r--gbp/pq.py10
3 files changed, 17 insertions, 8 deletions
diff --git a/gbp/deb.py b/gbp/deb.py
index ffd1508b..a45f18cf 100644
--- a/gbp/deb.py
+++ b/gbp/deb.py
@@ -407,6 +407,7 @@ def orig_file(cp, compression):
def is_native(cp):
"""
Is this a debian native package
+
>>> is_native(dict(Version="1"))
True
>>> is_native(dict(Version="1-1"))
@@ -425,6 +426,7 @@ def is_valid_upstreamversion(version):
def get_compression(orig_file):
"""
Given an orig file return the compression used
+
>>> get_compression("abc.tar.gz")
'gzip'
>>> get_compression("abc.tar.bz2")
@@ -492,14 +494,15 @@ def parse_uscan(out):
downloaded and could be located. If the tarball can't be located it returns
(True, None). Returns (False, None) if the current version is up to date.
- @param out: uscan output
- @type out: string
- @return: status and tarball name
- @rtype: tuple
>>> parse_uscan("<status>up to date</status>")
(False, None)
>>> parse_uscan("<target>virt-viewer_0.4.0.orig.tar.gz</target>")
(True, '../virt-viewer_0.4.0.orig.tar.gz')
+
+ @param out: uscan output
+ @type out: string
+ @return: status and tarball name
+ @rtype: tuple
"""
source = None
if "<status>up to date</status>" in out:
diff --git a/gbp/git.py b/gbp/git.py
index 06264b4b..11c027ec 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -645,6 +645,7 @@ def create_repo(path):
def build_tag(format, version):
"""Generate a tag from a given format and a version
+
>>> build_tag("debian/%(version)s", "0:0~0")
'debian/0%0_0'
"""
@@ -653,6 +654,7 @@ def build_tag(format, version):
def __sanitize_version(version):
"""sanitize a version so git accepts it as a tag
+
>>> __sanitize_version("0.0.0")
'0.0.0'
>>> __sanitize_version("0.0~0")
@@ -667,6 +669,7 @@ def __sanitize_version(version):
def tag_to_version(tag, format):
"""Extract the version from a tag
+
>>> tag_to_version("upstream/1%2_3-4", "upstream/%(version)s")
'1:2~3-4'
>>> tag_to_version("foo/2.3.4", "foo/%(version)s")
@@ -684,6 +687,7 @@ def tag_to_version(tag, format):
def rfc822_date_to_git(rfc822_date):
"""Parse a date in RFC822 format, and convert to a 'seconds tz' string.
+
>>> rfc822_date_to_git('Thu, 1 Jan 1970 00:00:01 +0000')
'1 +0000'
>>> rfc822_date_to_git('Thu, 20 Mar 2008 01:12:57 -0700')
diff --git a/gbp/pq.py b/gbp/pq.py
index 39eb6a07..9cb85ae2 100644
--- a/gbp/pq.py
+++ b/gbp/pq.py
@@ -63,10 +63,6 @@ class PatchQueue(list):
def _read_series(klass, series, patch_dir):
"""
Read patch series
- @param series: series of patches in quilt format
- @type series: iterable of strings
- @param patch_dir: path prefix to prepend to each patch path
- @type patch_dir: string
>>> PatchQueue._read_series(['a/b', \
'a -p1', \
@@ -74,6 +70,11 @@ class PatchQueue(list):
[<gbp.pq.Patch path='./a/b' topic='a' >,
<gbp.pq.Patch path='./a' strip=1 >,
<gbp.pq.Patch path='./a/b' topic='a' strip=2 >]
+
+ @param series: series of patches in quilt format
+ @type series: iterable of strings
+ @param patch_dir: path prefix to prepend to each patch path
+ @type patch_dir: string
"""
queue = PatchQueue()
@@ -85,6 +86,7 @@ class PatchQueue(list):
def _get_topic(line):
"""
Get the topic from the path's path
+
>>> PatchQueue._get_topic("a/b c")
'a'
>>> PatchQueue._get_topic("asdf")