Codebase list sugar-pippy-activity / 4f5a083
Use Python 3 to run user programs James Cameron 4 years ago
3 changed file(s) with 8 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
177177 self._pid = self._vte.fork_command_full(
178178 Vte.PtyFlags.DEFAULT,
179179 bundle_path,
180 ['/bin/sh', '-c', 'python %s/pippy_app.py; sleep 1' % bundle_path],
180 ['/bin/sh', '-c', 'python3 %s/pippy_app.py; sleep 1' % bundle_path],
181181 ["PYTHONPATH=%s/library" % bundle_path],
182182 GLib.SpawnFlags.DO_NOT_REAP_CHILD,
183183 None,
9090
9191 text_buffer = None
9292 # magic prefix to use utf-8 source encoding
93 PYTHON_PREFIX = '''#!/usr/bin/python
93 PYTHON_PREFIX = '''#!/usr/bin/python3
9494 # -*- coding: utf-8 -*-
9595 '''
9696 # Force category names into Pootle
9999
100100 _logger = logging.getLogger('pippy-activity')
101101
102 DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python
102 DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python3
103103 # -*- coding: utf-8 -*-
104104 from distutils.core import setup
105105 setup(name='{modulename}',
110110 )
111111 """ # This is .format()'ed with the list of the file names.
112112
113 DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python
113 DISTUTILS_SETUP_SCRIPT = """#!/usr/bin/python3
114114 # -*- coding: utf-8 -*-
115115 from distutils.core import setup
116116 setup(name='{modulename}',
683683 self._pid = vte_run(
684684 Vte.PtyFlags.DEFAULT,
685685 get_bundle_path(),
686 ['/bin/sh', '-c', 'python %s; sleep 1' % current_file,
686 ['/bin/sh', '-c', 'python3 %s; sleep 1' % current_file,
687687 'PYTHONPATH=%s/library:%s' % (get_bundle_path(),
688688 os.getenv('PYTHONPATH', ''))],
689689 ['PYTHONPATH=%s/library:%s' % (get_bundle_path(),
828828 # FIXME: vte invocation was raising errors.
829829 # Switched to subprocss
830830 output = subprocess.check_output(
831 ['/usr/bin/python2',
831 ['/usr/bin/python3',
832832 '%s/pippy_app.py' % get_bundle_path(),
833833 '-p', '%s/library' % get_bundle_path(),
834834 '-d', app_temp, title, sourcefile, icon])
898898 os.chdir(app_temp)
899899
900900 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',
902902 '-v'])
903903
904904 # Hand off to journal
11421142
11431143 self._py_file_loaded_from_journal = True
11441144
1145 # Discard the '#!/usr/bin/python' and 'coding: utf-8' lines,
1145 # Discard the '#!/usr/bin/python3' and 'coding: utf-8' lines,
11461146 # if present
11471147 python_code = re.sub(r'^' + re.escape(PYTHON_PREFIX), '', text)
11481148 name = self.metadata['title']
0 #!/usr/bin/python
10 # -*- coding: utf-8 -*-
21 # Copyright (C) 2013,14 Walter Bender (walter@sugarlabs.org)
32 #