Mercurial > vim
comparison runtime/ftplugin/debchangelog.vim @ 2152:b9e314fe473f
Updated runtime files.
author | Bram Moolenaar <bram@zimbu.org> |
---|---|
date | Fri, 14 May 2010 23:24:24 +0200 |
parents | 0b796e045c42 |
children | 454f314d0e61 |
comparison
equal
deleted
inserted
replaced
2151:ae22c450546c | 2152:b9e314fe473f |
---|---|
1 " Vim filetype plugin file (GUI menu, folding and completion) | 1 " Vim filetype plugin file (GUI menu, folding and completion) |
2 " Language: Debian Changelog | 2 " Language: Debian Changelog |
3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> | 3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> |
4 " Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de> | 4 " Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de> |
5 " Stefano Zacchiroli <zack@debian.org> | 5 " Stefano Zacchiroli <zack@debian.org> |
6 " Last Change: 2008-03-08 | 6 " Last Change: 2010-04-29 |
7 " License: GNU GPL, version 2.0 or later | 7 " License: GNU GPL, version 2.0 or later |
8 " URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/ftplugin/debchangelog.vim;hb=debian | 8 " URL: http://hg.debian.org/hg/pkg-vim/vim/raw-file/tip/runtime/ftplugin/debchangelog.vim |
9 | 9 |
10 " Bug completion requires apt-listbugs installed for Debian packages or | 10 " Bug completion requires apt-listbugs installed for Debian packages or |
11 " python-launchpad-bugs installed for Ubuntu packages | 11 " python-launchpadlib installed for Ubuntu packages |
12 | 12 |
13 if exists("b:did_ftplugin") | 13 if exists("b:did_ftplugin") |
14 finish | 14 finish |
15 endif | 15 endif |
16 let b:did_ftplugin=1 | 16 let b:did_ftplugin=1 |
327 endif | 327 endif |
328 let pkgsrc = DebGetPkgSrcName(line('.')) | 328 let pkgsrc = DebGetPkgSrcName(line('.')) |
329 python << EOF | 329 python << EOF |
330 import vim | 330 import vim |
331 try: | 331 try: |
332 from launchpadbugs import connector | 332 from launchpadlib.launchpad import Launchpad |
333 buglist = connector.ConnectBugList() | 333 from lazr.restfulclient.errors import HTTPError |
334 bl = list(buglist('https://bugs.launchpad.net/ubuntu/+source/%s' % vim.eval('pkgsrc'))) | 334 # login anonymously |
335 bl.sort(None, int) | 335 lp = Launchpad.login_anonymously('debchangelog.vim', 'production') |
336 liststr = '[' | 336 ubuntu = lp.distributions['ubuntu'] |
337 for bug in bl: | 337 try: |
338 liststr += "'#%d - %s'," % (int(bug), bug.summary.replace('\'', '\'\'')) | 338 sp = ubuntu.getSourcePackage(name=vim.eval('pkgsrc')) |
339 liststr += ']' | 339 status = ('New', 'Incomplete', 'Confirmed', 'Triaged', |
340 vim.command('silent let bug_lines = %s' % liststr) | 340 'In Progress', 'Fix Committed') |
341 tasklist = sp.searchTasks(status=status, order_by='id') | |
342 liststr = '[' | |
343 for task in tasklist: | |
344 bug = task.bug | |
345 liststr += "'#%d - %s'," % (bug.id, bug.title.replace('\'', '\'\'')) | |
346 liststr += ']' | |
347 vim.command('silent let bug_lines = %s' % liststr.encode('utf-8')) | |
348 except HTTPError: | |
349 pass | |
341 except ImportError: | 350 except ImportError: |
342 vim.command('echoerr \'python-launchpad-bugs needs to be installed to use Launchpad bug completion\'') | 351 vim.command('echoerr \'python-launchpadlib >= 1.5.4 needs to be installed to use Launchpad bug completion\'') |
343 EOF | 352 EOF |
344 else | 353 else |
345 if ! filereadable('/usr/sbin/apt-listbugs') | 354 if ! filereadable('/usr/sbin/apt-listbugs') |
346 echoerr 'apt-listbugs not found, you should install it to use Closes bug completion' | 355 echoerr 'apt-listbugs not found, you should install it to use Closes bug completion' |
347 return | 356 return |