View rsws-banned.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import logging | |
logging.basicConfig(filename='rsws.log',level=logging.DEBUG) | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
class S(BaseHTTPRequestHandler): | |
def _set_headers(self): |
View unittest_reportresource.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import logging | |
import time | |
import os | |
logger = logging.getLogger(__name__) | |
import plugins |
View test_a.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test_a.py | |
# in the bot, this represents the new hangups library | |
this_is_a_constant = 'ABCD' | |
def print_constant(): | |
print(repr(this_is_a_constant)) | |
View unittest_memoryusage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging, os, sys, resource | |
import psutil # pip3 install psutil | |
import plugins | |
logger = logging.getLogger(__name__) | |
View example_presence.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime, time | |
import hangups | |
import plugins | |
def _initialise(bot): | |
plugins.register_admin_command(["watermark", "typing"]) | |
def watermark(bot, event, *args): |
View testing_logging.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, logging | |
def _initialise(bot): | |
consoleHandler = logging.StreamHandler(stream=sys.stdout) | |
format = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | |
consoleHandler.setFormatter(format) | |
rootLogger = logging.getLogger() | |
rootLogger.addHandler(consoleHandler) |
View testing_convmem.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import plugins | |
from hangups.ui.utils import get_conv_name | |
convmem = {} | |
def _initialise(bot): | |
_memory_load(bot) |
View convtools_public.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hangups | |
import plugins | |
def _initialise(bot): | |
plugins.register_user_command(["public"]) | |
def public(bot, event, *args): | |
"""list all available public channels when called without any parameters. | |
to join a channel, call this command with the desired channel number""" |
View example_modern.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""standard plugin | |
more documentation: __wikilink__ | |
""" | |
import plugins | |
def _initialise(bot): | |
plugins.register_admin_command(["noop_standard"]) | |
plugins.register_handler(_handle_nothing) |
View wolframalpha.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
simple "ask" function for wolfram alpha data | |
* pip3 install wolframalpha | |
* get API KEY from http://products.wolframalpha.com/developers/ | |
* put API KEY in config.json:wolframalpha-apikey | |
""" | |
import wolframalpha | |
_internal = {} |
NewerOlder