summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorYaakov Nemoy <loupgaroublond@gmail.com>2008-10-01 19:50:34 -0400
committerYaakov M. Nemoy <loupgaroublond@gmail.com>2008-10-01 19:50:34 -0400
commitcfb2820e1051de15e37c4a3d12be9b5514f81610 (patch)
tree45f5706906db6ee17542da263ebf79b9695a6228 /modules
parent7810e072debc0255de3135874e5c46f156f52d4a (diff)
downloadfedora-devshell-cfb2820e1051de15e37c4a3d12be9b5514f81610.tar.gz
fedora-devshell-cfb2820e1051de15e37c4a3d12be9b5514f81610.tar.xz
fedora-devshell-cfb2820e1051de15e37c4a3d12be9b5514f81610.zip
Breaks everything up into seperate files.
I had a problem where having Module in the local namespace was not the same as having Module in the non local namespace (via an import). Somehow breaking it down this way seemed simpler.
Diffstat (limited to 'modules')
-rw-r--r--modules/audit.py6
-rw-r--r--modules/bugs.py4
-rw-r--r--modules/mail.py7
-rw-r--r--modules/pkg.py9
4 files changed, 18 insertions, 8 deletions
diff --git a/modules/audit.py b/modules/audit.py
index 5e89f53..fccd494 100644
--- a/modules/audit.py
+++ b/modules/audit.py
@@ -1,9 +1,11 @@
+from base.module import Module
-
-class Audit:
+class Audit(Module):
""" Perform various code audits on a specified Pkg """
tools = ['flawfinder', 'rats']
def __init__(self, pkg):
""" @param pkg: a Pkg instance """
+
+__all__ = ['Audit']
diff --git a/modules/bugs.py b/modules/bugs.py
index 359a06e..19dbb70 100644
--- a/modules/bugs.py
+++ b/modules/bugs.py
@@ -1,6 +1,7 @@
import os
+from base.module import Module
-class Bugs:
+class Bugs(Module):
"""
Interface for doing useful things with Bugs.
TODO: add support for arbitrary bug trackers!
@@ -22,3 +23,4 @@ class Bugs:
"""
os.system('firefox "https://bugzilla.redhat.com/buglist.cgi?query_format=specific&order=bugs.bug_id&bug_status=__open__&product=&content=%s"' % text)
+__all__ = ['Bugs'] \ No newline at end of file
diff --git a/modules/mail.py b/modules/mail.py
index 790845d..9a2532a 100644
--- a/modules/mail.py
+++ b/modules/mail.py
@@ -10,11 +10,12 @@ from os.path import join, exists, dirname, isdir
from mailbox import UnixMailbox
from datetime import datetime, timedelta
-from devshell import DEVSHELL_DIR
+from base.vars import DEVSHELL_DIR
+from base.module import Module
log = logging.getLogger(__name__)
-class Mail:
+class Mail(Module):
""" A module for searching/viewing mailing lists """
url = 'https://www.redhat.com/archives/%s/%s'
@@ -114,3 +115,5 @@ class Mail:
log.info("To: %s" % msg['To'])
log.info("Subject: %s" % msg['Subject'])
log.info('\n'.join(self.__body(msg)))
+
+__all__ = ['Mail'] \ No newline at end of file
diff --git a/modules/pkg.py b/modules/pkg.py
index a748b92..d586795 100644
--- a/modules/pkg.py
+++ b/modules/pkg.py
@@ -2,7 +2,8 @@ import os
import commands
from os.path import isdir, join
-from devshell import FEDORA_DIR
+from base.vars import FEDORA_DIR
+from base.module import Module
# Hack-filled at the moment.
@@ -24,10 +25,10 @@ class CannotFindPackage(Exception):
pass
#FIXME: use this?
-class SCM:
+class SCM(object):
cmds = dict(update='update', clone='clone', log='log', diff='diff')
-class Package(object):
+class Source(Module):
def __init__(self, name, branch='devel'):
self.name = name
@@ -130,3 +131,5 @@ class Package(object):
def bugs(self):
raise NotImplementedError
+
+__all__ = ['Source'] \ No newline at end of file