def test_get_desktop_id(self): self.assertEqual( get_desktop_id("/usr/share/applications/ubuntu-software-center.desktop"), "ubuntu-software-center.desktop" ) self.assertEqual(get_desktop_id("/usr/share/applications/kde4-anyapp.desktop"), "kde4-anyapp.desktop") self.assertEqual(get_desktop_id("/usr/share/applications/kde4/anyapp.desktop"), "kde4-anyapp.desktop") self.assertEqual(get_desktop_id("/my/own/path/application.desktop"), "/my/own/path/application.desktop")
def test_get_desktop_id(self): self.assertEqual( get_desktop_id( "/usr/share/applications/ubuntu-software-center.desktop"), "ubuntu-software-center.desktop") self.assertEqual( get_desktop_id("/usr/share/applications/kde4-anyapp.desktop"), "kde4-anyapp.desktop") self.assertEqual( get_desktop_id("/usr/share/applications/kde4/anyapp.desktop"), "kde4-anyapp.desktop") self.assertEqual(get_desktop_id("/my/own/path/application.desktop"), "/my/own/path/application.desktop")
def __create_app_subject(self, desktop_file): subject = ZeitgeistSubject() subject.interpretation = ZeitgeistDataModel.Interpretation.SOFTWARE subject.manifestation = ZeitgeistDataModel.Manifestation.SOFTWARE_ITEM subject.uri = APPLICATION_URI_PREFIX + get_desktop_id(desktop_file) subject.current_uri = subject.uri subject.mimetype = "application/x-desktop" return subject
def __create_app_subject(self, desktop_file): subject = ZeitgeistSubject() subject.interpretation = ZeitgeistDataModel.Interpretation.SOFTWARE subject.manifestation = ZeitgeistDataModel.Manifestation.SOFTWARE_ITEM subject.uri = APPLICATION_URI_PREFIX + get_desktop_id(desktop_file); subject.current_uri = subject.uri subject.mimetype = "application/x-desktop" return subject