]>
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
11 from html
.entities
import name2codepoint
13 from htmlentitydefs
import name2codepoint
15 def htmlentitydecode(s
):
17 '&(%s);' % '|'.join(name2codepoint
),
18 lambda m
: chr(name2codepoint
[m
.group(1)]), s
)
20 def smrt_input(globals_
, locals_
, ps1
=">>> ", ps2
="... "):
27 inputs
.append(input(prompt
))
29 ret
= eval('\n'.join(inputs
), globals_
, locals_
)
36 __all__
= ["htmlentitydecode", "smrt_input"]