aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2014-12-30 10:56:22 +0100
committerMatěj Cepl <mcepl@cepl.eu>2014-12-30 10:56:22 +0100
commitb51ede52742e2b94c77b83959cda081bad9675dd (patch)
tree939d4357897c9b37eacfd60eb627c8c456b15d06
parent7ec260bf257c3ca25b349ddb481d2f8b636f0056 (diff)
downloadpygn-b51ede52742e2b94c77b83959cda081bad9675dd.tar.gz
Remove useless debug parameter (not used anywhere).
Also rename my email about problems with pygn to *.eml. Fix storing logfile in the current directory, instead of $HOME. Fixes #7
-rw-r--r--docs/mail2news-gateway.eml (renamed from docs/mail2news-gateway)0
-rw-r--r--news2mail.py2
-rwxr-xr-xpygm2n5
-rwxr-xr-xpygn2m6
-rw-r--r--whitelist.py5
5 files changed, 3 insertions, 15 deletions
diff --git a/docs/mail2news-gateway b/docs/mail2news-gateway.eml
index 1c57406..1c57406 100644
--- a/docs/mail2news-gateway
+++ b/docs/mail2news-gateway.eml
diff --git a/news2mail.py b/news2mail.py
index 49825fb..b396bc2 100644
--- a/news2mail.py
+++ b/news2mail.py
@@ -52,8 +52,6 @@ class news2mail(object):
self.article, self.headers, self.body = [], [], []
self.message = None
- self.debug = 1
-
def readfile(self):
self.message = email.message_from_file(sys.stdin)
diff --git a/pygm2n b/pygm2n
index 81561be..451c25a 100755
--- a/pygm2n
+++ b/pygm2n
@@ -51,7 +51,6 @@ def parse_cmdline():
parser.add_argument('-T', '--test', action='store_true',
help='test mode (not send article via NNTP)')
- parser.add_argument('-d', '--debug', action='store_true')
parser.add_argument('-V', '--verbose', action='store_true',
help='verbose output ' +
'(usefull with -T option for debugging)')
@@ -105,10 +104,6 @@ try:
if opt.verbose:
print(m2n.message.as_string())
- """phase 4:
- open smtp connection and send e-mail
- """
-
if len(m2n.headers) > 0 and len(m2n.message.get_payload()) > 0:
# wl.logmsg(m2n.heads_dict,wl.ACCEPT,owner)
if not opt.test:
diff --git a/pygn2m b/pygn2m
index ffe0573..b51dde3 100755
--- a/pygn2m
+++ b/pygn2m
@@ -44,8 +44,6 @@ def parse_cmdline():
parser.add_argument('-T', '--test',
help='test mode (not send article via SMTP)',
action='store_true')
- parser.add_argument('-d', '--debug',
- action='store_true')
parser.add_argument('-V', '--verbose', help='verbose output',
action='store_true')
@@ -85,12 +83,12 @@ try:
# check if n2m has some file prefercences set on commandline
if args.wlfile is None:
- wl = os.path.expanduser('~/pyg.whitelist')
+ wl = os.path.expanduser(os.path.join(os.path.dirname(__file__), 'pyg.whitelist'))
else:
wl = args.wlfile
if args.logfile is None:
- log = os.path.expanduser('~/pyg.log')
+ log = os.path.expanduser(os.path.join(os.path.dirname(__file__), 'pyg.log'))
else:
log = args.logfile
diff --git a/whitelist.py b/whitelist.py
index ea3f646..8d941b9 100644
--- a/whitelist.py
+++ b/whitelist.py
@@ -26,16 +26,13 @@ class whitelist(object):
"""
wl = {}
- debug = None
logf = None # filedescriptor
# constants
DENY = 0
ACCEPT = 1
- def __init__(self, wlfile='wl.pyg', logfile='pyg.log', debug=0):
-
- self.debug = debug
+ def __init__(self, wlfile='wl.pyg', logfile='pyg.log'):
try:
wlp.setfilebyname(wlfile)