##// END OF EJS Templates
Prefer execution when there's only a single line entered...
Prefer execution when there's only a single line entered Closes gh-10425 The heuristic here is to treat a single line specially, and always evaluate it as if the cursor was at the end. An alternative heuristic could be to do this if the cursor is on the last line of the input.

File last commit:

r23530:eae27b5a
r23577:96727fe2
Show More
toollib.py
55 lines | 1.4 KiB | text/x-python | PythonLexer
Fernando Perez
Cleaned up release tools directory....
r2118 """Various utilities common to IPython release and maintenance tools.
"""
Fernando Perez
Update release-related tools, make more py3k-friendly.
r4450
Fernando Perez
Cleaned up release tools directory....
r2118 # Library imports
import os
# Useful shorthands
pjoin = os.path.join
cd = os.chdir
Fernando Perez
Update utilities to be all Python, use numbered paths in testing uploads.
r4452 # Constants
# SSH root address of the archive site
Fernando Perez
Fix upload tool to automatically create directories.
r5731 archive_user = 'ipython@archive.ipython.org'
archive_dir = 'archive.ipython.org'
archive = '%s:%s' % (archive_user, archive_dir)
Fernando Perez
Update utilities to be all Python, use numbered paths in testing uploads.
r4452
Fernando Perez
Put build cmds in a single place to minimize repetition errors.
r6605 # Build commands
# Source dists
Thomas Kluyver
Only make .tar.gz sdists when releasing...
r22847 sdists = './setup.py sdist --formats=gztar'
MinRK
updates to release scripts...
r17581 # Binary dists
Matthias Bussonnier
Factor build logic into function
r22043 def buildwheels():
Matthias Bussonnier
Release IPython 6.0.0rc1
r23530 sh('python3 setupegg.py bdist_wheel')
Fernando Perez
Put windows build cmds in a reusable location so we can upload .exes to PyPI.
r6604
Fernando Perez
Cleaned up release tools directory....
r2118 # Utility functions
Fernando Perez
Clean up version info tools and remove bzr references.
r3197 def sh(cmd):
"""Run system command in shell, raise SystemExit if it returns an error."""
Fernando Perez
Update release-related tools, make more py3k-friendly.
r4450 print("$", cmd)
Fernando Perez
Continue tool cleanup....
r2119 stat = os.system(cmd)
#stat = 0 # Uncomment this and comment previous to run in debug mode
Fernando Perez
Cleaned up release tools directory....
r2118 if stat:
raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
Fernando Perez
Clean up version info tools and remove bzr references.
r3197 # Backwards compatibility
c = sh
Fernando Perez
Cleaned up release tools directory....
r2118
def get_ipdir():
"""Get IPython directory from command line, or assume it's the one above."""
# Initialize arguments and check location
Min RK
more py3 fixes for release scripts
r20283 ipdir = pjoin(os.path.dirname(__file__), os.pardir)
Fernando Perez
Cleaned up release tools directory....
r2118
ipdir = os.path.abspath(ipdir)
cd(ipdir)
if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
raise SystemExit('Invalid ipython directory: %s' % ipdir)
return ipdir
Min RK
remove strict requirement for less,invoke in wheel/sdist...
r19847 try:
Thomas Kluyver
Fix importing execfile from toollib on Python 2
r22063 execfile = execfile
Min RK
remove strict requirement for less,invoke in wheel/sdist...
r19847 except NameError:
def execfile(fname, globs, locs=None):
locs = locs or globs
exec(compile(open(fname).read(), fname, "exec"), globs, locs)