comparison cagou/plugins/plugin_wid_chat.py @ 418:8a9bfe3fb9c6

chat: use constant instead of hard-coded string for C.MESS_KEY_MEDIA_TYPE
author Goffi <goffi@goffi.org>
date Sun, 23 Feb 2020 17:49:53 +0100
parents 5b50b7ef2617
children 13884aac1220
comparison
equal deleted inserted replaced
417:5b50b7ef2617 418:8a9bfe3fb9c6
97 class AttachmentItem(BoxLayout): 97 class AttachmentItem(BoxLayout):
98 data = properties.DictProperty() 98 data = properties.DictProperty()
99 progress = properties.NumericProperty(0) 99 progress = properties.NumericProperty(0)
100 100
101 def get_symbol(self, data): 101 def get_symbol(self, data):
102 media_type = data.get('media_type', '') 102 media_type = data.get(C.MESS_KEY_MEDIA_TYPE, '')
103 main_type = media_type.split('/', 1)[0] 103 main_type = media_type.split('/', 1)[0]
104 if main_type == 'image': 104 if main_type == 'image':
105 return "file-image" 105 return "file-image"
106 elif main_type == 'video': 106 elif main_type == 'video':
107 return "file-video" 107 return "file-video"