Skip to content

Commit

Permalink
Python 3 compatibility. First step towards Python 3 support. Still un…
Browse files Browse the repository at this point in the history
…stable.

Needs more testing:
  * see internal console for issues with module_completion
  * try to open Preferences dialog box (it crashes Spyder on Windows)
  * ...
  • Loading branch information
PierreRaybaut committed May 16, 2013
1 parent a737f54 commit c8a9b73
Show file tree
Hide file tree
Showing 92 changed files with 1,677 additions and 2,524 deletions.
5 changes: 3 additions & 2 deletions clonebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import sys

import spyderlib as mod
from spyderlib.py3compat import getcwd

name = 'spyder'
version = mod.__version__
Expand Down Expand Up @@ -60,7 +61,7 @@ def extract_exe_dist(plugin_dir, exe_dist):

def include_chm_doc(plugin_dir):
"""Build and replace Spyder's html doc by .chm doc"""
curdir = os.getcwdu()
curdir = getcwd()
os.chdir(osp.dirname(__file__))
os.system('sphinx-build -b htmlhelp doc doctmp')
for hhc_exe in (r'C:\Program Files\HTML Help Workshop\hhc.exe',
Expand Down Expand Up @@ -112,7 +113,7 @@ def build_pythonxy_plugin(plugin_dir, plugin_version):

def get_pythonxy_plugindir(name):
"""Searching Python(x,y) plugin directory in current working directory"""
for fname in os.listdir(os.getcwdu()):
for fname in os.listdir(getcwd()):
path = osp.abspath(osp.join(fname, 'src', 'python', name))
if osp.isdir(path):
# Also create the binary directory if it does not exist yet:
Expand Down
20 changes: 11 additions & 9 deletions create_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
$ python create_app.py py2app (to build the app)
"""

from __future__ import print_function

from setuptools import setup

from distutils.sysconfig import get_python_lib
Expand Down Expand Up @@ -142,9 +144,9 @@ def get_stdlib_modules():
pep8_script = osp.join(app_python_lib, pep8_egg, 'pep8.py')
for line in fileinput.input(pep8_script, inplace=True):
if line.strip().startswith('codes = ERRORCODE_REGEX.findall'):
print " codes = ERRORCODE_REGEX.findall(function.__doc__ or 'W000')"
print(" codes = ERRORCODE_REGEX.findall(function.__doc__ or 'W000')")
else:
print line,
print(line),

# Function to adjust the interpreter used by PROGRAMS
# (to be added to __boot.py__)
Expand Down Expand Up @@ -218,13 +220,13 @@ def _get_env():
run_line = "_run()"
for line in fileinput.input(boot_file, inplace=True):
if line.startswith(reset_line):
print reset_line
print get_env
print(reset_line)
print(get_env)
elif line.startswith(run_line):
print change_interpreter
print new_path
print ip_dir
print run_line
print(change_interpreter)
print(new_path)
print(ip_dir)
print(run_line)
else:
print line,
print(line, end='')

2 changes: 1 addition & 1 deletion create_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def create_executable():
except ImportError:
python_qt = 'pyside'
dist.setup(name="Spyder", version=ver, script="spyderlib/spyder.py",
description=u"Scientific PYthon Development EnviRonment",
description="Scientific PYthon Development EnviRonment",
target_name="%s.exe" % name, icon="%s.ico" % name,
target_dir="%s-win32-%s-sa-%s" % (name, python_qt, ver))
spyderlib.add_to_distribution(dist)
Expand Down
11 changes: 5 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
master_doc = 'index'

# General information about the project.
project = u'Spyder'
copyright = u'2009-2013, Pierre Raybaut'
project = 'Spyder'
copyright = '2009, Pierre Raybaut'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.2'
version = '2.3'
# The full version, including alpha/beta/rc tags.
release = '2.2'
release = '2.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -173,8 +173,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Spyder.tex', u'Spyder Documentation',
u'Pierre Raybaut', 'manual'),
('index', 'Spyder.tex', 'Spyder Documentation', 'Pierre Raybaut', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
Loading

0 comments on commit c8a9b73

Please sign in to comment.