~ubuntu-branches/debian/experimental/spyder/experimental

« back to all changes in this revision

Viewing changes to spyderlib/widgets/externalshell/osx_app_site.py

  • Committer: Package Import Robot
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2014-05-29 09:06:26 UTC
  • mfrom: (1.1.21) (18.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20140529090626-f58t82g0n5iewaxu
Tags: 2.3.0~rc+dfsg-1~experimental2
* Add spyder-common binary package for all the python2,3 common files
* debian/path
  - 0001-fix-documentation-installation.patch (deleted)
  + 0001-fix-spyderlib-path.patch (new)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
import sys
12
12
import os
13
 
import __builtin__
 
13
try:
 
14
    import __builtin__ as builtins
 
15
except ImportError:
 
16
    # Python 3
 
17
    import builtins
14
18
 
15
19
# for distutils.commands.install
16
20
# These values are initialized by the getuserbase() and getusersitepackages()
46
50
        return USER_SITE
47
51
 
48
52
    from sysconfig import get_path
49
 
    import os
50
53
 
51
54
    if sys.platform == 'darwin':
52
55
        from sysconfig import get_config_var
79
82
            for filename in self.__files:
80
83
                filename = os.path.join(dir, filename)
81
84
                try:
82
 
                    fp = file(filename, "rU")
 
85
                    fp = open(filename, "rU")
83
86
                    data = fp.read()
84
87
                    fp.close()
85
88
                    break
106
109
        while 1:
107
110
            try:
108
111
                for i in range(lineno, lineno + self.MAXLINES):
109
 
                    print self.__lines[i]
 
112
                    print(self.__lines[i])
110
113
            except IndexError:
111
114
                break
112
115
            else:
113
116
                lineno += self.MAXLINES
114
117
                key = None
115
118
                while key is None:
116
 
                    key = raw_input(prompt)
 
119
                    try:
 
120
                        key = raw_input(prompt)
 
121
                    except NameError:
 
122
                        # Python 3
 
123
                        key = input(prompt)
117
124
                    if key not in ('', 'q'):
118
125
                        key = None
119
126
                if key == 'q':
120
127
                    break
121
128
 
122
129
def setcopyright():
123
 
    """Set 'copyright' and 'credits' in __builtin__"""
124
 
    __builtin__.copyright = _Printer("copyright", sys.copyright)
 
130
    """Set 'copyright' and 'credits' in builtins"""
 
131
    builtins.copyright = _Printer("copyright", sys.copyright)
125
132
    if sys.platform[:4] == 'java':
126
 
        __builtin__.credits = _Printer(
 
133
        builtins.credits = _Printer(
127
134
            "credits",
128
135
            "Jython is maintained by the Jython developers (www.jython.org).")
129
136
    else:
130
 
        __builtin__.credits = _Printer("credits", """\
 
137
        builtins.credits = _Printer("credits", """\
131
138
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
132
139
    for supporting Python development.  See www.python.org for more information.""")
133
140
    here = os.path.dirname(os.__file__)
134
 
    __builtin__.license = _Printer(
 
141
    builtins.license = _Printer(
135
142
        "license", "See http://www.python.org/%.3s/license.html" % sys.version,
136
143
        ["LICENSE.txt", "LICENSE"],
137
144
        [os.path.join(here, os.pardir), here, os.curdir])
151
158
        return pydoc.help(*args, **kwds)
152
159
 
153
160
def sethelper():
154
 
    __builtin__.help = _Helper()
 
161
    builtins.help = _Helper()