Hello community, here is the log from the commit of package python3-python-editor for openSUSE:Factory checked in at 2016-04-05 10:44:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-python-editor (Old) and /work/SRC/openSUSE:Factory/.python3-python-editor.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-python-editor" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-python-editor/python3-python-editor.changes 2016-01-22 01:07:04.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-python-editor.new/python3-python-editor.changes 2016-04-05 10:44:17.000000000 +0200 @@ -1,0 +2,10 @@ +Sat Apr 2 20:55:39 UTC 2016 - a...@gmx.de + +- update to version 1.0: + * Added newline to end of test.py + * Detect tty and add helper function + * Default to not using tty + * Use branch instead of ternary operator + * Use /dev/tty by default + +------------------------------------------------------------------- Old: ---- python-editor-0.5.tar.gz New: ---- python-editor-1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-python-editor.spec ++++++ --- /var/tmp/diff_new_pack.KgGkoz/_old 2016-04-05 10:44:18.000000000 +0200 +++ /var/tmp/diff_new_pack.KgGkoz/_new 2016-04-05 10:44:18.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-python-editor -Version: 0.5 +Version: 1.0 Release: 0 Summary: Programmatically open an editor, capture the result License: Apache-2.0 ++++++ python-editor-0.5.tar.gz -> python-editor-1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-editor-0.5/PKG-INFO new/python-editor-1.0/PKG-INFO --- old/python-editor-0.5/PKG-INFO 2015-12-03 07:16:40.000000000 +0100 +++ new/python-editor-1.0/PKG-INFO 2016-04-01 17:14:52.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-editor -Version: 0.5 +Version: 1.0 Summary: Programmatically open an editor, capture the result. Home-page: https://github.com/fmoo/python-editor Author: Peter Ruibal @@ -19,4 +19,5 @@ Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Software Development :: Libraries diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-editor-0.5/editor.py new/python-editor-1.0/editor.py --- old/python-editor-0.5/editor.py 2015-10-21 16:40:33.000000000 +0200 +++ new/python-editor-1.0/editor.py 2016-04-01 17:10:53.000000000 +0200 @@ -3,6 +3,7 @@ from __future__ import print_function +import sys import locale import os.path import subprocess @@ -71,11 +72,20 @@ "Please consider setting your %s variable" % get_platform_editor_var()) -def edit(filename=None, contents=None): +def get_tty_filename(): + if sys.platform == 'win32': + return 'CON:' + return '/dev/tty' + + +def edit(filename=None, contents=None, use_tty=None): editor = get_editor() args = get_editor_args(os.path.basename(os.path.realpath(editor))) args = [editor] + args.split(' ') + if use_tty is None: + use_tty = sys.stdin.isatty() and not sys.stdout.isatty() + if filename is None: tmp = tempfile.NamedTemporaryFile() filename = tmp.name @@ -86,7 +96,11 @@ args += [filename] - proc = subprocess.Popen(args, close_fds=True) + stdout = None + if use_tty: + stdout = open(get_tty_filename(), 'wb') + + proc = subprocess.Popen(args, close_fds=True, stdout=stdout) proc.communicate() with open(filename, mode='rb') as f: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-editor-0.5/python_editor.egg-info/PKG-INFO new/python-editor-1.0/python_editor.egg-info/PKG-INFO --- old/python-editor-0.5/python_editor.egg-info/PKG-INFO 2015-12-03 07:16:40.000000000 +0100 +++ new/python-editor-1.0/python_editor.egg-info/PKG-INFO 2016-04-01 17:14:52.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-editor -Version: 0.5 +Version: 1.0 Summary: Programmatically open an editor, capture the result. Home-page: https://github.com/fmoo/python-editor Author: Peter Ruibal @@ -19,4 +19,5 @@ Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Software Development :: Libraries diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-editor-0.5/python_editor.egg-info/SOURCES.txt new/python-editor-1.0/python_editor.egg-info/SOURCES.txt --- old/python-editor-0.5/python_editor.egg-info/SOURCES.txt 2015-12-03 07:16:40.000000000 +0100 +++ new/python-editor-1.0/python_editor.egg-info/SOURCES.txt 2016-04-01 17:14:52.000000000 +0200 @@ -3,6 +3,7 @@ README.md editor.py setup.py +test.py python_editor.egg-info/PKG-INFO python_editor.egg-info/SOURCES.txt python_editor.egg-info/dependency_links.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-editor-0.5/setup.py new/python-editor-1.0/setup.py --- old/python-editor-0.5/setup.py 2015-12-03 07:16:15.000000000 +0100 +++ new/python-editor-1.0/setup.py 2016-04-01 17:13:24.000000000 +0200 @@ -1,6 +1,6 @@ from setuptools import setup -version = '0.5' +version = '1.0' setup( name='python-editor', @@ -18,6 +18,7 @@ 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Topic :: Software Development :: Libraries', ], keywords='editor library vim emacs', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-editor-0.5/test.py new/python-editor-1.0/test.py --- old/python-editor-0.5/test.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-editor-1.0/test.py 2016-04-01 17:10:53.000000000 +0200 @@ -0,0 +1,6 @@ +import sys +import editor + +cont = editor.edit(contents='ABC!', + use_tty='use_tty' in sys.argv) +sys.stdout.write(cont)