<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#    This handler was originaly created by <NAME> (c) 2006 and updated by <NAME> (eulin)
#
#    This program can be distributed under the terms of the GNU GPL version 2 or later.
#    See the file COPYING.
#

import gnome
import gobject
from gettext import gettext as _

import re, cgi
import os.path
import dbus

import deskbar
from deskbar.Handler import SignallingHandler
from deskbar.Match import Match

#Edit this var for change the numer of output results
MAX_RESULTS = 10

def _check_requirements ():
	try:
		import dbus
		try :
			if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
				import dbus.glib
		except:
			return (deskbar.Handler.HANDLER_IS_NOT_APPLICABLE, "Python dbus.glib bindings not found.", None)
		return (deskbar.Handler.HANDLER_IS_HAPPY, None, None)
	except:<commit_msg>added check for tracker in activatable names list<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#    This handler was originaly created by <NAME> (c) 2006 and updated by <NAME> (eulin)
#
#    This program can be distributed under the terms of the GNU GPL version 2 or later.
#    See the file COPYING.
#

import gnome
import gobject
from gettext import gettext as _

import re, cgi
import os.path
import dbus

import deskbar
from deskbar.Handler import SignallingHandler
from deskbar.Match import Match

#Edit this var for change the numer of output results
MAX_RESULTS = 10

def _check_requirements ():
	try:
		import dbus
		try :
			if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
				import dbus.glib
			
			# Check that Tracker can be started via dbus activation, we will have trouble if it's not
			bus = dbus.SessionBus()
			proxy_obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
			dbus_iface = dbus.Interface(proxy_obj, 'org.freedesktop.DBus')
			activatables = dbus_iface.ListActivatableNames()
			if not "org.freedesktop.Tracker" in activatables:
				return (deskbar.Handler.HANDLER_IS_NOT_APPLICABLE, "Tracker is not activatable via dbus", None)	
				
		except:
			return (deskbar.Handler.HANDLER_IS_NOT_APPLICABLE, "Python dbus.glib bindings not found.", None)
		return (deskbar.Handler.HANDLER_IS_HAPPY, None, None)
	except:
{'fraction_non_alphanumeric': 0.09192825112107623, 'fraction_numerical': 0.013452914798206279, 'mean_word_length': 4.093607305936073, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5989219', 'n_tokens_mistral': 823, 'n_tokens_neox': 744, 'n_words': 252}