<title>smashlib API documentation</title>
<meta name="description" content="smashlib" />

Top

<article id="content">

smashlib module

smashlib

""" smashlib
"""
version = 0.1
import os
from goulash._inspect import get_caller
from smashlib.import_hooks import hijack_ipython_module

def start_ipython(argv=None, kwargs): from smashlib.overrides import launch_new_instance return launch_new_instance(argv=argv, kwargs)

def embed(argv=tuple(), kargs): hijack_ipython_module() # if os.environ.get('SMASH', None): # print "..detected nesting.. this may cause problems" context = kargs.pop('user_ns', {}) caller_context = get_caller(2) if context is not None: context.update(caller_context['globals']) context.update(caller_context['locals']) if '--no-confirm-exit' not in argv: argv = ['--no-confirm-exit'] + list(argv) try: start_ipython(argv=argv, user_ns=context, kargs) except KeyboardInterrupt: print 'caught kbi'

def get_smash(): try: ip = get_ipython() except NameError: return None try: return ip._smash except AttributeError: raise Exception("load smash first")

<h2 class="section-title" id="header-functions">Functions</h2>

def embed(

argv=(), **kargs)

def embed(argv=tuple(), kargs):
    hijack_ipython_module()
    # if os.environ.get('SMASH', None):
    #    print "..detected nesting.. this may cause problems"
    context = kargs.pop('user_ns', {})
    caller_context = get_caller(2)
    if context is not None:
        context.update(caller_context['globals'])
        context.update(caller_context['locals'])
    if '--no-confirm-exit' not in argv:
        argv = ['--no-confirm-exit'] + list(argv)
    try:
        start_ipython(argv=argv, user_ns=context, kargs)
    except KeyboardInterrupt:
        print 'caught kbi'

def get_smash(

)

def get_smash():
    try:
        ip = get_ipython()
    except NameError:
        return None
    try:
        return ip._smash
    except AttributeError:
        raise Exception("load smash first")

def start_ipython(

argv=None, **kwargs)

def start_ipython(argv=None, kwargs):
    from smashlib.overrides import launch_new_instance
    return launch_new_instance(argv=argv, kwargs)

<h2 class="section-title" id="header-submodules">Sub-modules</h2>
  <div class="item">
  <p class="name"><a href="bases/index.html">smashlib.bases</a></p>


<div class="desc"><p>smashlib.bases</p></div>

  </div>
  <div class="item">
  <p class="name"><a href="bin/index.html">smashlib.bin</a></p>



  </div>
  <div class="item">
  <p class="name"><a href="channels.m.html">smashlib.channels</a></p>


<div class="desc"><p>smashlib.channels</p></div>

  </div>
  <div class="item">
  <p class="name"><a href="contrib/index.html">smashlib.contrib</a></p>



  </div>
  <div class="item">
  <p class="name"><a href="data.m.html">smashlib.data</a></p>


<div class="desc"><p>smashlib.data</p></div>

  </div>
  <div class="item">
  <p class="name"><a href="exceptions.m.html">smashlib.exceptions</a></p>


<div class="desc"><p>smashlib.exceptions</p></div>

  </div>
  <div class="item">
  <p class="name"><a href="import_hooks.m.html">smashlib.import_hooks</a></p>


<div class="desc"><p>smashlib.import_hooks</p></div>

  </div>
  <div class="item">
  <p class="name"><a href="prefilters/index.html">smashlib.prefilters</a></p>


<div class="desc"><p>smashlib.prefilters</p></div>

  </div>
  <div class="item">
  <p class="name"><a href="prompt/index.html">smashlib.prompt</a></p>


<div class="desc"><p>smashlib.prompt</p></div>

  </div>
  <div class="item">
  <p class="name"><a href="testing.m.html">smashlib.testing</a></p>


<div class="desc"><p>smashlib.testing</p>

Base classes, etc for smashlib's tests.

Note: The tests themselves are in the source root, not inside the smashlib package

  </div>
  <div class="item">
  <p class="name"><a href="v2.m.html">smashlib.v2</a></p>



  </div>
  <div class="item">
  <p class="name"><a href="version.m.html">smashlib.version</a></p>


<div class="desc"><p>smashlib.version</p></div>

  </div>
</article>

Documentation generated by pdoc 0.3.1

<p>pdoc is in the public domain with the
  <a href="http://unlicense.org">UNLICENSE</a></p>

<p>Design by <a href="http://nadh.in">Kailash Nadh</a></p>