Exemple #1
0
 def _metadata( self, suggestion ):
   target = os.path.join(self._filepath, suggestion[1])
   time_string = util.relative_time(os.stat(target).st_mtime)
   highlight = suggestion[0] + "\nMODIFY " + time_string
   if self._git and (suggestion[1] in self._git_files):
     index = self._git_files.index(suggestion[1])
     highlight += self._git_string(index)
   return (self._token_string( suggestion[1] ), highlight, suggestion[1])
Exemple #2
0
 def _metadata( self, suggestion ):
   target = os.path.join(self._filepath, suggestion[1])
   time_string = util.relative_time(os.stat(target).st_mtime)
   highlight = "<span size='x-large'>" + suggestion[0] + "</span>\n" + self._token_string( suggestion[1] ) + "MODIFY " + time_string
   if self._git and (suggestion[1] in self._git_files):
     index = self._git_files.index(suggestion[1])
     highlight += self._git_string(index)
   file_icon = gio.File(os.path.join(self._filepath, suggestion[1])).query_info('standard::icon').get_icon()
   icon = gtk.icon_theme_get_default().lookup_by_gicon(file_icon, 40, gtk.ICON_LOOKUP_USE_BUILTIN)
   return (icon and icon.load_icon(), highlight, suggestion[1])
Exemple #3
0
 def _metadata( self, suggestion ):
   target = os.path.join(self._filepath, suggestion[1])
   time_string = util.relative_time(os.stat(target).st_mtime)
   highlight = "<span size='x-large'>" + suggestion[0] + "</span>\n" + self._token_string( suggestion[1] ) + "MODIFY " + time_string
   if self._git and (suggestion[1] in self._git_files):
     index = self._git_files.index(suggestion[1])
     highlight += self._git_string(index)
   file_icon = Gio.file_new_for_path(os.path.join(self._filepath, suggestion[1])).query_info('standard::icon', Gio.FileQueryInfoFlags.NONE, None).get_icon()
   icon = Gtk.IconTheme.get_default().lookup_by_gicon(file_icon, 40, Gtk.IconLookupFlags.USE_BUILTIN)
   return (icon and icon.load_icon(), highlight, suggestion[1])
Exemple #4
0
 def _metadata( self, suggestion ):
   target = os.path.join(self._filepath, suggestion[1])
   time_string = util.relative_time(os.stat(target).st_mtime)
   highlight = "<span size='x-large'>" + suggestion[0] + "</span>\n" + self._token_string( suggestion[1] ) + "MODIFY " + time_string
   if self._git and (suggestion[1] in self._git_files):
     index = self._git_files.index(suggestion[1])
     highlight += self._git_string(index)
   file_icon = gio.File(os.path.join(self._filepath, suggestion[1])).query_info('standard::icon').get_icon()
   icon = gtk.icon_theme_get_default().lookup_by_gicon(file_icon, 40, gtk.ICON_LOOKUP_USE_BUILTIN)
   return (icon and icon.load_icon(), highlight, suggestion[1])