mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Converted to not use the new module but the types module instead.
This commit is contained in:
parent
8d04bdbcb6
commit
bc6f4bd149
@ -36,8 +36,8 @@ Allows 'aliases' for other commands.
|
||||
import plugins
|
||||
|
||||
import re
|
||||
import new
|
||||
import sets
|
||||
import types
|
||||
|
||||
import conf
|
||||
import debug
|
||||
@ -148,7 +148,8 @@ def makeNewAlias(name, alias):
|
||||
alias_ = atRe.sub(replace, alias_)
|
||||
alias_ = alias_.replace('$*', ' '.join(map(utils.dqrepr, args)))
|
||||
self.Proxy(irc.irc, msg, callbacks.tokenize(alias_))
|
||||
f = new.function(f.func_code, f.func_globals, name, closure=f.func_closure)
|
||||
f = types.FunctionType(f.func_code, f.func_globals,
|
||||
name, closure=f.func_closure)
|
||||
f.__doc__ ='<an alias, %s>\n\nAlias for %r' % \
|
||||
(utils.nItems(biggestDollar, 'argument'), alias)
|
||||
return f
|
||||
|
@ -36,9 +36,9 @@ Various math-related commands.
|
||||
import plugins
|
||||
|
||||
import re
|
||||
import new
|
||||
import math
|
||||
import cmath
|
||||
import types
|
||||
import string
|
||||
from itertools import imap
|
||||
|
||||
@ -77,7 +77,7 @@ class Math(callbacks.Privmsg):
|
||||
# Then we delete all square brackets, underscores, and whitespace, so no
|
||||
# one can do list comprehensions or call __...__ functions.
|
||||
###
|
||||
_mathEnv = {'__builtins__': new.module('__builtins__'), 'i': 1j}
|
||||
_mathEnv = {'__builtins__': types.ModuleType('__builtins__'), 'i': 1j}
|
||||
_mathEnv.update(math.__dict__)
|
||||
_mathEnv.update(cmath.__dict__)
|
||||
_mathRe = re.compile(r'((?:(?<![A-Fa-f\d])-)?'
|
||||
@ -207,7 +207,7 @@ class Math(callbacks.Privmsg):
|
||||
s = ', '.join(imap(self._complexToString, imap(complex, stack)))
|
||||
irc.reply(msg, 'Stack: [%s]' % s)
|
||||
|
||||
_convertEnv = {'__builtins__': new.module('__builtins__')}
|
||||
_convertEnv = {'__builtins__': types.ModuleType('__builtins__')}
|
||||
for (k, v) in unum.units.__dict__.iteritems():
|
||||
if isinstance(v, unum.Unum):
|
||||
_convertEnv[k.lower()] = v
|
||||
|
Loading…
Reference in New Issue
Block a user