Sunday, April 20, 2008

nlaunch3!

Finally, nlaunch3 is here. However, I've decided to package them into a Tar archive and upload them, since most web browsers don't do well with tabs: nlaunch3.

I've made some usability improvements, but the major improvement is the ability to have a $HOME/.nlaunch/nlaunchuser.py script, like this:

nlaunchuser.py

#!/usr/bin/python
import functions
import os
class Wikipedia(functions.NLaunchFunction):
browser = 'firefox'
def __call__(self, *args):
return functions.forkexec(self.browser, 'http://en.wikipedia.org/wiki/Special:Search?search=' + '+'.join(args).replace(' ', '+') + '&go=Go')
class Kanji(functions.NLaunchFunction):
gs = os.path.join(os.environ['HOME'], 'Documents', 'kanji.ps')
viewer = 'kghostview'
def __call__(self, *args):
print str(self.gs)
return functions.forkexec(self.viewer, self.gs)
def Print(*args):
for i in args: print i,

To add something, one may either define a callable class (not an object), or create a function.

No comments: