Ticket #12719: trac_12719_ROOT_configuration_files.patch

File trac_12719_ROOT_configuration_files.patch, 41.8 KB (added by jdemeyer, 9 years ago)

Rebased to sage-5.7.beta0

  • deleted file ipython/ipy_profile_sh.py

    # HG changeset patch
    # User Volker Braun <vbraun@stp.dias.ie>
    # Date 1338184106 25200
    # Node ID c3e4ee348de36d4f88eb15c0774bc638103590f5
    # Parent  d55c84d81d06464a6f6de833229914808dd29a08
    The ipython directory is now versioned (as in .sage/ipython-version)
    Also, delete SAGE_ROOT/ipython. IPython configuration goes into
    sage/misc/interpreter.py from now on.
    
    diff --git a/ipython/ipy_profile_sh.py b/ipython/ipy_profile_sh.py
    deleted file mode 100644
    + -  
    1 """Shell mode for IPython.
    2 
    3 Start ipython in shell mode by invoking "ipython -p sh"
    4 
    5 (the old version, "ipython -p pysh" still works but this is the more "modern"
    6 shell mode and is recommended for users who don't care about pysh-mode
    7 compatibility)
    8 """
    9 
    10 from IPython import ipapi
    11 import os,textwrap
    12 
    13 # The import below effectively obsoletes your old-style ipythonrc[.ini],
    14 # so consider yourself warned!
    15 
    16 import ipy_defaults
    17 
    18 def main():
    19     ip = ipapi.get()
    20     o = ip.options
    21     # autocall to "full" mode (smart mode is default, I like full mode)
    22    
    23     o.autocall = 2
    24    
    25     # Jason Orendorff's path class is handy to have in user namespace
    26     # if you are doing shell-like stuff
    27     try:
    28         ip.ex("from path import path" )
    29     except ImportError:
    30         pass
    31    
    32     ip.ex('import os')
    33     ip.ex("def up(): os.chdir('..')")
    34        
    35     # Get pysh-like prompt for all profiles.
    36    
    37     o.prompt_in1= '\C_LightBlue[\C_LightCyan\Y1\C_LightBlue]\C_Green|\#> '
    38     o.prompt_in2= '\C_Green|\C_LightGreen\D\C_Green> '
    39     o.prompt_out= '<\#> '
    40    
    41     from IPython import Release
    42 
    43     import sys
    44     # I like my banner minimal.
    45     o.banner = "Py %s IPy %s\n" % (sys.version.split('\n')[0],Release.version)
    46    
    47     # make 'd' an alias for ls -F
    48    
    49     ip.magic('alias d ls -F --color=auto')
    50    
    51     # Make available all system commands through "rehashing" immediately.
    52     # You can comment these lines out to speed up startup on very slow
    53     # machines, and to conserve a bit of memory. Note that pysh profile does this
    54     # automatically
    55     ip.IP.default_option('cd','-q')
    56    
    57 
    58     o.prompts_pad_left="1"
    59     # Remove all blank lines in between prompts, like a normal shell.
    60     o.separate_in="0"
    61     o.separate_out="0"
    62     o.separate_out2="0"
    63    
    64     # now alias all syscommands
    65    
    66     db = ip.db
    67    
    68     syscmds = db.get("syscmdlist",[] )
    69     if not syscmds:
    70         print textwrap.dedent("""
    71         System command list not initialized, probably the first run...
    72         running %rehashx to refresh the command list. Run %rehashx
    73         again to refresh command list (after installing new software etc.)
    74         """)
    75         ip.magic('rehashx')
    76         syscmds = db.get("syscmdlist")
    77     for cmd in syscmds:
    78         #print "al",cmd
    79         noext, ext = os.path.splitext(cmd)
    80         ip.IP.alias_table[noext] = (0,cmd)
    81 
    82 main()
  • deleted file ipython/ipy_user_conf.py

    diff --git a/ipython/ipy_user_conf.py b/ipython/ipy_user_conf.py
    deleted file mode 100644
    + -  
    1 """ User configuration file for IPython
    2 
    3 This is a more flexible and safe way to configure ipython than *rc files
    4 (ipythonrc, ipythonrc-pysh etc.)
    5 
    6 This file is always imported on ipython startup. You can import the
    7 ipython extensions you need here (see IPython/Extensions directory).
    8 
    9 Feel free to edit this file to customize your ipython experience.
    10 
    11 Note that as such this file does nothing, for backwards compatibility.
    12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
    13 you can do here.
    14 
    15 """
    16 
    17 # Most of your config files and extensions will probably start with this import
    18 
    19 import IPython.ipapi
    20 ip = IPython.ipapi.get()
    21 
    22 # You probably want to uncomment this if you did %upgrade -nolegacy
    23 # import ipy_defaults   
    24 
    25 def main():
    26     o = ip.options
    27     # An example on how to set options
    28     #o.autocall = 1
    29 
    30 main()
  • deleted file ipython/ipythonrc

    diff --git a/ipython/ipythonrc b/ipython/ipythonrc
    deleted file mode 100644
    + -  
    1 # -*- Mode: Shell-Script -*-  Not really, but shows comments correctly
    2 # $Id: ipythonrc 1329 2006-05-26 07:52:45Z fperez $
    3 
    4 #***************************************************************************
    5 #
    6 # Configuration file for IPython -- ipythonrc format
    7 #
    8 # The format of this file is simply one of 'key value' lines.
    9 # Lines containing only whitespace at the beginning and then a # are ignored
    10 # as comments. But comments can NOT be put on lines with data.
    11 
    12 # The meaning and use of each key are explained below.
    13 
    14 #---------------------------------------------------------------------------
    15 # Section: included files
    16 
    17 # Put one or more *config* files (with the syntax of this file) you want to
    18 # include. For keys with a unique value the outermost file has precedence. For
    19 # keys with multiple values, they all get assembled into a list which then
    20 # gets loaded by IPython.
    21 
    22 # In this file, all lists of things should simply be space-separated.
    23 
    24 # This allows you to build hierarchies of files which recursively load
    25 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
    26 # should only keep here basic things you always want available. Then you can
    27 # include it in every other special-purpose config file you create.
    28 include
    29 
    30 #---------------------------------------------------------------------------
    31 # Section: startup setup
    32 
    33 # These are mostly things which parallel a command line option of the same
    34 # name.
    35 
    36 # Keys in this section should only appear once. If any key from this section
    37 # is encountered more than once, the last value remains, all earlier ones get
    38 # discarded.
    39 
    40 
    41 # Automatic calling of callable objects.  If set to 1 or 2, callable objects
    42 # are automatically called when invoked at the command line, even if you don't
    43 # type parentheses.  IPython adds the parentheses for you.  For example:
    44 
    45 #In [1]: str 45
    46 #------> str(45)
    47 #Out[1]: '45'
    48 
    49 # IPython reprints your line with '---->' indicating that it added
    50 # parentheses.  While this option is very convenient for interactive use, it
    51 # may occasionally cause problems with objects which have side-effects if
    52 # called unexpectedly.
    53 
    54 # The valid values for autocall are:
    55 
    56 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
    57 
    58 # autocall 1 -> active, but do not apply if there are no arguments on the line.
    59 
    60 # In this mode, you get:
    61 
    62 #In [1]: callable
    63 #Out[1]: <built-in function callable>
    64 
    65 #In [2]: callable 'hello'
    66 #------> callable('hello')
    67 #Out[2]: False
    68 
    69 # 2 -> Active always.  Even if no arguments are present, the callable object
    70 # is called:
    71 
    72 #In [4]: callable
    73 #------> callable()
    74 
    75 # Note that even with autocall off, you can still use '/' at the start of a
    76 # line to treat the first argument on the command line as a function and add
    77 # parentheses to it:
    78 
    79 #In [8]: /str 43
    80 #------> str(43)
    81 #Out[8]: '43'
    82 
    83 autocall 0
    84 
    85 # Auto-edit syntax errors.  When you use the %edit magic in ipython to edit
    86 # source code (see the 'editor' variable below), it is possible that you save
    87 # a file with syntax errors in it.  If this variable is true, IPython will ask
    88 # you whether to re-open the editor immediately to correct such an error.
    89 
    90 autoedit_syntax 0
    91 
    92 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
    93 # line, while also un-indenting automatically after 'raise' or 'return'. 
    94 
    95 # This feature uses the readline library, so it will honor your ~/.inputrc
    96 # configuration (or whatever file your INPUTRC variable points to).  Adding
    97 # the following lines to your .inputrc file can make indent/unindenting more
    98 # convenient (M-i indents, M-u unindents):
    99 
    100 #  $if Python
    101 #  "\M-i": "    "
    102 #  "\M-u": "\d\d\d\d"
    103 #  $endif
    104 
    105 # The feature is potentially a bit dangerous, because it can cause problems
    106 # with pasting of indented code (the pasted code gets re-indented on each
    107 # line).  But it's a huge time-saver when working interactively.  The magic
    108 # function %autoindent allows you to toggle it on/off at runtime.
    109 
    110 autoindent 1
    111 
    112 # Auto-magic. This gives you access to all the magic functions without having
    113 # to prepend them with an % sign. If you define a variable with the same name
    114 # as a magic function (say who=1), you will need to access the magic function
    115 # with % (%who in this example). However, if later you delete your variable
    116 # (del who), you'll recover the automagic calling form.
    117 
    118 # Considering that many magic functions provide a lot of shell-like
    119 # functionality, automagic gives you something close to a full Python+system
    120 # shell environment (and you can extend it further if you want).
    121 
    122 automagic 1
    123 
    124 # Size of the output cache. After this many entries are stored, the cache will
    125 # get flushed. Depending on the size of your intermediate calculations, you
    126 # may have memory problems if you make it too big, since keeping things in the
    127 # cache prevents Python from reclaiming the memory for old results. Experiment
    128 # with a value that works well for you.
    129 
    130 # If you choose cache_size 0 IPython will revert to python's regular >>>
    131 # unnumbered prompt. You will still have _, __ and ___ for your last three
    132 # results, but that will be it.  No dynamic _1, _2, etc. will be created. If
    133 # you are running on a slow machine or with very limited memory, this may
    134 # help.
    135 
    136 cache_size 1000
    137 
    138 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
    139 # but that's your choice! Classic 1 -> same as IPython -classic.
    140 # Note that this is _not_ the normal python interpreter, it's simply
    141 # IPython emulating most of the classic interpreter's behavior.
    142 classic 0
    143 
    144 # colors - Coloring option for prompts and traceback printouts.
    145 
    146 # Currently available schemes: NoColor, Linux, LightBG.
    147 
    148 # This option allows coloring the prompts and traceback printouts. This
    149 # requires a terminal which can properly handle color escape sequences. If you
    150 # are having problems with this, use the NoColor scheme (uses no color escapes
    151 # at all).
    152 
    153 # The Linux option works well in linux console type environments: dark
    154 # background with light fonts.
    155 
    156 # LightBG is similar to Linux but swaps dark/light colors to be more readable
    157 # in light background terminals.
    158 
    159 # keep uncommented only the one you want:
    160 #colors Linux
    161 #colors LightBG
    162 colors NoColor
    163 
    164 ########################
    165 # Note to Windows users
    166 #
    167 # Color and readline support is avaialble to Windows users via Gary Bishop's
    168 # readline library.  You can find Gary's tools at
    169 # http://sourceforge.net/projects/uncpythontools.
    170 # Note that his readline module requires in turn the ctypes library, available
    171 # at http://starship.python.net/crew/theller/ctypes.
    172 ########################
    173 
    174 # color_info: IPython can display information about objects via a set of
    175 # functions, and optionally can use colors for this, syntax highlighting
    176 # source code and various other elements. This information is passed through a
    177 # pager (it defaults to 'less' if $PAGER is not set).
    178 
    179 # If your pager has problems, try to setting it to properly handle escapes
    180 # (see the less manpage for detail), or disable this option.  The magic
    181 # function %color_info allows you to toggle this interactively for testing.
    182 
    183 color_info 1
    184 
    185 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
    186 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
    187 # the magic functions %Exit or %Quit you can force a direct exit, bypassing
    188 # any confirmation.
    189 
    190 confirm_exit 0
    191 
    192 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
    193 # still available as dreload() and appears as a builtin.
    194 
    195 deep_reload 0
    196 
    197 # Which editor to use with the %edit command. If you leave this at 0, IPython
    198 # will honor your EDITOR environment variable. Since this editor is invoked on
    199 # the fly by ipython and is meant for editing small code snippets, you may
    200 # want to use a small, lightweight editor here.
    201 
    202 # For Emacs users, setting up your Emacs server properly as described in the
    203 # manual is a good idea. An alternative is to use jed, a very light editor
    204 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
    205 
    206 editor 0
    207 
    208 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
    209 log 0
    210 
    211 # Same as ipython -Logfile YourLogfileName.
    212 # Don't use with log 1 (use one or the other)
    213 logfile ''
    214 
    215 # banner 0 -> same as ipython -nobanner
    216 banner 0
    217 
    218 # messages 0 -> same as ipython -nomessages
    219 messages 1
    220 
    221 # Automatically call the pdb debugger after every uncaught exception. If you
    222 # are used to debugging using pdb, this puts you automatically inside of it
    223 # after any call (either in IPython or in code called by it) which triggers an
    224 # exception which goes uncaught.
    225 pdb 0
    226 
    227 # Enable the pprint module for printing. pprint tends to give a more readable
    228 # display (than print) for complex nested data structures.
    229 pprint 1
    230 
    231 # Prompt strings
    232 
    233 # Most bash-like escapes can be used to customize IPython's prompts, as well as
    234 # a few additional ones which are IPython-specific.  All valid prompt escapes
    235 # are described in detail in the Customization section of the IPython HTML/PDF
    236 # manual.
    237 
    238 # Use \# to represent the current prompt number, and quote them to protect
    239 # spaces.
    240 #prompt_in1 'In [\#]: '
    241 prompt_in1 '${sage_prompt()}: '
    242 
    243 # \D is replaced by as many dots as there are digits in the
    244 # current value of \#.
    245 #prompt_in2 '   .\D.: '
    246 # From F. Perez On oct 6.
    247 prompt_in2 '${'.'*len(sage_prompt())}: '
    248 
    249 #prompt_out 'Out[\#]: '
    250 prompt_out ''
    251 
    252 # Select whether to left-pad the output prompts to match the length of the
    253 # input ones.  This allows you for example to use a simple '>' as an output
    254 # prompt, and yet have the output line up with the input.  If set to false,
    255 # the output prompts will be unpadded (flush left).
    256 prompts_pad_left 0
    257 
    258 # quick 1 -> same as ipython -quick
    259 quick 0
    260 
    261 # Use the readline library (1) or not (0). Most users will want this on, but
    262 # if you experience strange problems with line management (mainly when using
    263 # IPython inside Emacs buffers) you may try disabling it. Not having it on
    264 # prevents you from getting command history with the arrow keys, searching and
    265 # name completion using TAB.
    266 
    267 readline 1
    268 
    269 # Screen Length: number of lines of your screen. This is used to control
    270 # printing of very long strings. Strings longer than this number of lines will
    271 # be paged with the less command instead of directly printed.
    272 
    273 # The default value for this is 0, which means IPython will auto-detect your
    274 # screen size every time it needs to print. If for some reason this isn't
    275 # working well (it needs curses support), specify it yourself. Otherwise don't
    276 # change the default.
    277 
    278 screen_length 0
    279 
    280 # Prompt separators for input and output.
    281 # Use \n for newline explicitly, without quotes.
    282 # Use 0 (like at the cmd line) to turn off a given separator.
    283 
    284 # The structure of prompt printing is:
    285 # (SeparateIn)Input....
    286 # (SeparateOut)Output...
    287 # (SeparateOut2),   # that is, no newline is printed after Out2
    288 # By choosing these you can organize your output any way you want.
    289 
    290 separate_in 0
    291 separate_out 0
    292 separate_out2 0
    293 
    294 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
    295 # Simply removes all input/output separators, overriding the choices above.
    296 nosep 0
    297 
    298 # Wildcard searches - IPython has a system for searching names using
    299 # shell-like wildcards; type %psearch? for details.  This variables sets
    300 # whether by default such searches should be case sensitive or not.  You can
    301 # always override the default at the system command line or the IPython
    302 # prompt.
    303 
    304 wildcards_case_sensitive 1
    305 
    306 # Object information: at what level of detail to display the string form of an
    307 # object.  If set to 0, ipython will compute the string form of any object X,
    308 # by calling str(X), when X? is typed.  If set to 1, str(X) will only be
    309 # computed when X?? is given, and if set to 2 or higher, it will never be
    310 # computed (there is no X??? level of detail).  This is mostly of use to
    311 # people who frequently manipulate objects whose string representation is
    312 # extremely expensive to compute.
    313 
    314 object_info_string_level 0
    315 
    316 # xmode - Exception reporting mode.
    317 
    318 # Valid modes: Plain, Context and Verbose.
    319 
    320 # Plain: similar to python's normal traceback printing.
    321 
    322 # Context: prints 5 lines of context source code around each line in the
    323 # traceback.
    324 
    325 # Verbose: similar to Context, but additionally prints the variables currently
    326 # visible where the exception happened (shortening their strings if too
    327 # long). This can potentially be very slow, if you happen to have a huge data
    328 # structure whose string representation is complex to compute. Your computer
    329 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
    330 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
    331 
    332 #xmode Plain
    333 xmode Context
    334 #xmode Verbose
    335 
    336 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
    337 # !cmd) to be used in multi-line input (like for loops).  For example, if you
    338 # have this active, the following is valid in IPython:
    339 #
    340 #In [17]: for i in range(3):
    341 #   ....:     mkdir $i
    342 #   ....:     !touch $i/hello
    343 #   ....:     ls -l $i
    344 
    345 multi_line_specials 1
    346 
    347 # wxversion: request a specific wxPython version (used for -wthread)
    348 
    349 # Set this to the value of wxPython you want to use, but note that this
    350 # feature requires you to have the wxversion Python module to work.  If you
    351 # don't have the wxversion module (try 'import wxversion' at the prompt to
    352 # check) or simply want to leave the system to pick up the default, leave this
    353 # variable at 0.
    354 
    355 wxversion 0
    356 
    357 #---------------------------------------------------------------------------
    358 # Section: Readline configuration (readline is not available for MS-Windows)
    359 
    360 # This is done via the following options:
    361 
    362 # (i) readline_parse_and_bind: this option can appear as many times as you
    363 # want, each time defining a string to be executed via a
    364 # readline.parse_and_bind() command. The syntax for valid commands of this
    365 # kind can be found by reading the documentation for the GNU readline library,
    366 # as these commands are of the kind which readline accepts in its
    367 # configuration file.
    368 
    369 # The TAB key can be used to complete names at the command line in one of two
    370 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
    371 # completes as much as possible while 'menu-complete' cycles through all
    372 # possible completions. Leave the one you prefer uncommented.
    373 
    374 readline_parse_and_bind tab: complete
    375 #readline_parse_and_bind tab: menu-complete
    376 
    377 # This binds Control-l to printing the list of all possible completions when
    378 # there is more than one (what 'complete' does when hitting TAB twice, or at
    379 # the first TAB if show-all-if-ambiguous is on)
    380 readline_parse_and_bind "\C-l": possible-completions
    381 
    382 # This forces readline to automatically print the above list when tab
    383 # completion is set to 'complete'. You can still get this list manually by
    384 # using the key bound to 'possible-completions' (Control-l by default) or by
    385 # hitting TAB twice. Turning this on makes the printing happen at the first
    386 # TAB.
    387 readline_parse_and_bind set show-all-if-ambiguous on
    388 
    389 # If you have TAB set to complete names, you can rebind any key (Control-o by
    390 # default) to insert a true TAB character.
    391 readline_parse_and_bind "\C-o": tab-insert
    392 
    393 # These commands allow you to indent/unindent easily, with the 4-space
    394 # convention of the Python coding standards.  Since IPython's internal
    395 # auto-indent system also uses 4 spaces, you should not change the number of
    396 # spaces in the code below.
    397 readline_parse_and_bind "\M-i": "    "
    398 readline_parse_and_bind "\M-o": "\d\d\d\d"
    399 readline_parse_and_bind "\M-I": "\d\d\d\d"
    400 
    401 # Bindings for incremental searches in the history. These searches use the
    402 # string typed so far on the command line and search anything in the previous
    403 # input history containing them.
    404 readline_parse_and_bind "\C-r": reverse-search-history
    405 readline_parse_and_bind "\C-s": forward-search-history
    406 
    407 # Bindings for completing the current line in the history of previous
    408 # commands. This allows you to recall any previous command by typing its first
    409 # few letters and hitting Control-p, bypassing all intermediate commands which
    410 # may be in the history (much faster than hitting up-arrow 50 times!)
    411 readline_parse_and_bind "\C-p": history-search-backward
    412 readline_parse_and_bind "\C-n": history-search-forward
    413 
    414 # I also like to have the same functionality on the plain arrow keys. If you'd
    415 # rather have the arrows use all the history (and not just match what you've
    416 # typed so far), comment out or delete the next two lines.
    417 readline_parse_and_bind "\e[A": history-search-backward
    418 readline_parse_and_bind "\e[B": history-search-forward
    419 
    420 # These are typically on by default under *nix, but not win32.
    421 readline_parse_and_bind "\C-k": kill-line
    422 readline_parse_and_bind "\C-u": unix-line-discard
    423 
    424 # (ii) readline_remove_delims: a string of characters to be removed from the
    425 # default word-delimiters list used by readline, so that completions may be
    426 # performed on strings which contain them.
    427 
    428 readline_remove_delims -/~
    429 
    430 # (iii) readline_merge_completions: whether to merge the result of all
    431 # possible completions or not.  If true, IPython will complete filenames,
    432 # python names and aliases and return all possible completions.  If you set it
    433 # to false, each completer is used at a time, and only if it doesn't return
    434 # any completions is the next one used.
    435 
    436 # The default order is: [python_matches, file_matches, alias_matches]
    437 
    438 readline_merge_completions 1
    439 
    440 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
    441 # will complete all attributes of an object, including all the special methods
    442 # whose names start with single or double underscores (like __getitem__ or
    443 # __class__).
    444 
    445 # This variable allows you to control this completion behavior:
    446 
    447 # readline_omit__names 1 -> completion will omit showing any names starting
    448 # with two __, but it will still show names starting with one _.
    449 
    450 # readline_omit__names 2 -> completion will omit all names beginning with one
    451 # _ (which obviously means filtering out the double __ ones).
    452 
    453 # Even when this option is set, you can still see those names by explicitly
    454 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
    455 # complete attribute names starting with '_'.
    456 
    457 # This option is off by default so that new users see all attributes of any
    458 # objects they are dealing with.
    459 
    460 readline_omit__names 2
    461 
    462 #---------------------------------------------------------------------------
    463 # Section: modules to be loaded with 'import ...'
    464 
    465 # List, separated by spaces, the names of the modules you want to import
    466 
    467 # Example:
    468 # import_mod sys os
    469 # will produce internally the statements
    470 # import sys
    471 # import os
    472 
    473 # Each import is executed in its own try/except block, so if one module
    474 # fails to load the others will still be ok.
    475 
    476 import_mod
    477 
    478 #---------------------------------------------------------------------------
    479 # Section: modules to import some functions from: 'from ... import ...'
    480 
    481 # List, one per line, the modules for which you want only to import some
    482 # functions. Give the module name first and then the name of functions to be
    483 # imported from that module.
    484 
    485 # Example:
    486 
    487 # import_some IPython.genutils timing timings
    488 # will produce internally the statement
    489 # from IPython.genutils import timing, timings
    490 
    491 # timing() and timings() are two IPython utilities for timing the execution of
    492 # your own functions, which you may find useful.  Just commment out the above
    493 # line if you want to test them.
    494 
    495 # If you have more than one modules_some line, each gets its own try/except
    496 # block (like modules, see above).
    497 
    498 import_some
    499 
    500 #---------------------------------------------------------------------------
    501 # Section: modules to import all from : 'from ... import *'
    502 
    503 # List (same syntax as import_mod above) those modules for which you want to
    504 # import all functions. Remember, this is a potentially dangerous thing to do,
    505 # since it is very easy to overwrite names of things you need. Use with
    506 # caution.
    507 
    508 # Example:
    509 # import_all sys os
    510 # will produce internally the statements
    511 # from sys import *
    512 # from os import *
    513 
    514 # As before, each will be called in a separate try/except block.
    515 
    516 import_all
    517 
    518 #---------------------------------------------------------------------------
    519 # Section: Python code to execute.
    520 
    521 # Put here code to be explicitly executed (keep it simple!)
    522 # Put one line of python code per line. All whitespace is removed (this is a
    523 # feature, not a bug), so don't get fancy building loops here.
    524 # This is just for quick convenient creation of things you want available.
    525 
    526 # Example:
    527 # execute x = 1
    528 # execute print 'hello world'; y = z = 'a'
    529 # will produce internally
    530 # x = 1
    531 # print 'hello world'; y = z = 'a'
    532 # and each *line* (not each statement, we don't do python syntax parsing) is
    533 # executed in its own try/except block.
    534 
    535 execute
    536 
    537 execute def view_all(): view([(i, globals()[i]) for i in variables()], title='All SAGE Variables')
    538 execute def variables(): return [k for k in globals() if not k in iglob and len(k) > 0 and k[0] != '_']
    539 execute import sage.misc.preparser_ipython;  sage.misc.preparser_ipython.magma_colon_equals=True
    540 
    541 
    542 # Note for the adventurous: you can use this to define your own names for the
    543 # magic functions, by playing some namespace tricks:
    544 
    545 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
    546 
    547 # defines %pf as a new name for %profile.
    548 
    549 #---------------------------------------------------------------------------
    550 # Section: Python files to load and execute.
    551 
    552 # Put here the full names of files you want executed with execfile(file).  If
    553 # you want complicated initialization, just write whatever you want in a
    554 # regular python file and load it from here.
    555 
    556 # Filenames defined here (which *must* include the extension) are searched for
    557 # through all of sys.path. Since IPython adds your .ipython directory to
    558 # sys.path, they can also be placed in your .ipython dir and will be
    559 # found. Otherwise (if you want to execute things not in .ipyton nor in
    560 # sys.path) give a full path (you can use ~, it gets expanded)
    561 
    562 # Example:
    563 # execfile file1.py ~/file2.py
    564 # will generate
    565 # execfile('file1.py')
    566 # execfile('_path_to_your_home/file2.py')
    567 
    568 # As before, each file gets its own try/except block.
    569 
    570 execfile
    571 
    572 # If you are feeling adventurous, you can even add functionality to IPython
    573 # through here. IPython works through a global variable called __ip which
    574 # exists at the time when these files are read. If you know what you are doing
    575 # (read the source) you can add functions to __ip in files loaded here.
    576 
    577 # The file example-magic.py contains a simple but correct example. Try it:
    578 
    579 # execfile example-magic.py
    580 
    581 # Look at the examples in IPython/iplib.py for more details on how these magic
    582 # functions need to process their arguments.
    583 
    584 #---------------------------------------------------------------------------
    585 # Section: aliases for system shell commands
    586 
    587 # Here you can define your own names for system commands. The syntax is
    588 # similar to that of the builtin %alias function:
    589 
    590 # alias alias_name command_string
    591 
    592 # The resulting aliases are auto-generated magic functions (hence usable as
    593 # %alias_name)
    594 
    595 # For example:
    596 
    597 # alias myls ls -la
    598 
    599 # will define 'myls' as an alias for executing the system command 'ls -la'.
    600 # This allows you to customize IPython's environment to have the same aliases
    601 # you are accustomed to from your own shell.
    602 
    603 # You can also define aliases with parameters using %s specifiers (one per
    604 # parameter):
    605 
    606 # alias parts echo first %s second %s
    607 
    608 # will give you in IPython:
    609 # >>> %parts A B
    610 # first A second B
    611 
    612 # Use one 'alias' statement per alias you wish to define.
    613 
    614 # alias
    615 
    616 #************************* end of file <ipythonrc> ************************
  • deleted file ipython/ipythonrc-math

    diff --git a/ipython/ipythonrc-math b/ipython/ipythonrc-math
    deleted file mode 100644
    + -  
    1 # -*- Mode: Shell-Script -*-  Not really, but shows comments correctly
    2 #***************************************************************************
    3 #
    4 # Configuration file for ipython -- ipythonrc format
    5 #
    6 # The format of this file is one of 'key value' lines.
    7 # Lines containing only whitespace at the beginning and then a # are ignored
    8 # as comments. But comments can NOT be put on lines with data.
    9 #***************************************************************************
    10 
    11 # This is an example of a 'profile' file which includes a base file and adds
    12 # some customizaton for a particular purpose.
    13 
    14 # If this file is found in the user's ~/.ipython directory as ipythonrc-math,
    15 # it can be loaded by calling passing the '-profile math' (or '-p math')
    16 # option to IPython.
    17 
    18 # This example is a light customization to have ipython have basic math functions
    19 # readily available, effectively making the python prompt a very capable scientific
    20 # calculator
    21 
    22 # include base config and only add some extras
    23 include ipythonrc
    24 
    25 # load the complex math functions but keep them in a separate namespace
    26 import_mod cmath
    27 
    28 # from ... import *
    29 # load the real math functions in the global namespace for convenience
    30 import_all math
    31 
    32 # from ... import ...
    33 import_some
    34 
    35 # code to execute
    36 execute print "*** math functions available globally, cmath as a module"
  • deleted file ipython/ipythonrc-numeric

    diff --git a/ipython/ipythonrc-numeric b/ipython/ipythonrc-numeric
    deleted file mode 100644
    + -  
    1 # -*- Mode: Shell-Script -*-  Not really, but shows comments correctly
    2 #***************************************************************************
    3 #
    4 # Configuration file for ipython -- ipythonrc format
    5 #
    6 # The format of this file is one of 'key value' lines.
    7 # Lines containing only whitespace at the beginning and then a # are ignored
    8 # as comments. But comments can NOT be put on lines with data.
    9 #***************************************************************************
    10 
    11 # This is an example of a 'profile' file which includes a base file and adds
    12 # some customizaton for a particular purpose.
    13 
    14 # If this file is found in the user's ~/.ipython directory as
    15 # ipythonrc-numeric, it can be loaded by calling passing the '-profile
    16 # numeric' (or '-p numeric') option to IPython.
    17 
    18 # A simple alias numpy -> 'ipython -p numeric' makes life very convenient.
    19 
    20 # This example is meant to load several modules to turn IPython into a very
    21 # capable environment for high-end numerical work, similar to IDL or MatLab
    22 # but with the beauty and flexibility of the Python language.
    23 
    24 # Load the user's basic configuration
    25 include ipythonrc
    26 
    27 # import ...
    28 
    29 # Load Numeric by itself so that 'help Numeric' works
    30 import_mod Numeric
    31 
    32 # from ... import *
    33 # GnuplotRuntime loads Gnuplot and adds enhancements for use in IPython
    34 import_all Numeric IPython.numutils IPython.GnuplotInteractive
    35 
    36 # a simple line at zero, often useful for an x-axis
    37 execute xaxis=gpfunc('0',title='',with='lines lt -1')
    38 
    39 # Below are optional things off by default. Uncomment them if desired.
    40 
    41 # MA (MaskedArray) modifies the Numeric printing mechanism so that huge arrays
    42 # are only summarized and not printed (which may freeze the machine for a
    43 # _long_ time).
    44 
    45 #import_mod MA
    46 
    47 
    48 # gracePlot is a Python interface to the plotting package Grace.
    49 # For more details go to: http://www.idyll.org/~n8gray/code/index.html
    50 # Uncomment lines below if you have grace and its python support code
    51 
    52 #import_mod gracePlot
    53 #execute grace = gracePlot.gracePlot  # alias to make gracePlot instances
    54 #execute print '*** grace is an alias for gracePlot.gracePlot'
    55 
    56 # Files to execute
    57 execfile
  • deleted file ipython/ipythonrc-physics

    diff --git a/ipython/ipythonrc-physics b/ipython/ipythonrc-physics
    deleted file mode 100644
    + -  
    1 # -*- Mode: Shell-Script -*-  Not really, but shows comments correctly
    2 #***************************************************************************
    3 #
    4 # Configuration file for ipython -- ipythonrc format
    5 #
    6 # The format of this file is one of 'key value' lines.
    7 # Lines containing only whitespace at the beginning and then a # are ignored
    8 # as comments. But comments can NOT be put on lines with data.
    9 #***************************************************************************
    10 
    11 # If this file is found in the user's ~/.ipython directory as
    12 # ipythonrc-physics, it can be loaded by calling passing the '-profile
    13 # physics' (or '-p physics') option to IPython.
    14 
    15 # This profile loads modules useful for doing interactive calculations with
    16 # physical quantities (with units). It relies on modules from Konrad Hinsen's
    17 # ScientificPython (http://starship.python.net/crew/hinsen/)
    18 
    19 # First load basic user configuration
    20 include ipythonrc
    21 
    22 # import ...
    23 # Module with alternate input syntax for PhysicalQuantity objects.
    24 import_mod IPython.Extensions.PhysicalQInput
    25 
    26 # from ... import *
    27 # math CANNOT be imported after PhysicalQInteractive. It will override the
    28 # functions defined there.
    29 import_all math IPython.Extensions.PhysicalQInteractive
    30 
    31 # from ... import ...
    32 import_some 
    33 
    34 # code
    35 execute q = PhysicalQuantityInteractive
    36 execute g = PhysicalQuantityInteractive('9.8 m/s**2')
    37 ececute rad = pi/180.
    38 execute print '*** q is an alias for PhysicalQuantityInteractive'
    39 execute print '*** g = 9.8 m/s^2 has been defined'
    40 execute print '*** rad = pi/180  has been defined'
    41 
    42 # Files to execute
    43 execfile
  • deleted file ipython/ipythonrc-pysh

    diff --git a/ipython/ipythonrc-pysh b/ipython/ipythonrc-pysh
    deleted file mode 100644
    + -  
    1 # -*- Mode: Shell-Script -*-  Not really, but shows comments correctly
    2 #***************************************************************************
    3 # Configuration file for ipython -- ipythonrc format
    4 #
    5 # The format of this file is one of 'key value' lines.
    6 # Lines containing only whitespace at the beginning and then a # are ignored
    7 # as comments.  But comments can NOT be put on lines with data.
    8 #***************************************************************************
    9 
    10 # If this file is found in the user's ~/.ipython directory as ipythonrc-pysh,
    11 # it can be loaded by calling passing the '-profile pysh' (or '-p pysh')
    12 # option to IPython.
    13 
    14 # This profile turns IPython into a lightweight system shell with python
    15 # syntax.
    16 
    17 # We only set a few options here, the rest is done in the companion pysh.py
    18 # file.  In the future _all_ of IPython's configuration will be done via
    19 # proper python code.
    20 
    21 ############################################################################
    22 # First load common user configuration
    23 include ipythonrc
    24 
    25 ############################################################################
    26 # Load all the actual syntax extensions for shell-like operation, which live
    27 # in the InterpreterExec standard extension.
    28 import_all IPython.Extensions.InterpreterExec
    29 
    30 ############################################################################
    31 # PROMPTS
    32 #
    33 # Configure prompt for more shell-like usage.
    34 
    35 # Most bash-like escapes can be used to customize IPython's prompts, as well as
    36 # a few additional ones which are IPython-specific.  All valid prompt escapes
    37 # are described in detail in the Customization section of the IPython HTML/PDF
    38 # manual.
    39 
    40 prompt_in1 '\C_LightGreen\u@\h\C_LightBlue[\C_LightCyan\Y1\C_LightBlue]\C_Green|\#> '
    41 prompt_in2 '\C_Green|\C_LightGreen\D\C_Green> '
    42 prompt_out '<\#> '
    43 
    44 # Here's a more complex prompt, showing the hostname and more path depth (\Y3)
    45 #prompt_in1 '\C_LightRed\u\C_Blue@\C_Red\h\C_LightBlue[\C_LightCyan\Y3\C_LightBlue]\C_LightGreen\#> '
    46 
    47 # Select whether to left-pad the output prompts to match the length of the
    48 # input ones.  This allows you for example to use a simple '>' as an output
    49 # prompt, and yet have the output line up with the input.  If set to false,
    50 # the output prompts will be unpadded (flush left).
    51 prompts_pad_left 1
    52 
    53 
    54 # Remove all blank lines in between prompts, like a normal shell.
    55 separate_in 0
    56 separate_out 0
    57 separate_out2 0
    58 
    59 # Allow special syntax (!, magics and aliases) in multiline input
    60 multi_line_specials 1
    61 
    62 ############################################################################
    63 # ALIASES
    64 
    65 # Declare some common aliases. Type alias? at an ipython prompt for details on
    66 # the syntax, use @unalias to delete existing aliases.
    67 
    68 # Don't go too crazy here, the file pysh.py called below runs @rehash, which
    69 # loads ALL of your $PATH as aliases (except for Python keywords and
    70 # builtins).
    71 
    72 # Some examples:
    73 
    74 # A simple alias without arguments
    75 #alias cl clear
    76 
    77 # An alias which expands the full line before the end of the alias.  This
    78 # lists only directories:
    79 #alias ldir pwd;ls -oF --color %l | grep /$
    80 
    81 # An alias with two positional arguments:
    82 #alias parts echo 'First <%s> Second <%s>'
    83 
    84 # In use these two aliases give (note that ldir is already built into IPython
    85 # for Unix):
    86 
    87 #fperez[IPython]16> ldir
    88 #/usr/local/home/fperez/ipython/ipython/IPython
    89 #drwxr-xr-x  2 fperez  4096 Jun 21 01:01 CVS/
    90 #drwxr-xr-x  3 fperez  4096 Jun 21 01:10 Extensions/
    91 #drwxr-xr-x  3 fperez  4096 Jun 21 01:27 UserConfig/
    92 
    93 #fperez[IPython]17> parts Hello world and goodbye
    94 #First <Hello> Second <world> and goodbye
  • deleted file ipython/ipythonrc-scipy

    diff --git a/ipython/ipythonrc-scipy b/ipython/ipythonrc-scipy
    deleted file mode 100644
    + -  
    1 # -*- Mode: Shell-Script -*-  Not really, but shows comments correctly
    2 #***************************************************************************
    3 #
    4 # Configuration file for ipython -- ipythonrc format
    5 #
    6 # The format of this file is one of 'key value' lines.
    7 # Lines containing only whitespace at the beginning and then a # are ignored
    8 # as comments. But comments can NOT be put on lines with data.
    9 #***************************************************************************
    10 
    11 # This is an example of a 'profile' file which includes a base file and adds
    12 # some customizaton for a particular purpose.
    13 
    14 # If this file is found in the user's ~/.ipython directory as ipythonrc-scipy,
    15 # it can be loaded by calling passing the '-profile scipy' (or '-p scipy')
    16 # option to IPython.
    17 
    18 # This example is meant to load several modules to turn ipython into a very
    19 # capable environment for high-end numerical work, similar to IDL or MatLab
    20 # but with the beauty of the Python language.
    21 
    22 # load our basic configuration with generic options
    23 include ipythonrc
    24 
    25 # import ...
    26 # Load SciPy by itself so that 'help scipy' works
    27 import_mod scipy
    28 
    29 # from ... import ...
    30 import_some
    31 
    32 # Now we load all of SciPy
    33 # from ... import *
    34 import_all scipy IPython.numutils
    35 
    36 # code
    37 execute print 'Welcome to the SciPy Scientific Computing Environment.'
    38 execute scipy.alter_numeric()
    39 
    40 # File with alternate printer system for Numeric Arrays.
    41 # Files in the 'Extensions' directory will be found by IPython automatically
    42 # (otherwise give the explicit path):
    43 execfile Extensions/numeric_formats.py
  • deleted file ipython/ipythonrc-tutorial

    diff --git a/ipython/ipythonrc-tutorial b/ipython/ipythonrc-tutorial
    deleted file mode 100644
    + -  
    1 # -*- Mode: Shell-Script -*-  Not really, but shows comments correctly
    2 #***************************************************************************
    3 #
    4 # Configuration file for ipython -- ipythonrc format
    5 #
    6 # The format of this file is one of 'key value' lines.
    7 # Lines containing only whitespace at the beginning and then a # are ignored
    8 # as comments. But comments can NOT be put on lines with data.
    9 #***************************************************************************
    10 
    11 # If this file is found in the user's ~/.ipython directory as
    12 # ipythonrc-tutorial, it can be loaded by calling passing the '-profile
    13 # tutorial' (or '-p tutorial') option to IPython.
    14 
    15 # This profile loads a special input line filter to allow typing lines which
    16 # begin with '>>> ' or '... '. These two strings, if present at the start of
    17 # the input line, are stripped. This allows for direct pasting of code from
    18 # examples such as those available in the standard Python tutorial.
    19 
    20 # First load basic user configuration
    21 include ipythonrc
    22 
    23 # import ...
    24 # Module with alternate input syntax for pasting python input
    25 import_mod IPython.Extensions.InterpreterPasteInput
    26 
    27 # from ... import *
    28 import_all
    29 
    30 # from ... import ...
    31 import_some 
    32 
    33 # code
    34 execute
    35 
    36 # Files to execute
    37 execfile
  • spkg/bin/sage

    diff --git a/spkg/bin/sage b/spkg/bin/sage
    a b  
    8888    echo "  -ecl [...]          -- run Common Lisp"
    8989    echo "  -gap [...]          -- run Sage's Gap with given arguments"
    9090    echo "  -gdb                -- run Sage under the control of gdb"
    91     echo "  -gdb-ipython        -- run Sage's IPython under the control of gdb"
    9291    echo "  -gp [...]           -- run Sage's PARI/GP calculator with given arguments"
    9392    echo "  -hg [...]           -- run Sage's Mercurial with given arguments"
    9493    echo "  -ipython [...]      -- run Sage's IPython using the default environment (not"
     
    305304        sage-location || exit $?
    306305    fi
    307306
    308     export IPYTHONDIR="$DOT_SAGE/ipython"
    309     export IPYTHONRC="ipythonrc"
    310307    if [ ! -d "$IPYTHONDIR" ]; then
     308        # make sure that $DOT_SAGE exists so that ipython will happily
     309        # create its config directories there.  If DOT_SAGE doesn't
     310        # exist, ipython complains.
    311311        mkdir -p "$DOT_SAGE"
    312         cp -r "$SAGE_ROOT/ipython" "$DOT_SAGE/"
    313312    fi
    314313    sage-cleaner &>/dev/null &
    315314}
     
    595594    exit $status
    596595fi
    597596
    598 if [ "$1" = '-gdb-ipython'  -o "$1" = '--gdb-ipython' ]; then
    599     shift
    600     sage-gdb-ipython "$@"
    601     exit $?
    602 fi
    603 
    604597if [ "$1" = '-hg'  -o "$1" = '--hg' ]; then
    605598    shift
    606599    # Disable HGPLAIN, so we use all user defaults
  • spkg/bin/sage-env

    diff --git a/spkg/bin/sage-env b/spkg/bin/sage-env
    a b  
    320320    export SAGE_STARTUP_FILE
    321321fi
    322322
     323export IPYTHONDIR="$DOT_SAGE/ipython-0.12"
     324
    323325if [ -d "$SAGE_ROOT/local/lib/python" ]; then
    324326    PYTHONPATH="$SAGE_ROOT/local/lib/python"
    325327    if [ -n "$SAGE_PATH" ]; then