diff options
author | Nathan McCorkle <nmz787@bryan.svcs.cs.pdx.edu> | 2014-08-24 15:59:43 -0700 |
---|---|---|
committer | Nathan McCorkle <nmz787@bryan.svcs.cs.pdx.edu> | 2014-08-24 15:59:43 -0700 |
commit | c8ccef9fc4d04615e0d6d21f934626e530ed3a6a (patch) | |
tree | 531829fc23656ff4e75218a3650cb06bba20b806 | |
parent | d1738894a10df3571cb02c3eed1cedf911f9257f (diff) | |
download | paperbot-c8ccef9f.tar.gz paperbot-c8ccef9f.zip |
moved _log function creation to global scope
-rwxr-xr-x | modules/papers.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/papers.py b/modules/papers.py index fbe636f..53db176 100755 --- a/modules/papers.py +++ b/modules/papers.py @@ -17,6 +17,11 @@ logchannel = os.environ.get("LOGGING", None) proxy_list = [ {'proxy_url':None,'proxy_type':'normal'}, {'proxy_url':'http://localhost:8500/plsget', 'proxy_type':'custom_flask_json'} ] +if logchannel: + _log = lambda x: phenny.msg("#%s" % logchannel, x) +else: + _log = lambda x: None + class paperbot_proxy_request(object): @classmethod def get(*args, **kwargs): @@ -74,10 +79,7 @@ def download(phenny, input, verbose=True): """ Downloads a paper. """ - if logchannel: - _log = lambda x: phenny.msg("#%s" % logchannel, x) - else: - _log = lambda x: None + # only accept requests in a channel if not input.sender.startswith('#'): # unless the user is an admin, of course |