Skip to content

Commit 4adc34e

Browse files
committed
Merge branch 'release/0.7.5b'
2 parents edb5b3b + eb4071a commit 4adc34e

File tree

11 files changed

+335
-131
lines changed

11 files changed

+335
-131
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Gemfile.lock
1010
VimFlavor.lock
1111
_
12+
build
1213
tags
1314
test.py
1415
todo.txt

Changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Changelog
22
=========
33

4-
## 2013-12-02 0.7.4b
4+
## 2013-12-02 0.7.5b
55
--------------------
66
* Update indentation support;
77
* Python3 support;

Makefile

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ PYLAMA = $(LIBS)/pylama
44

55
.PHONY: clean
66
clean:
7-
find . -name "*.pyc" -delete
7+
find $(CURDIR) -name "*.pyc" -delete
8+
rm -rf $(CURDIR)/build
9+
rm -rf *.deb
810

911
# Temporary disable rope tests on Travis
1012
.PHONY: travis
@@ -29,3 +31,37 @@ $(PYLAMA):
2931

3032
$(PYLAMA)/lint/pylama_pylint:
3133
cp -r ~/Dropbox/projects/pylama/plugins/pylama_pylint/pylama_pylint/ $(PYLAMA)/lint/pylama_pylint
34+
35+
$(CURDIR)/build:
36+
mkdir -p $(CURDIR)/build/usr/share/vim/addons
37+
mkdir -p $(CURDIR)/build/usr/share/vim/registry
38+
cp -r after autoload doc ftplugin plugin pymode syntax $(CURDIR)/build/usr/share/vim/addons/.
39+
cp -r python-mode.yaml $(CURDIR)/build/usr/share/vim/registry/.
40+
41+
TARGET?=$(CURDIR)/deb
42+
PACKAGE_VERSION?=$(shell git describe --tags `git rev-list master --tags --max-count=1`)
43+
PACKAGE_NAME="vim-python-mode"
44+
PACKAGE_MAINTAINER="Kirill Klenov <horneds@gmail.com>"
45+
PACKAGE_URL=http://github.com/klen/python-mode
46+
deb: clean $(CURDIR)/build
47+
@git co gh-pages
48+
@fpm -s dir -t deb -a all \
49+
-n $(PACKAGE_NAME) \
50+
-v $(PACKAGE_VERSION) \
51+
-m $(PACKAGE_MAINTAINER) \
52+
--url $(PACKAGE_URL) \
53+
--license "GNU lesser general public license" \
54+
--description "Vim-Swissknife for python" \
55+
--deb-user root \
56+
--deb-group root \
57+
-C $(CURDIR)/build \
58+
-d "python2.7" \
59+
-d "vim-addon-manager" \
60+
usr
61+
@mkdir -p $(TARGET)
62+
@prm --type deb --path $(TARGET) \
63+
--release precise,quantal,raring,saucy \
64+
--arch amd64,i386,all \
65+
--component main \
66+
--directory $(CURDIR) \
67+
--gpg horneds@gmail.com

README.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,28 @@ Then rebuild **helptags** in vim::
9595
must be enabled to use python-mode.
9696

9797

98+
Debian packages
99+
---------------
100+
101+
Repository URL: http://klen.github.io/python-mode/deb/
102+
Install with commands:
103+
104+
::
105+
106+
add-apt-repository http://klen.github.io/python-mode/deb main
107+
apt-get update
108+
apt-get install vim-python-mode
109+
110+
If you are getting the message: "The following signatures couldn' be verified because the public key is not available": ::
111+
112+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B5DF65307000E266
113+
114+
`vim-python-mode` using `vim-addons`, so after installation just enable
115+
`python-mode` with command: ::
116+
117+
vim-addons install python-mode
118+
119+
98120
Troubleshooting
99121
===============
100122

doc/pymode.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____) ~
77

88

9-
Version: 0.7.4b
9+
Version: 0.7.5b
1010

1111
==============================================================================
1212
CONTENTS *pymode-contents*

plugin/pymode.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
" vi: fdl=1
2-
let g:pymode_version = "0.7.4b"
2+
let g:pymode_version = "0.7.5b"
33

44
com! PymodeVersion echomsg "Current python-mode version: " . g:pymode_version
55
com! PymodeTroubleshooting call pymode#troubleshooting#test()

pylama.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[main]
2+
ignore = R0201,R0922,C0111,E1103

pylint.ini

Lines changed: 0 additions & 25 deletions
This file was deleted.

pymode/run.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run_code():
3333
# A false code will be treated as a
3434
# successful run, and the error will be hidden from Vim
3535
env.error("Script exited with code %s" % e.code)
36-
env.stop()
36+
return env.stop()
3737

3838
except Exception:
3939
import traceback
@@ -43,13 +43,9 @@ def run_code():
4343
err = sys.stderr.getvalue()
4444

4545
output = sys.stdout.getvalue().strip()
46+
output = env.prepare_value(output)
4647
sys.stdout, sys.stderr = stdout_, stderr_
4748

48-
try:
49-
output = output.decode('utf-8').encode(env.options.get('encoding'))
50-
except AttributeError:
51-
pass
52-
5349
errors += [er for er in err.splitlines() if er and "<string>" not in er]
5450

5551
env.let('l:traceback', errors[2:])

pymode/utils.py

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
""" Pymode utils. """
2-
import json
32
import os.path
43
import sys
54
import threading
@@ -18,92 +17,6 @@
1817
PY2 = sys.version_info[0] == 2
1918

2019

21-
def pymode_message(content):
22-
""" Show message. """
23-
24-
vim.command('call pymode#wide_message("%s")' % str(content))
25-
26-
27-
def pymode_confirm(yes=True, msg='Do the changes:'):
28-
""" Confirmation.
29-
30-
:return bool:
31-
32-
"""
33-
default = 'yes' if yes else 'no'
34-
action = pymode_input(msg, default)
35-
return action and 'yes'.startswith(action)
36-
37-
38-
def pymode_inputlist(msg, opts):
39-
""" Get user choice.
40-
41-
:return str: A choosen option
42-
43-
"""
44-
choices = ['[Pymode] %s' % msg]
45-
choices += ["%s. %s" % (num, opt) for num, opt in enumerate(opts, 1)]
46-
try:
47-
input_str = int(vim.eval('inputlist(%s)' % json.dumps(choices)))
48-
except (KeyboardInterrupt, ValueError):
49-
input_str = 0
50-
51-
if not input_str:
52-
pymode_message('Cancelled!')
53-
return False
54-
55-
try:
56-
return opts[input_str - 1]
57-
except (IndexError, ValueError):
58-
pymode_error('Invalid option: %s' % input_str)
59-
return pymode_inputlist(msg, opts)
60-
61-
62-
def pymode_input(umsg, udefault='', opts=None):
63-
""" Get user input.
64-
65-
:return str: A user input
66-
67-
"""
68-
msg = '[Pymode] %s ' % umsg
69-
default = udefault
70-
71-
if default != '':
72-
msg += '[%s] ' % default
73-
74-
try:
75-
vim.command('echohl Debug')
76-
input_str = vim.eval('input("%s> ")' % msg)
77-
vim.command('echohl none')
78-
except KeyboardInterrupt:
79-
input_str = ''
80-
81-
return input_str or default
82-
83-
84-
def pymode_error(content):
85-
""" Show error. """
86-
87-
vim.command('call pymode#error("%s")' % str(content))
88-
89-
90-
def catch_and_print_exceptions(func):
91-
""" Catch any exception.
92-
93-
:return func:
94-
95-
"""
96-
def wrapper(*args, **kwargs):
97-
try:
98-
return func(*args, **kwargs)
99-
except (Exception, vim.error) as e: # noqa
100-
if DEBUG:
101-
raise
102-
pymode_error(e)
103-
return None
104-
return wrapper
105-
106-
10720
@contextmanager
10821
def silence_stderr():
10922
""" Redirect stderr. """
@@ -127,12 +40,3 @@ def patch_paths():
12740
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'libs2'))
12841
else:
12942
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'libs3'))
130-
131-
132-
debug = lambda _: None
133-
134-
if DEBUG:
135-
def debug(msg): # noqa
136-
""" Debug message. """
137-
138-
print(msg)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy