]>
jfr.im git - z_archive/twitter.git/blob - twitter/util.py
2 Internal utility functions.
4 `htmlentitydecode` came from here:
5 http://wiki.python.org/moin/EscapingHtml
10 from htmlentitydefs
import name2codepoint
12 def htmlentitydecode(s
):
14 '&(%s);' % '|'.join(name2codepoint
),
15 lambda m
: unichr(name2codepoint
[m
.group(1)]), s
)
17 def smrt_input(globals_
, locals_
, ps1
=">>> ", ps2
="... "):
24 inputs
.append(raw_input(prompt
))
26 ret
= eval('\n'.join(inputs
), globals_
, locals_
)
33 __all__
= ["htmlentitydecode", "smrt_input"]