Merge pull request #176 from kivy/use_pip_pexpect

use upstream pexpect instead of shipping it
This commit is contained in:
Mathieu Virbel 2015-06-01 23:02:27 +02:00
commit 4377649964
5 changed files with 7 additions and 1861 deletions

View file

@ -13,6 +13,7 @@ import re
import sys
import zipfile
import select
import codecs
from buildozer.jsonstore import JsonStore
from sys import stdout, stderr, exit
from re import search
@ -337,7 +338,7 @@ class Buildozer(object):
process.returncode)
def cmd_expect(self, command, **kwargs):
from buildozer.libs.pexpect import spawn
from pexpect import spawnu
# prepare the environ, based on the system + our own env
env = copy(environ)
@ -350,7 +351,7 @@ class Buildozer(object):
show_output = kwargs.pop('show_output')
if show_output:
kwargs['logfile'] = stdout
kwargs['logfile'] = codecs.getwriter('utf8')(stdout)
if not sensible:
self.debug('Run (expect) {0!r}'.format(command))
@ -358,7 +359,7 @@ class Buildozer(object):
self.debug('Run (expect) {0!r} ...'.format(command.split()[0]))
self.debug('Cwd {}'.format(kwargs.get('cwd')))
return spawn(command, **kwargs)
return spawnu(command, **kwargs)
def check_configuration_tokens(self):
'''Ensure the spec file is 'correct'.

File diff suppressed because it is too large Load diff

View file

@ -303,7 +303,7 @@ class TargetAndroid(Target):
available_packages.splitlines() if x.startswith('id: ')]
def _android_update_sdk(self, packages):
from buildozer.libs.pexpect import EOF
from pexpect import EOF
java_tool_options = environ.get('JAVA_TOOL_OPTIONS', '')
child = self.buildozer.cmd_expect('{} update sdk -u -a -t {}'.format(
self.android_cmd, packages,
@ -311,7 +311,7 @@ class TargetAndroid(Target):
timeout=None,
env={'JAVA_TOOL_OPTIONS': java_tool_options + ' -Dfile.encoding=UTF-8'})
while True:
index = child.expect([EOF, '[y/n]: '])
index = child.expect([EOF, u'[y/n]: '])
if index == 0:
break
child.sendline('y')

View file

@ -47,6 +47,7 @@ setup(
'buildozer.scripts'],
package_data={'buildozer': ['default.spec']},
include_package_data=True,
install_requires=['pexpect'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',