diff options
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | cnucnu/__init__.py | 4 | ||||
-rw-r--r-- | cnucnu/bugzilla_reporter.py | 4 | ||||
-rw-r--r-- | cnucnu/checkshell.py | 4 | ||||
-rwxr-xr-x | cnucnu/config.py | 25 | ||||
-rwxr-xr-x | cnucnu/cvs.py | 4 | ||||
-rw-r--r-- | cnucnu/errors.py | 4 | ||||
-rw-r--r-- | cnucnu/helper.py | 4 | ||||
-rwxr-xr-x | cnucnu/mail.py | 4 | ||||
-rw-r--r-- | cnucnu/package_list.py | 20 | ||||
-rwxr-xr-x | cnucnu/tests/config_test.py | 4 | ||||
-rwxr-xr-x | cnucnu/tests/mail_test.py | 4 | ||||
-rwxr-xr-x | cnucnu/tests/package_list_test.py | 4 | ||||
-rwxr-xr-x | cnucnu/wiki.py | 4 |
14 files changed, 70 insertions, 31 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..052c446 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +html: FORCE + rm -rf html + epydoc --builtins --html --no-private --output html -v cnucnu/ + #find -type f -name "*.html" -print0 | xargs -0 sed -i 's,"encoding=iso8859-1",encoding="utf-8",' + +view: html + xdg-open html/index.html + +check-doc: + epydoc --check cnucnu/ + +FORCE: diff --git a/cnucnu/__init__.py b/cnucnu/__init__.py index f43b892..650e42d 100644 --- a/cnucnu/__init__.py +++ b/cnucnu/__init__.py @@ -1,4 +1,4 @@ -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -13,4 +13,4 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} diff --git a/cnucnu/bugzilla_reporter.py b/cnucnu/bugzilla_reporter.py index 25e36e0..d08426f 100644 --- a/cnucnu/bugzilla_reporter.py +++ b/cnucnu/bugzilla_reporter.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} from bugzilla import Bugzilla from config import Config diff --git a/cnucnu/checkshell.py b/cnucnu/checkshell.py index 5d92dc1..cff18f2 100644 --- a/cnucnu/checkshell.py +++ b/cnucnu/checkshell.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} import sys import cmd diff --git a/cnucnu/config.py b/cnucnu/config.py index 13910d0..af497df 100755 --- a/cnucnu/config.py +++ b/cnucnu/config.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,12 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} +""" :author: Till Maas + :contact: opensource@till.name + :license: GPLv2+ +""" +__docformat__ = "restructuredtext" from helper import pprint, filter_dict import yaml @@ -64,6 +69,8 @@ package list: """ class Config(object): + """ Config management class for cnucnu. + """ def __init__(self, yaml_file=None, yaml=None, yaml_data=None, config=None, load_default=True): # TODO: remove yaml option if yaml_data: @@ -102,6 +109,15 @@ class Config(object): return old def update(self, new, old=None): + """ Update dictionary with new values recursively. + + :Parameters: + new : dict + new dictionary + old : dict + old dictionary, defaults to self.config + + """ if not old: old = self.config for k, v in new.items(): @@ -115,11 +131,6 @@ class Config(object): self._bugzilla_config = {} return old - -# D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] = E[k] -# (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k] - - @property def bugzilla_config(self): if not self._bugzilla_config: diff --git a/cnucnu/cvs.py b/cnucnu/cvs.py index 29c0a0a..bc19d93 100755 --- a/cnucnu/cvs.py +++ b/cnucnu/cvs.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} # Options: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html diff --git a/cnucnu/errors.py b/cnucnu/errors.py index 01f7c04..2bbf7d8 100644 --- a/cnucnu/errors.py +++ b/cnucnu/errors.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} class CnuCnuError(Exception): Name = "" diff --git a/cnucnu/helper.py b/cnucnu/helper.py index f2d61de..ab81e34 100644 --- a/cnucnu/helper.py +++ b/cnucnu/helper.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} import pprint as pprint_module pp = pprint_module.PrettyPrinter(indent=4) diff --git a/cnucnu/mail.py b/cnucnu/mail.py index 7928973..eef02fb 100755 --- a/cnucnu/mail.py +++ b/cnucnu/mail.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} import smtplib from email.mime.text import MIMEText diff --git a/cnucnu/package_list.py b/cnucnu/package_list.py index fa2244d..7034aaf 100644 --- a/cnucnu/package_list.py +++ b/cnucnu/package_list.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,12 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} +""" :author: Till Maas + :contact: opensource@till.name + :license: GPLv2+ +""" +__docformat__ = "restructuredtext" import sys import re @@ -187,6 +192,17 @@ class Repository: class PackageList: def __init__(self, repo=None, mediawiki=False, packages=None): + """ A list of packages to be checked. + + :Parameters: + repo : `cnucnu.Repository` + Repository to compare with upstream + mediawiki : dict + Get a list of package names, urls and regexes from a mediawiki page defined in the dict. + packages : [cnucnu.Package] + List of packages to populate the package_list with + + """ if not repo: repo = Repository() diff --git a/cnucnu/tests/config_test.py b/cnucnu/tests/config_test.py index afa576b..4fb1985 100755 --- a/cnucnu/tests/config_test.py +++ b/cnucnu/tests/config_test.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} import unittest diff --git a/cnucnu/tests/mail_test.py b/cnucnu/tests/mail_test.py index 0be8d23..2947368 100755 --- a/cnucnu/tests/mail_test.py +++ b/cnucnu/tests/mail_test.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} import unittest diff --git a/cnucnu/tests/package_list_test.py b/cnucnu/tests/package_list_test.py index 20388e3..a19052a 100755 --- a/cnucnu/tests/package_list_test.py +++ b/cnucnu/tests/package_list_test.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} import unittest diff --git a/cnucnu/wiki.py b/cnucnu/wiki.py index 7b138d4..049136b 100755 --- a/cnucnu/wiki.py +++ b/cnucnu/wiki.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} import fedora.client |