From 2a32a069652d0d0da517a339daac01a7b4d7efe6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 19 Nov 2008 13:26:18 +0100 Subject: [PATCH] Add /etc/skel/.ipython/ipy_user_conf.py --- debian/changelog | 7 +++ etc/skel/.ipython/ipy_user_conf.py | 107 +++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 etc/skel/.ipython/ipy_user_conf.py diff --git a/debian/changelog b/debian/changelog index 45d32e4..09df428 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc (1.1.10) unstable; urgency=low + + * Add /etc/skel/.ipython/ipy_user_conf.py from '%upgrade' + within ipython so user's don't explore this problem. + + -- Michael Prokop Wed, 19 Nov 2008 13:25:33 +0100 + grml-etc (1.1.9) unstable; urgency=low * /etc/wvdial.conf.umts: add usage example for web.vodafone.de diff --git a/etc/skel/.ipython/ipy_user_conf.py b/etc/skel/.ipython/ipy_user_conf.py new file mode 100644 index 0000000..2500a18 --- /dev/null +++ b/etc/skel/.ipython/ipy_user_conf.py @@ -0,0 +1,107 @@ +""" User configuration file for IPython + +This is a more flexible and safe way to configure ipython than *rc files +(ipythonrc, ipythonrc-pysh etc.) + +This file is always imported on ipython startup. You can import the +ipython extensions you need here (see IPython/Extensions directory). + +Feel free to edit this file to customize your ipython experience. + +Note that as such this file does nothing, for backwards compatibility. +Consult e.g. file 'ipy_profile_sh.py' for an example of the things +you can do here. + +See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed +description on what you could do here. +""" + +# Most of your config files and extensions will probably start with this import + +import IPython.ipapi +ip = IPython.ipapi.get() + +# You probably want to uncomment this if you did %upgrade -nolegacy +# import ipy_defaults + +import os + +def main(): + + # uncomment if you want to get ipython -p sh behaviour + # without having to use command line switches + # import ipy_profile_sh + + # Configure your favourite editor? + # Good idea e.g. for %edit os.path.isfile + + #import ipy_editors + + # Choose one of these: + + #ipy_editors.scite() + #ipy_editors.scite('c:/opt/scite/scite.exe') + #ipy_editors.komodo() + #ipy_editors.idle() + # ... or many others, try 'ipy_editors??' after import to see them + + # Or roll your own: + #ipy_editors.install_editor("c:/opt/jed +$line $file") + + + o = ip.options + # An example on how to set options + #o.autocall = 1 + o.system_verbose = 0 + + #import_all("os sys") + #execf('~/_ipython/ns.py') + + + # -- prompt + # A different, more compact set of prompts from the default ones, that + # always show your current location in the filesystem: + + #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>' + #o.prompt_in2 = r'.\D: ' + #o.prompt_out = r'[\#] ' + + # Try one of these color settings if you can't read the text easily + # autoexec is a list of IPython commands to execute on startup + #o.autoexec.append('%colors LightBG') + #o.autoexec.append('%colors NoColor') + #o.autoexec.append('%colors Linux') + + # for sane integer division that converts to float (1/2 == 0.5) + #o.autoexec.append('from __future__ import division') + + # For %tasks and %kill + #import jobctrl + + # For autoreloading of modules (%autoreload, %aimport) + #import ipy_autoreload + + # For winpdb support (%wdb) + #import ipy_winpdb + + # For bzr completer, requires bzrlib (the python installation of bzr) + #ip.load('ipy_bzr') + + # Tab completer that is not quite so picky (i.e. + # "foo". and str(2). will work). Complete + # at your own risk! + #import ipy_greedycompleter + + + +# some config helper functions you can use +def import_all(modules): + """ Usage: import_all("os sys") """ + for m in modules.split(): + ip.ex("from %s import *" % m) + +def execf(fname): + """ Execute a file in user namespace """ + ip.ex('execfile("%s")' % os.path.expanduser(fname)) + +main() -- 2.1.4