From 3abf9281cc78dfd1caccb4020f90c4b9adc8ac3d Mon Sep 17 00:00:00 2001 From: hellerve Date: Wed, 29 Jun 2016 13:13:25 +0200 Subject: [PATCH 1/2] gcc5->gcc6 --- zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index 8f63e2d..3f1a97c 100644 --- a/zshrc +++ b/zshrc @@ -35,8 +35,8 @@ export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export GH_HOME=~/Documents/Code/Github alias dob="git branch --merged | grep -vE '(\*)|(master)|(dev)' | xargs -n 1 git branch -d" alias vi="stty stop '' -ixoff ; vim" -alias gcc="gcc-5" -alias g++="g++-5" +alias gcc="gcc-6" +alias g++="g++-6" alias psh="perl ~/.scripts/psh" alias push="git push" alias pull="git pull" From af2fbe4e0ebba1c9f20734b38ea632c61c823295 Mon Sep 17 00:00:00 2001 From: hellerve Date: Thu, 7 Jul 2016 12:33:51 +0200 Subject: [PATCH 2/2] sped up pip upgrade and added python prompt hijacks --- pip-upgrade | 11 ++++++----- pythonrc | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/pip-upgrade b/pip-upgrade index 6634cb9..f36c956 100644 --- a/pip-upgrade +++ b/pip-upgrade @@ -7,8 +7,9 @@ skip=('setuptools', 'pip', 'python', 'disco', 'multitask', 'AudioPython', 'flann', 'vboxapi', 'Loopy', 'autojit', 'llvmpy') -for dist in pip.get_installed_distributions(skip=skip): - if sys.argv[1] == "2": - call("pip2.7 install --upgrade " + dist.project_name, shell=True) - elif sys.argv[1] == "3": - call("pip3.5 install --upgrade " + dist.project_name, shell=True) +dists = pip.get_installed_distributions(skip=skip) +dist_names = " ".join([dist.project_name for dist in dists]) +if sys.argv[1] == "2": + call("pip2.7 install --upgrade " + dist_names, shell=True) +elif sys.argv[1] == "3": + call("pip3.5 install --upgrade " + dist_names, shell=True) diff --git a/pythonrc b/pythonrc index c52c9a1..2efec88 100644 --- a/pythonrc +++ b/pythonrc @@ -15,7 +15,6 @@ def write_history(readline=readline, histfile=histfile): pass atexit.register(write_history) - if sys.version_info.major == 3: sys.ps1 = "3>>> " sys.ps2 = "3... " @@ -23,4 +22,22 @@ else: sys.ps1 = "2>>> " sys.ps2 = "2... " -del readline, histfile, atexit, write_history, sys, os +def hijack_prompt(): + old_except = sys.excepthook + + def new_except(type, value, traceback): + name_ = type is NameError and value.args[0] in ["name 'q' is not defined", + "name 'e' is not defined"] + syntax_ = type is SyntaxError and value.text in [":q\n", ":e\n"] + + if name_ or syntax_: + print("Moriturus te saluto.") + exit() + + old_except(type, value, traceback) + + sys.excepthook = new_except + +hijack_prompt() + +del readline, histfile, atexit, write_history, sys, os, hijack_prompt