diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2014-12-30 10:56:22 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2014-12-30 10:56:22 +0100 |
commit | b51ede52742e2b94c77b83959cda081bad9675dd (patch) | |
tree | 939d4357897c9b37eacfd60eb627c8c456b15d06 | |
parent | 7ec260bf257c3ca25b349ddb481d2f8b636f0056 (diff) | |
download | pygn-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.py | 2 | ||||
-rwxr-xr-x | pygm2n | 5 | ||||
-rwxr-xr-x | pygn2m | 6 | ||||
-rw-r--r-- | whitelist.py | 5 |
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) @@ -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: @@ -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) |