I'd like to create a custom scope that searches and returns results from an online source for personal use.
Is this possible? And if so, how?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
For development in python:
Update for 12.04:
Unity lens development with singlet has been integrated into quickly:
quickly create unity-lens <lens-name>
A simple hello world lens would look like this:
#! /usr/bin/python from singlet.lens import SingleScopeLens, IconViewCategory from singlet.utils import run_lens class HelloWorldLens(SingleScopeLens): class Meta: name = 'helloworld' cat1 = IconViewCategory("Cat One", "stock_yet") def search(self, phrase, results): results.append('http://google.com/search?q=%s' % phrase, 'file', self.cat1, "text/html", phrase, phrase, '') if __name__ == "__main__": import sys run_lens(HelloLens, sys.argv)
Which is a lot simpler and faster to write than the original library versions.