[dak/master 2/2] docstrings
Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
daklib/formats.py | 41 ++++++++++++++++++++++++++++++++++++
daklib/lintian.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
daklib/srcformats.py | 33 +++++++++++++++++++++++++++++
docs/README.quotes | 30 --------------------------
4 files changed, 131 insertions(+), 30 deletions(-)
mode change 100644 => 100755 daklib/formats.py
mode change 100644 => 100755 daklib/lintian.py
mode change 100644 => 100755 daklib/srcformats.py
diff --git a/daklib/formats.py b/daklib/formats.py
old mode 100644
new mode 100755
index aaad271..edc8053
--- a/daklib/formats.py
+++ b/daklib/formats.py
@@ -1,3 +1,36 @@
+#!/usr/bin/python
+
+""" Helper functions for the various changes formats
+
+@contact: Debian FTPMaster <ftpmaster@debian.org>
+@copyright: 2009, 2010 Joerg Jaspert <joerg@debian.org>
+@copyright: 2009 Chris Lamb <lamby@debian.org>
+@license: GNU General Public License version 2 or later
+"""
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+################################################################################
+
+# <mhy> !!!!11111iiiiiioneoneoneone
+# <dak> mhy: Error: "!!!11111iiiiiioneoneoneone" is not a valid command.
+# <mhy> dak: oh shut up
+# <dak> mhy: Error: "oh" is not a valid command.
+
+################################################################################
+
from regexes import re_verwithext
from dak_exceptions import UnknownFormatError
@@ -12,6 +45,14 @@ def parse_format(txt):
(8, 4, 'hardy')
If the format doesn't match these forms, raises UnknownFormatError.
+
+ @type txt: string
+ @param txt: Format string to parse
+
+ @rtype: tuple
+ @return: Parsed format
+
+ @raise UnknownFormatError: Unknown Format: line
"""
format = re_verwithext.search(txt)
diff --git a/daklib/lintian.py b/daklib/lintian.py
old mode 100644
new mode 100755
index 3d1afc8..74530d1
--- a/daklib/lintian.py
+++ b/daklib/lintian.py
@@ -1,3 +1,51 @@
+#!/usr/bin/python
+
+""" Utility functions for lintian checks in dak
+
+@contact: Debian FTPMaster <ftpmaster@debian.org>
+@copyright: 2009, 2010 Joerg Jaspert <joerg@debian.org>
+@copyright: 2009 Chris Lamb <lamby@debian.org>
+@license: GNU General Public License version 2 or later
+"""
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+################################################################################
+
+# <mhy> I often wonder if we should use NSA bot or something instead and get dinstall
+# to send emails telling us about its progress :-)
+# <mhy> dinstall: I'm processing openoffice
+# <mhy> dinstall: I'm choking, please help me
+# <Ganneff> yeah. get floods in here, for 600 accepted packages.
+# <mhy> hehe
+# <Ganneff> im not sure the other opers will like it if i oper up the bot, just so it
+# can flood faster
+# <mhy> flood all debian related channels
+# <mhy> just to be safe
+# <Ganneff> /msg #debian-* dinstall: starting
+# <Ganneff> more interesting would be the first message in #debian, the next in
+# #d-devel, then #d-qa
+# <Ganneff> and expect people to monitor all.
+# <Ganneff> i bet we have enough debian channels to at least put the timestamps in
+# seperate channels each
+# <Ganneff> and if not - we can make it go multi-network
+# <Ganneff> first oftc, then opn, then ircnet, then - we will find some. quakenet anyone?
+# <mhy> I should know better than to give you ideas
+
+################################################################################
+
from regexes import re_parse_lintian
def parse_lintian_output(output):
@@ -6,6 +54,9 @@ def parse_lintian_output(output):
>>> list(parse_lintian_output('W: pkgname: some-tag path/to/file'))
[('W', 'pkgname', 'some-tag', 'path/to/file')]
+
+ @type output: string
+ @param output: The output from lintian
"""
for line in output.split('\n'):
@@ -17,6 +68,12 @@ def generate_reject_messages(parsed_tags, tag_definitions, log=lambda *args: arg
"""
Generates package reject messages by comparing parsed lintian output with
tag definitions. Returns a generator containing the reject messages.
+
+ @param parsed_tags: Parsed lintian tags as returned by L{parse_lintian_output}
+
+ @param tag_definitions: YAML.load lintian tag definitions to reject on
+
+ @return: Reject message(s), if any
"""
tags = set()
diff --git a/daklib/srcformats.py b/daklib/srcformats.py
old mode 100644
new mode 100755
index 7d7dd94..85ac701
--- a/daklib/srcformats.py
+++ b/daklib/srcformats.py
@@ -1,3 +1,36 @@
+#!/usr/bin/python
+
+""" Helper functions for the various source formats
+
+@contact: Debian FTPMaster <ftpmaster@debian.org>
+@copyright: 2009, 2010 Joerg Jaspert <joerg@debian.org>
+@copyright: 2009 Chris Lamb <lamby@debian.org>
+@license: GNU General Public License version 2 or later
+"""
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+################################################################################
+
+# <sgran> hey, I think something's wrong with your git repo
+# <sgran> when I git pulled this last time, I got something that looked almost
+# like python instead of dak
+# <mhy> sgran: slander
+# <sgran> sorry, I take it back, I've had a better look now
+
+################################################################################
import re
from dak_exceptions import UnknownFormatError
diff --git a/docs/README.quotes b/docs/README.quotes
index d6bd125..3568ae7 100644
--- a/docs/README.quotes
+++ b/docs/README.quotes
@@ -344,33 +344,3 @@ Canadians: This is a lighthouse. Your call.
<helix> elmo: I can't believe people pay you to fix computers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-<mhy> I often wonder if we should use NSA bot or something instead and get dinstall to send emails telling us about its progress :-)
-<mhy> dinstall: I'm processing openoffice
-<mhy> dinstall: I'm choking, please help me
-<Ganneff> yeah. get floods in here, for 600 accepted packages.
-<mhy> hehe
-<Ganneff> im not sure the other opers will like it if i oper up the bot, just so it can flood faster
-<mhy> flood all debian related channels
-<mhy> just to be safe
-<Ganneff> /msg #debian-* dinstall: starting
-<Ganneff> more interesting would be the first message in #debian, the next in #d-devel, then #d-qa
-<Ganneff> and expect people to monitor all.
-<Ganneff> i bet we have enough debian channels to at least put the timestamps in seperate channels each
-<Ganneff> and if not - we can make it go multi-network
-<Ganneff> first oftc, then opn, then ircnet, then - we will find some. quakenet anyone?
-<mhy> I should know better than to give you ideas
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-<mhy> !!!!11111iiiiiioneoneoneone
-<dak> mhy: Error: "!!!11111iiiiiioneoneoneone" is not a valid command.
-<mhy> dak: oh shut up
-<dak> mhy: Error: "oh" is not a valid command.
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-<sgran> hey, I think something's wrong with your git repo
-<sgran> when I git pulled this last time, I got something that looked almost like python instead of dak
-<mhy> sgran: slander
-<sgran> sorry, I take it back, I've had a better look now
--
1.6.5
Reply to: