From 8ff067d59e59f6f568b6245bc836933c794e833b Mon Sep 17 00:00:00 2001 From: werner mendizabal Date: Thu, 16 Jun 2011 15:43:58 -0500 Subject: [PATCH 1/6] fix unhandled error when pysmell is not installed --- pysmell.vim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pysmell.vim b/pysmell.vim index e8a079c..9714f77 100644 --- a/pysmell.vim +++ b/pysmell.vim @@ -34,12 +34,24 @@ if !exists('g:pysmell_matcher') endif python << eopython -from pysmell import vimhelper, idehelper import vim +try: + from pysmell import vimhelper, idehelper + vim.command('let g:pysmell_exists=1') +except: + pass + import string TRANSLATEQUOTES = string.maketrans("\'\"", "\"\'") eopython +if !exists('g:pysmell_exists') + if g:pysmell_debug == 1 + echo "Error: Required pysmell" + endif + finish +endif + function! pysmell#Complete(findstart, base) "findstart = 1 when we need to get the text length if a:findstart == 1 From fdaad503833486df1e964e5601013b5b99b237f1 Mon Sep 17 00:00:00 2001 From: werner mendizabal Date: Wed, 5 Oct 2011 14:21:42 -0500 Subject: [PATCH 2/6] create tags from settings.packages config --- setup.py | 20 ++++++++++++++++++++ tags/tag.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 tags/tag.py diff --git a/setup.py b/setup.py index eb576e7..974f6be 100644 --- a/setup.py +++ b/setup.py @@ -69,3 +69,23 @@ def run(self): ) + +setup(name='mktags', + version='0.1', + packages = ['tags'], + entry_points={ + 'console_scripts':[ + 'mktags = tags.tag:mktags', + ] + }, + ) + +setup(name='rmtags', + version='0.1', + packages = ['tags'], + entry_points={ + 'console_scripts':[ + 'rmtags = tags.tag:rmtags', + ] + }, + ) diff --git a/tags/tag.py b/tags/tag.py new file mode 100644 index 0000000..a92f9da --- /dev/null +++ b/tags/tag.py @@ -0,0 +1,30 @@ +from subprocess import * +import os +import sys +sys.path.append(os.path.abspath(os.path.curdir)) +import settings + +def run(command): + proc = Popen(command.split(' '), stdout=PIPE) + print proc.communicate()[0] + +def rmtags(): + run('rm tags') + + for root, dirs, files in os.walk('.'): + for name in files: + if name.startswith('PYSMELLTAGS') or name == 'tags': + run('rm {0}'.format(name)) + +def mktags(): + rmtags() + + path = '{0}/lib/python{1.major}.{1.minor}/site-packages'.format(os.environ['VIRTUAL_ENV'], sys.version_info) + #packages = ['fabric', ] + + for package in settings.packages: + run('ctags -aR %(path)s/%(package)s' % locals()) + run('pysmell -o PYSMELLTAGS.%(package)s %(path)s/%(package)s' % locals()) + + run('ctags -aR .') + run('pysmell .') From b40c6b0cd07c296e83b5a44ba4f4a1f1da269485 Mon Sep 17 00:00:00 2001 From: werner mendizabal Date: Wed, 5 Oct 2011 14:51:26 -0500 Subject: [PATCH 3/6] create tags from settings.packages config --- tags/tag.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tags/tag.py b/tags/tag.py index a92f9da..821b83f 100644 --- a/tags/tag.py +++ b/tags/tag.py @@ -9,8 +9,6 @@ def run(command): print proc.communicate()[0] def rmtags(): - run('rm tags') - for root, dirs, files in os.walk('.'): for name in files: if name.startswith('PYSMELLTAGS') or name == 'tags': From 73d6a6ca00d169cf40ce80b9bea7aa581ddfe434 Mon Sep 17 00:00:00 2001 From: werner mendizabal Date: Fri, 24 Feb 2012 13:33:38 -0600 Subject: [PATCH 4/6] add missing init file --- tags/__init__.py | 0 tags/tag.py | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tags/__init__.py diff --git a/tags/__init__.py b/tags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tags/tag.py b/tags/tag.py index 821b83f..7688f9f 100644 --- a/tags/tag.py +++ b/tags/tag.py @@ -6,7 +6,9 @@ def run(command): proc = Popen(command.split(' '), stdout=PIPE) - print proc.communicate()[0] + output = proc.communicate()[0] + if output.strip(): + print output def rmtags(): for root, dirs, files in os.walk('.'): From 6f8ec650320d3d7675699b0082022b43e1638ff8 Mon Sep 17 00:00:00 2001 From: werner mendizabal Date: Fri, 24 Feb 2012 13:40:01 -0600 Subject: [PATCH 5/6] add missing init file --- setup.py | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index 974f6be..980d3c1 100644 --- a/setup.py +++ b/setup.py @@ -70,22 +70,26 @@ def run(self): ) -setup(name='mktags', - version='0.1', - packages = ['tags'], - entry_points={ - 'console_scripts':[ - 'mktags = tags.tag:mktags', - ] - }, - ) +setup( + cmdclass={'install': install}, + name='mktags', + version='0.1', + packages = ['tags'], + entry_points={ + 'console_scripts':[ + 'mktags = tags.tag:mktags', + ] + }, +) -setup(name='rmtags', - version='0.1', - packages = ['tags'], - entry_points={ - 'console_scripts':[ - 'rmtags = tags.tag:rmtags', - ] - }, - ) +setup( + cmdclass={'install': install}, + name='rmtags', + version='0.1', + packages = ['tags'], + entry_points={ + 'console_scripts':[ + 'rmtags = tags.tag:rmtags', + ] + }, +) From 4568a0c45ed0a8a8e895ccfc36e95ad7b25b9a50 Mon Sep 17 00:00:00 2001 From: werner mendizabal Date: Sun, 26 Feb 2012 23:21:59 -0600 Subject: [PATCH 6/6] update to work with python 2.6 --- tags/tag.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tags/tag.py b/tags/tag.py index 7688f9f..6ae94ec 100644 --- a/tags/tag.py +++ b/tags/tag.py @@ -19,8 +19,7 @@ def rmtags(): def mktags(): rmtags() - path = '{0}/lib/python{1.major}.{1.minor}/site-packages'.format(os.environ['VIRTUAL_ENV'], sys.version_info) - #packages = ['fabric', ] + path = '{0}/lib/python{1}.{2}/site-packages'.format(os.environ['VIRTUAL_ENV'], *sys.version_info[:2]) for package in settings.packages: run('ctags -aR %(path)s/%(package)s' % locals())