Robert Jakubowicz
Robert Jakubowicz

Reputation: 338

What is {!text!} in Python?

What do {!info!} and {!input!} do in this python code?

s += " {!info!}Down Speed: {!input!}%s" % common.fspeed(status["download_payload_rate"])

Taken from: http://git.deluge-torrent.org/deluge/tree/deluge/ui/console/commands/info.py?h=1.3-stable

Thanks.

Upvotes: 2

Views: 243

Answers (1)

hobbs
hobbs

Reputation: 240424

They don't mean anything to Python. The string s will literally contain {!info!}and {!input!}. However, that string is later interpreted by Deluge itself to do color formatting — see ui/console/colors.py, specifically parse_color_string.

Upvotes: 8

Related Questions