3 from twitter
.util
import printNicely
8 def detail_twitter_error(twitterException
):
10 Display Twitter Errors nicely
12 data
= twitterException
.response_data
14 for m
in data
.get('errors', dict()):
15 printNicely(yellow(m
.get('message')))
17 printNicely(yellow(data
))
20 def format_prefix(listname
='', keyword
=''):
22 Format the custom prefix
24 formattedPrefix
= c
['PREFIX']
25 owner
= '@' + c
['original_name']
29 formattedPrefix
= ''.join(formattedPrefix
.split('#owner'))
30 formattedPrefix
= ''.join(formattedPrefix
.split('#place'))
31 formattedPrefix
= ''.join(formattedPrefix
.split('#me'))
34 formattedPrefix
= ''.join(formattedPrefix
.split('#keyword'))
35 formattedPrefix
= ''.join(formattedPrefix
.split('#me'))
36 owner
, place
= listname
.split('/')
40 formattedPrefix
= ''.join(formattedPrefix
.split('#keyword'))
41 formattedPrefix
= ''.join(formattedPrefix
.split('#owner'))
42 formattedPrefix
= ''.join(formattedPrefix
.split('#place'))
44 formattedPrefix
= formattedPrefix
.replace('#owner', owner
)
45 formattedPrefix
= formattedPrefix
.replace('#place', place
)
46 formattedPrefix
= formattedPrefix
.replace('#keyword', keyword
)
47 formattedPrefix
= formattedPrefix
.replace('#me', '@' + c
['original_name'])
49 return formattedPrefix