##// END OF EJS Templates
Fix rpmlint: incorrect-fsf-address...
Fix rpmlint: incorrect-fsf-address """ The Free Software Foundation address in this file seems to be outdated or misspelled. Ask upstream to update the address, or if this is a license file, possibly the entire file with a new copy available from the FSF. """ Replacing it with the correct one.

File last commit:

r2267:928c921b
r4456:e9b1ebbf
Show More
ipy_gnuglobal.py
38 lines | 891 B | text/x-python | PythonLexer
#!/usr/bin/env python
"""
Add %global magic for GNU Global usage.
http://www.gnu.org/software/global/
"""
from IPython.core import ipapi
ip = ipapi.get()
import os
# alter to your liking
global_bin = 'd:/opt/global/bin/global'
def global_f(self,cmdline):
simple = 0
if '-' not in cmdline:
cmdline = '-rx ' + cmdline
simple = 1
lines = [l.rstrip() for l in os.popen( global_bin + ' ' + cmdline ).readlines()]
if simple:
parts = [l.split(None,3) for l in lines]
lines = ['%s [%s]\n%s' % (p[2].rjust(70),p[1],p[3].rstrip()) for p in parts]
print "\n".join(lines)
ip.define_magic('global', global_f)
def global_completer(self,event):
compl = [l.rstrip() for l in os.popen(global_bin + ' -c ' + event.symbol).readlines()]
return compl
ip.set_hook('complete_command', global_completer, str_key = '%global')