From 7377579ed459c9b0a4807384f4c4db0a307f891d Mon Sep 17 00:00:00 2001 From: "Cogito, sed non sum" Date: Fri, 4 Sep 2015 03:23:39 +0200 Subject: [PATCH 1/3] Ported to python3. --- README.md | 9 +++++++++ setup.py | 28 ++++++++++------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1d3baae..21d82ed 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +This version installs both python2 and python3 versions of vy. + +To install the python3 version, run +``` +# python3 setup.py install +``` + +Also requires untwisted in python3-flavor, as well as python3-tkinter and python3-pygments. + ![vy](vy.gif) vy ================ diff --git a/setup.py b/setup.py index 903ae72..b6868c2 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,13 @@ #! /usr/bin/env python from distutils.core import setup + +try: + from distutils.command.build_py import build_py_2to3 \ + as build_py +except ImportError: + from distutils.command.build_py import build_py + setup(name="vy", version="0.1", packages=["vyapp", @@ -14,21 +21,6 @@ scripts=['vy'], package_data={'vyapp': ['vyrc', '/vyapp/vyrc']}, author="Iury O. G. Figueiredo", - author_email="ioliveira@id.uff.br") - - - - - - - - - - - - - - - - - + author_email="ioliveira@id.uff.br", + cmdclass = {'build_py': build_py} +) From e165465b4a960b0cde686b66650fd9624edf375e Mon Sep 17 00:00:00 2001 From: "Cogito, sed non sum" Date: Fri, 4 Sep 2015 03:41:50 +0200 Subject: [PATCH 2/3] Ported to python3. --- vy | 2 +- vyapp/stdout.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vy b/vy index 53a7451..006d2e6 100755 --- a/vy +++ b/vy @@ -15,7 +15,7 @@ if __name__ == '__main__': root = App() lst = eval(str(opt.lst)) - lst = lst + map(lambda ind: [[ind]], args) + lst = lst + list(map(lambda ind: [[ind]], args)) if not lst: root.note.create('None') else: root.note.load(*lst) diff --git a/vyapp/stdout.py b/vyapp/stdout.py index 5f31f9f..e15c121 100644 --- a/vyapp/stdout.py +++ b/vyapp/stdout.py @@ -38,6 +38,8 @@ def remove(self, fd): def write(self, data): for ind in self.base: + if sys.version_info >= (3, 0): + data = str(data) ind.write(data) def echo(data): From 1c59afe3d8908f9dd798aadc35890d04fda21ef3 Mon Sep 17 00:00:00 2001 From: "Cogito, sed non sum" Date: Fri, 4 Sep 2015 03:47:06 +0200 Subject: [PATCH 3/3] Ported to python3. --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 21d82ed..e0cce29 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,3 @@ -This version installs both python2 and python3 versions of vy. - -To install the python3 version, run -``` -# python3 setup.py install -``` - -Also requires untwisted in python3-flavor, as well as python3-tkinter and python3-pygments. - ![vy](vy.gif) vy ================ @@ -101,7 +92,7 @@ https://youtu.be/0bBKOFdQKzo Install ======= -Vy actually demands python 2.7 to run. +Vy actually demands python 2.7 or python3.x to run. This is a short script to install the latest version of vy. @@ -120,6 +111,10 @@ This is a short script to install the latest version of vy. python setup.py install +To build vy in Python3 flavor, you need to run setup.py with the python3 interpreter, +as well as installing python3-tkinter and python3-pygments instead pf their python2 +equivalents. + Once you have installed vy and its dependencies, run on a terminal the following command.