Exemple #1
0
 def _resolve_data(self, data):
     data['content'] = remove_all_non_printables(data['content'])
     utc = parse_timestring(data.get('created', ''))
     data['created'] = utc_to_local(utc)
     if data.get('type', None) == 'sys':
         return self._resolve_sys_data(data)
     return self._resolve_user_data(data)
Exemple #2
0
 def _resolve_data(self, data):
     data['content'] = remove_all_non_printables(data['content'])
     utc = parse_timestring(data.get('created', ''))
     data['created'] = utc_to_local(utc)
     if data.get('type', None) == 'sys':
         return self._resolve_sys_data(data)
     return self._resolve_user_data(data)
Exemple #3
0
 def _resolve_data(self, key, data):
     data['time'] = data.get('created', '')
     if key:
         # widget is `changed` (meaning unread) if it exists (this is an update with new data) or
         # if it was previously read
         data['changed'] = not self._was_read(key)
     data['content'] = remove_all_non_printables(data['content'])
     data['color'] = self._resolve_color(data)
     return key
Exemple #4
0
 def _resolve_data(self, data):
     utc = parse_timestring(data.get('created', ''))
     data['time'] = utc_to_local(utc)
     data['content'] = remove_all_non_printables(data['content'])
     #data['role'] = data.get('role', post_roles[0]['key']) or post_roles[0]['key']
     #data['role_text'] = data.get('role_text', anonymous_nick) or anonymous_nick
     icon = None
     if self.theme:
         data['theme'] = self.theme.key
         icon_index = data.get('icon', '')
         if isinstance(icon_index, int):
             icon, icolor = self.theme.get_icon_tuple(icon_index)
     if icon:
         data['icon'] = icon
         data['icon_color'] = icolor
     elif 'icon' in data:
         # if no icon was parsed, make sure to remove it and force
         # the widget to load the default icon
         del data['icon']
Exemple #5
0
 def _resolve_data(self, data):
     utc = parse_timestring(data.get('created', ''))
     data['time'] = utc_to_local(utc)
     data['content'] = remove_all_non_printables(data['content'])
     #data['role'] = data.get('role', post_roles[0]['key']) or post_roles[0]['key']
     #data['role_text'] = data.get('role_text', anonymous_nick) or anonymous_nick
     icon = None
     if self.theme:
         data['theme'] = self.theme.key
         icon_index = data.get('icon', '')
         if isinstance(icon_index, int):
             icon, icolor = self.theme.get_icon_tuple(icon_index)
     if icon:
         data['icon'] = icon
         data['icon_color'] = icolor
     elif 'icon' in data:
         # if no icon was parsed, make sure to remove it and force
         # the widget to load the default icon
         del data['icon']