/.gnupg/random_seed
/.ipython/README
+/.ipython/profile_default/db/
/.ipython/profile_default/history.sqlite
/.ipython/profile_default/startup/README
/.ipython/profile_default/static/
--- /dev/null
+from IPython.terminal.prompts import Prompts, Token
+
+
+class MyPrompt(Prompts):
+ def in_prompt_tokens(self, cli=None):
+ return [(Token.Prompt, '>>> ')]
+
+ def out_prompt_tokens(self, cli=None):
+ return []
+
+
+c.InteractiveShell.prompts_class = MyPrompt
# Objects that hold multiple objects (can be looped over).
TYPES_ITERABLES = (
types.GeneratorType,
- types.ListType,
- types.TupleType,
+ list,
+ tuple,
)
# Objects that we shouldn't really probe.
# Simple objects we don't decode further.
TYPES_SCALAR = (
- types.BooleanType,
- types.ComplexType,
- types.FloatType,
- types.IntType,
- types.LongType,
- types.NoneType,
- types.StringType,
- types.UnicodeType,
-
- types.ClassType,
- types.TypeType,
+ bool,
+ complex,
+ float,
+ int,
+ #types.LongType,
+ type(None),
+ bytes,
+ str,
+
+ type,
)
# Objects that are dictionary based.
TYPES_DICT = (
- types.DictType,
- types.DictionaryType,
+ dict,
)
# Standard python objects we don't normally expand.
return s
def dump(self, obj, depth=0, name=None):
- """Dump |obj| with |name|"""
+ """Dump |obj| with |name|.
+
+ Args:
+ obj: The object to dump.
+ depth: How deep to recursively dive.
+ name: The name?
+ """
indent = ' ' * depth
def w(msg, indent=indent, color=None):
for line in msg.splitlines():
def dump(*args, **kwargs):
d = Dump(*args, **kwargs)
del d
+dump.__doc__ = Dump.dump.__doc__
alias gdbtui='gdbtui --quiet'
alias nohist='export HISTFILE=/dev/null'
alias kpdf='okular'
-alias ipython='ipython --no-banner --no-confirm-exit --pdb --nosep --PromptManager.in_template=">>> " --PromptManager.out_template="" --PromptManager.justify=False'
if command -v elinks >/dev/null ; then
alias links='elinks -default-mime-type text/html'
alias lynx=links
alias wol-vapier='wakeonlan -i 192.168.1.255 00:25:22:64:19:79; wakeonlan -i 192.168.0.255 00:25:22:64:19:79'
+_ipython() {
+ # These guys keep changing their CLI because they hate their users.
+ local cmd=$1; shift
+ local args=(
+ --no-banner
+ --no-confirm-exit
+ --pdb
+ --nosep
+ --term-title
+ --pprint
+ )
+
+ case $(command ${cmd} --version) in
+ 0*) ;;
+ [123]*)
+ args+=(
+ --PromptManager.in_template='>>> '
+ --PromptManager.out_template=''
+ --PromptManager.justify=False
+ )
+ ;;
+ esac
+
+ command ${cmd} "${args[@]}" "$@"
+}
+ipython() { _ipython ${FUNCNAME}; }
+ipython2() { _ipython ${FUNCNAME}; }
+ipython3() { _ipython ${FUNCNAME}; }
+
adk_path() {
local adk=/usr/local/src/android/adk/current/sdk
PATH+=":${adk}/tools:${adk}/platform-tools"