Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(19) | Call(0) | Derive(0) | Import(19)
src/w/i/willie-4.3.0/willie/modules/unicode_info.py willie(Download)
""" import unicodedata from willie.module import commands, example, NOLIMIT
def codepoint(bot, trigger): arg = trigger.group(2).strip() if len(arg) == 0: bot.reply('What code point do you want me to look up?') return NOLIMIT
except: bot.reply("That's not a valid code point.") return NOLIMIT # Get the hex value for the code point, and drop the 0x from the front
src/w/i/willie-HEAD/willie/modules/unicode_info.py willie(Download)
import unicodedata import sys from willie.module import commands, example, NOLIMIT if sys.version_info.major >= 3:
def codepoint(bot, trigger): arg = trigger.group(2).strip() if len(arg) == 0: bot.reply('What code point do you want me to look up?') return NOLIMIT
except: bot.reply("That's not a valid code point.") return NOLIMIT # Get the hex value for the code point, and drop the 0x from the front
src/w/i/willie-4.3.0/willie/modules/reddit-info.py willie(Download)
""" from willie.module import commands, rule, example, NOLIMIT from willie import tools import praw
if commanded: bot.say('No such Redditor.') return NOLIMIT else: return
src/w/i/willie-HEAD/willie/modules/reddit-info.py willie(Download)
from __future__ import unicode_literals from willie.module import commands, rule, example, NOLIMIT from willie import tools import praw
if commanded: bot.say('No such Redditor.') return NOLIMIT else: return
src/w/i/willie-4.3.0/willie/modules/github.py willie(Download)
import json from willie import web, tools from willie.module import commands, rule, NOLIMIT import os import re
except HTTPError: bot.say('The GitHub API returned an error.') return NOLIMIT data = json.loads(raw)
except OSError: # HTTPError: bot.say('The GitHub API returned an error.') return NOLIMIT data = json.loads(raw)
except HTTPError: bot.say('The GitHub API returned an error.') return NOLIMIT try:
'always') bot.say('Invalid result, please try again later.') return NOLIMIT bot.reply('[#%s]\x02title:\x02 %s \x02|\x02 %s' % (data['number'], data['title'], body)) bot.say(data['html_url'])
src/w/i/willie-HEAD/willie/modules/github.py willie(Download)
import json from willie import web, tools from willie.module import commands, rule, NOLIMIT import os import re
except HTTPError: bot.say('The GitHub API returned an error.') return NOLIMIT data = json.loads(raw)
except OSError: # HTTPError: bot.say('The GitHub API returned an error.') return NOLIMIT data = json.loads(raw)
except HTTPError: bot.say('The GitHub API returned an error.') return NOLIMIT try:
'always') bot.say('Invalid result, please try again later.') return NOLIMIT bot.reply('[#%s]\x02title:\x02 %s \x02|\x02 %s' % (data['number'], data['title'], body)) bot.say(data['html_url'])
src/w/i/willie-4.3.0/willie/modules/wikipedia.py willie(Download)
""" from willie import web from willie.module import NOLIMIT, commands, example import json import re
if trigger.group(2) is None: bot.reply("What do you want me to look up?") return NOLIMIT query = trigger.group(2)
if not query: bot.reply('What do you want me to look up?') return NOLIMIT server = lang + '.wikipedia.org' query = mw_search(server, query, 1) if not query: bot.reply("I can't find any results for that.") return NOLIMIT
src/w/i/willie-4.3.0/willie/modules/currency.py willie(Download)
from willie import web from willie.module import commands, example, NOLIMIT
# It's apologetic, because it's using Canadian data. bot.reply("Sorry, I didn't understand the input.") return NOLIMIT amount, of, to = match.groups()
raise bot.reply("Something went wrong while I was getting the exchange rate.") return NOLIMIT result = amount / of_rate * to_rate
except: bot.reply("Sorry, I didn't understand the input.") return NOLIMIT display(bot, amount, 'BTC', to)
src/w/i/willie-HEAD/willie/modules/wikipedia.py willie(Download)
from __future__ import unicode_literals from willie import web from willie.module import NOLIMIT, commands, example import json import re
if trigger.group(2) is None: bot.reply("What do you want me to look up?") return NOLIMIT query = trigger.group(2)
if not query: bot.reply('What do you want me to look up?') return NOLIMIT server = lang + '.wikipedia.org' query = mw_search(server, query, 1) if not query: bot.reply("I can't find any results for that.") return NOLIMIT
src/w/i/willie-HEAD/willie/modules/units.py willie(Download)
""" from __future__ import unicode_literals, division from willie.module import commands, example, NOLIMIT import re
except (AttributeError, TypeError): bot.reply("That's not a valid temperature.") return NOLIMIT unit = source[1].upper() numeric = float(source[0])
except (AttributeError, TypeError): bot.reply("That's not a valid length unit.") return NOLIMIT unit = source[1].lower() numeric = float(source[0])
except (AttributeError, TypeError): bot.reply("That's not a valid mass unit.") return NOLIMIT unit = source[1].lower() numeric = float(source[0])
1 | 2 | 3 Next