summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hahler2016-09-04 01:41:15 +0200
committerDaniel Hahler2016-09-04 01:41:37 +0200
commitecadcc904639bf9fb0590455bce3025a4212593d (patch)
treeae65e5c3f600d36ae47863cdbbd10a8905f0ce17
parentad2367eddd87597c9a1e657080d105c56a08935b (diff)
downloadaur-ecadcc904639bf9fb0590455bce3025a4212593d.tar.gz
Create python-fancycompleter based on python2-fancycompleter
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD17
-rw-r--r--fix-py3-unicode-str.patch22
-rw-r--r--python-fancycompleter.install (renamed from python2-fancycompleter.install)2
4 files changed, 42 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 46c827b2f232..b47b9644dfed 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,17 @@
-# Generated by mksrcinfo v8
-# dim. mai 8 08:45:58 UTC 2016
-pkgbase = python2-fancycompleter
+pkgbase = python-fancycompleter
pkgdesc = Colorful TAB completion for Python prompt
pkgver = 0.5
pkgrel = 1
url = https://bitbucket.org/antocuni/fancycompleter
- install = python2-fancycompleter.install
+ install = python-fancycompleter.install
arch = any
license = GPL
- depends = python2
- depends = pyrepl
+ depends = python
+ depends = python-pyrepl-hg
source = https://pypi.python.org/packages/2d/4c/753646af3c4eafc6a4e4a0886f1becd09ddb3bb179bd3c350d8ac357b29a/fancycompleter-0.5.tar.gz
+ source = fix-py3-unicode-str.patch
md5sums = 5eacad3b56b3b6a8435af44df7899e65
+ md5sums = 1a2d75376f69e08fd9cd6efc222489c8
-pkgname = python2-fancycompleter
+pkgname = python-fancycompleter
diff --git a/PKGBUILD b/PKGBUILD
index cafab595954b..ba0feae192f2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,5 @@
# Maintainer: S.Leduc <sebastien@sleduc.fr>
-pkgname=python2-fancycompleter
+pkgname=python-fancycompleter
_realpkg=fancycompleter
pkgver=0.5
pkgrel=1
@@ -7,14 +7,21 @@ pkgdesc="Colorful TAB completion for Python prompt"
arch=("any")
url="https://bitbucket.org/antocuni/fancycompleter"
license=('GPL')
-depends=('python2' 'pyrepl')
+depends=('python' 'python-pyrepl-hg')
install="$pkgname.install"
-source=("https://pypi.python.org/packages/2d/4c/753646af3c4eafc6a4e4a0886f1becd09ddb3bb179bd3c350d8ac357b29a/${_realpkg}-${pkgver}.tar.gz")
-md5sums=('5eacad3b56b3b6a8435af44df7899e65')
+source=("https://pypi.python.org/packages/2d/4c/753646af3c4eafc6a4e4a0886f1becd09ddb3bb179bd3c350d8ac357b29a/${_realpkg}-${pkgver}.tar.gz"
+ 'fix-py3-unicode-str.patch')
+md5sums=('5eacad3b56b3b6a8435af44df7899e65'
+ '1a2d75376f69e08fd9cd6efc222489c8')
+
+prepare() {
+ cd "$srcdir/$_realpkg-$pkgver"
+ patch -Np1 < ../fix-py3-unicode-str.patch
+}
package() {
cd "$srcdir/$_realpkg-$pkgver"
- python2 setup.py install --root="$pkgdir/" --optimize=1
+ python setup.py install --root="$pkgdir/" --optimize=1
}
# vim:set ts=2 sw=2 et:
diff --git a/fix-py3-unicode-str.patch b/fix-py3-unicode-str.patch
new file mode 100644
index 000000000000..d5b55f4ecd49
--- /dev/null
+++ b/fix-py3-unicode-str.patch
@@ -0,0 +1,22 @@
+# Fix TAB completion on objects in Python 3.
+# Source: https://bitbucket.org/antocuni/fancycompleter/issues/4/05-breaks-tab-completion-in-pdbpp-on#comment-28234453
+--- a/fancycompleter.py Sun Oct 05 12:25:21 2014 +0200
++++ b/fancycompleter.py Thu Jun 02 19:51:05 2016 +0200
+@@ -31,7 +31,7 @@
+ try:
+ unicode
+ except NameError:
+- unicode = str
++ unicode = object()
+
+ # ----------------------
+
+@@ -219,7 +219,7 @@
+ values = []
+ n = len(attr)
+ for word in dir(object):
+- if isinstance(word, unicode):
++ if not isinstance(word, str) and isinstance(word, unicode):
+ # this is needed because pyrepl doesn't like unicode
+ # completions: as soon as it finds something which is not str,
+ # it stops.
diff --git a/python2-fancycompleter.install b/python-fancycompleter.install
index c44b8ffb1b16..1540f1ab287b 100644
--- a/python2-fancycompleter.install
+++ b/python-fancycompleter.install
@@ -1,6 +1,6 @@
post_install() {
cat << EOF
-==> To use automatically fancycompleter with python2 interpreter,
+==> To use fancycompleter automatically with python interpreter,
==> just create a ~/.pythonrc file containing :
==> import fancycompleter
==> fancycompleter.interact()