90 | 90 |
|
91 | 91 |
text_buffer = None
|
92 | 92 |
# magic prefix to use utf-8 source encoding
|
93 | |
PYTHON_PREFIX = '''#!/usr/bin/python
|
|
93 |
PYTHON_PREFIX = '''#!/usr/bin/python3
|
94 | 94 |
# -*- coding: utf-8 -*-
|
95 | 95 |
'''
|
96 | 96 |
# Force category names into Pootle
|
|
99 | 99 |
|
100 | 100 |
_logger = logging.getLogger('pippy-activity')
|
101 | 101 |
|
102 | |
DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python
|
|
102 |
DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python3
|
103 | 103 |
# -*- coding: utf-8 -*-
|
104 | 104 |
from distutils.core import setup
|
105 | 105 |
setup(name='{modulename}',
|
|
110 | 110 |
)
|
111 | 111 |
""" # This is .format()'ed with the list of the file names.
|
112 | 112 |
|
113 | |
DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python
|
|
113 |
DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python3
|
114 | 114 |
# -*- coding: utf-8 -*-
|
115 | 115 |
from distutils.core import setup
|
116 | 116 |
setup(name='{modulename}',
|
|
683 | 683 |
self._pid = vte_run(
|
684 | 684 |
Vte.PtyFlags.DEFAULT,
|
685 | 685 |
get_bundle_path(),
|
686 | |
['/bin/sh', '-c', 'python %s; sleep 1' % current_file,
|
|
686 |
['/bin/sh', '-c', 'python3 %s; sleep 1' % current_file,
|
687 | 687 |
'PYTHONPATH=%s/library:%s' % (get_bundle_path(),
|
688 | 688 |
os.getenv('PYTHONPATH', ''))],
|
689 | 689 |
['PYTHONPATH=%s/library:%s' % (get_bundle_path(),
|
|
828 | 828 |
# FIXME: vte invocation was raising errors.
|
829 | 829 |
# Switched to subprocss
|
830 | 830 |
output = subprocess.check_output(
|
831 | |
['/usr/bin/python2',
|
|
831 |
['/usr/bin/python3',
|
832 | 832 |
'%s/pippy_app.py' % get_bundle_path(),
|
833 | 833 |
'-p', '%s/library' % get_bundle_path(),
|
834 | 834 |
'-d', app_temp, title, sourcefile, icon])
|
|
898 | 898 |
os.chdir(app_temp)
|
899 | 899 |
|
900 | 900 |
subprocess.check_output(
|
901 | |
['/usr/bin/python', os.path.join(app_temp, 'setup.py'), 'sdist',
|
|
901 |
['/usr/bin/python3', os.path.join(app_temp, 'setup.py'), 'sdist',
|
902 | 902 |
'-v'])
|
903 | 903 |
|
904 | 904 |
# Hand off to journal
|
|
1142 | 1142 |
|
1143 | 1143 |
self._py_file_loaded_from_journal = True
|
1144 | 1144 |
|
1145 | |
# Discard the '#!/usr/bin/python' and 'coding: utf-8' lines,
|
|
1145 |
# Discard the '#!/usr/bin/python3' and 'coding: utf-8' lines,
|
1146 | 1146 |
# if present
|
1147 | 1147 |
python_code = re.sub(r'^' + re.escape(PYTHON_PREFIX), '', text)
|
1148 | 1148 |
name = self.metadata['title']
|