Repository: ipython/ipython

Issue:
Default DOMWidget Padding should be 0px, and Button styling issue
@jdfreder

![padding](https://cloud.githubusercontent.com/assets/2397974/6379572/53fb8cfc-bd01-11e4-9786-f350566688b0.png)


Discussion:

Patch:
diff --git a/IPython/config/manager.py b/IPython/config/manager.py
index 429bfaa97..0628a6afa 100644
--- a/IPython/config/manager.py
+++ b/IPython/config/manager.py
@@ -86,7 +86,7 @@ def set(self, section_name, data):
         else:
             f = open(filename, 'wb')
         with f:
-            json.dump(data, f, indent=2)
+            json.dump(data, f)
 
     def update(self, section_name, new_data):
         """Modify the config section by recursively updating it with new_data.
diff --git a/IPython/html/services/config/manager.py b/IPython/html/services/config/manager.py
index c26828428..78b4c45e8 100644
--- a/IPython/html/services/config/manager.py
+++ b/IPython/html/services/config/manager.py
@@ -8,7 +8,7 @@
 from IPython.config.manager import BaseJSONConfigManager
 
 class ConfigManager(BaseJSONConfigManager):
-    """Config Manager used for storing notebook frontend config"""
+    """Config Manager use for storin Javascript side config"""
 
     def _config_dir(self):
         return os.path.join(self.profile_dir, 'nbconfig')
diff --git a/IPython/html/services/contents/filemanager.py b/IPython/html/services/contents/filemanager.py
index c502d4816..29ddfde5f 100644
--- a/IPython/html/services/contents/filemanager.py
+++ b/IPython/html/services/contents/filemanager.py
@@ -348,7 +348,7 @@ def get(self, path, content=True, type=None, format=None):
         else:
             if type == 'directory':
                 raise web.HTTPError(400,
-                                u'%s is not a directory' % path, reason='bad type')
+                                u'%s is not a directory', reason='bad type')
             model = self._file_model(path, content=content, format=format)
         return model
 
diff --git a/IPython/html/services/sessions/sessionmanager.py b/IPython/html/services/sessions/sessionmanager.py
index 967c4b16e..4f05bf172 100644
--- a/IPython/html/services/sessions/sessionmanager.py
+++ b/IPython/html/services/sessions/sessionmanager.py
@@ -16,7 +16,7 @@
 class SessionManager(LoggingConfigurable):
 
     kernel_manager = Instance('IPython.html.services.kernels.kernelmanager.MappingKernelManager')
-    contents_manager = Instance('IPython.html.services.contents.manager.ContentsManager')
+    contents_manager = Instance('IPython.html.services.contents.manager.ContentsManager', args=())
     
     # Session database initialized below
     _cursor = None
diff --git a/IPython/html/static/style/ipython.min.css b/IPython/html/static/style/ipython.min.css
index 20a2c464f..3e160b551 100644
--- a/IPython/html/static/style/ipython.min.css
+++ b/IPython/html/static/style/ipython.min.css
@@ -1195,6 +1195,10 @@ h6:hover .anchor-link {
   font-size: 100%;
   font-style: italic;
 }
+.widget-interact > div,
+.widget-interact > input {
+  padding: 2.5px;
+}
 .widget-area {
   /*
     LESS file that styles IPython notebook widgets and the area they sit in.
diff --git a/IPython/html/static/style/style.min.css b/IPython/html/static/style/style.min.css
index a36c23633..feface624 100644
--- a/IPython/html/static/style/style.min.css
+++ b/IPython/html/static/style/style.min.css
@@ -9978,6 +9978,10 @@ h6:hover .anchor-link {
   font-size: 100%;
   font-style: italic;
 }
+.widget-interact > div,
+.widget-interact > input {
+  padding: 2.5px;
+}
 .widget-area {
   /*
     LESS file that styles IPython notebook widgets and the area they sit in.
diff --git a/IPython/html/static/widgets/less/widgets.less b/IPython/html/static/widgets/less/widgets.less
index 08a920e05..ffe3decf8 100644
--- a/IPython/html/static/widgets/less/widgets.less
+++ b/IPython/html/static/widgets/less/widgets.less
@@ -1,6 +1,13 @@
 @widget-width: 350px;
 @widget-width-short: 150px;
 
+// Pad interact widgets by default.
+.widget-interact {
+    >div, >input {
+        padding: 2.5px;
+    }
+}
+
 .widget-area {
     /*
     LESS file that styles IPython notebook widgets and the area they sit in.
diff --git a/IPython/html/widgets/interaction.py b/IPython/html/widgets/interaction.py
index 76d63f524..b9e37defc 100644
--- a/IPython/html/widgets/interaction.py
+++ b/IPython/html/widgets/interaction.py
@@ -181,7 +181,7 @@ def interactive(__interact_f, **kwargs):
     co = kwargs.pop('clear_output', True)
     manual = kwargs.pop('__manual', False)
     kwargs_widgets = []
-    container = Box()
+    container = Box(_dom_classes=['widget-interact'])
     container.result = None
     container.args = []
     container.kwargs = dict()
diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py
index fcb76c0a4..062b6716b 100644
--- a/IPython/html/widgets/widget.py
+++ b/IPython/html/widgets/widget.py
@@ -435,7 +435,7 @@ class DOMWidget(Widget):
     width = CUnicode(sync=True)
     height = CUnicode(sync=True)
     # A default padding of 2.5 px makes the widgets look nice when displayed inline.
-    padding = CUnicode("2.5px", sync=True)
+    padding = CUnicode(sync=True)
     margin = CUnicode(sync=True)
 
     color = Unicode(sync=True)
diff --git a/IPython/nbconvert/postprocessors/serve.py b/IPython/nbconvert/postprocessors/serve.py
index 09caedd3d..d2383bed4 100644
--- a/IPython/nbconvert/postprocessors/serve.py
+++ b/IPython/nbconvert/postprocessors/serve.py
@@ -1,9 +1,16 @@
 """PostProcessor for serving reveal.js HTML slideshows."""
-
-# Copyright (c) IPython Development Team.
-# Distributed under the terms of the Modified BSD License.
-
 from __future__ import print_function
+#-----------------------------------------------------------------------------
+#Copyright (c) 2013, the IPython Development Team.
+#
+#Distributed under the terms of the Modified BSD License.
+#
+#The full license is in the file COPYING.txt, distributed with this software.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
 
 import os
 import webbrowser
@@ -15,6 +22,9 @@
 
 from .base import PostProcessorBase
 
+#-----------------------------------------------------------------------------
+# Classes
+#-----------------------------------------------------------------------------
 
 class ProxyHandler(web.RequestHandler):
     """handler the proxies requests from a local prefix to a CDN"""
@@ -27,15 +37,12 @@ def get(self, prefix, url):
     
     def finish_get(self, response):
         """finish the request"""
-        # rethrow errors
-        response.rethrow()
-        
+        # copy potentially relevant headers
         for header in ["Content-Type", "Cache-Control", "Date", "Last-Modified", "Expires"]:
             if header in response.headers:
                 self.set_header(header, response.headers[header])
         self.finish(response.body)
 
-
 class ServePostProcessor(PostProcessorBase):
     """Post processor designed to serve files
     
diff --git a/docs/source/parallel/dag_dependencies.rst b/docs/source/parallel/dag_dependencies.rst
index a94dd3140..06ba12f76 100644
--- a/docs/source/parallel/dag_dependencies.rst
+++ b/docs/source/parallel/dag_dependencies.rst
@@ -123,7 +123,7 @@ on which it depends:
        ...:    deps = [ results[n] for n in G.predecessors(node) ]
        ...:    # submit and store AsyncResult object
        ...:    with view.temp_flags(after=deps, block=False):
-       ...:         results[node] = view.apply(jobs[node])
+       ...:         results[node] = view.apply_with_flags(jobs[node])
 
 
 Now that we have submitted all the jobs, we can wait for the results:
diff --git a/examples/Interactive Widgets/Index.ipynb b/examples/Interactive Widgets/Index.ipynb
index d4da12c04..5049b4fd7 100644
--- a/examples/Interactive Widgets/Index.ipynb
+++ b/examples/Interactive Widgets/Index.ipynb
@@ -42,7 +42,7 @@
     "- [Using Interact](Using Interact.ipynb)\n",
     "- [Widget Basics](Widget Basics.ipynb)  \n",
     "- [Widget Events](Widget Events.ipynb)  \n",
-    "- [Widget List](Widget List.ipynb)  \n",
+    "- [Widget Placement](Widget Placement.ipynb)  \n",
     "- [Widget Styling](Widget Styling.ipynb)    \n",
     "- [Custom Widget](Custom Widget - Hello World.ipynb)"
    ]


Test patch:
diff --git a/IPython/html/services/sessions/tests/test_sessionmanager.py b/IPython/html/services/sessions/tests/test_sessionmanager.py
index 78036c961..36980bd6a 100644
--- a/IPython/html/services/sessions/tests/test_sessionmanager.py
+++ b/IPython/html/services/sessions/tests/test_sessionmanager.py
@@ -6,7 +6,6 @@
 
 from ..sessionmanager import SessionManager
 from IPython.html.services.kernels.kernelmanager import MappingKernelManager
-from IPython.html.services.contents.manager import ContentsManager
 
 class DummyKernel(object):
     def __init__(self, kernel_name='python'):
@@ -29,17 +28,10 @@ def start_kernel(self, kernel_id=None, path=None, kernel_name='python', **kwargs
     def shutdown_kernel(self, kernel_id, now=False):
         del self._kernels[kernel_id]
 
-
 class TestSessionManager(TestCase):
     
-    def setUp(self):
-        self.sm = SessionManager(
-            kernel_manager=DummyMKM(),
-            contents_manager=ContentsManager(),
-        )
-
     def test_get_session(self):
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         session_id = sm.create_session(path='/path/to/test.ipynb',
                                        kernel_name='bar')['id']
         model = sm.get_session(session_id=session_id)
@@ -50,13 +42,13 @@ def test_get_session(self):
 
     def test_bad_get_session(self):
         # Should raise error if a bad key is passed to the database.
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         session_id = sm.create_session(path='/path/to/test.ipynb',
                                        kernel_name='foo')['id']
         self.assertRaises(TypeError, sm.get_session, bad_id=session_id) # Bad keyword
 
     def test_get_session_dead_kernel(self):
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         session = sm.create_session(path='/path/to/1/test1.ipynb', kernel_name='python')
         # kill the kernel
         sm.kernel_manager.shutdown_kernel(session['kernel']['id'])
@@ -67,7 +59,7 @@ def test_get_session_dead_kernel(self):
         self.assertEqual(listed, [])
 
     def test_list_sessions(self):
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         sessions = [
             sm.create_session(path='/path/to/1/test1.ipynb', kernel_name='python'),
             sm.create_session(path='/path/to/2/test2.ipynb', kernel_name='python'),
@@ -92,7 +84,7 @@ def test_list_sessions(self):
         self.assertEqual(sessions, expected)
 
     def test_list_sessions_dead_kernel(self):
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         sessions = [
             sm.create_session(path='/path/to/1/test1.ipynb', kernel_name='python'),
             sm.create_session(path='/path/to/2/test2.ipynb', kernel_name='python'),
@@ -115,7 +107,7 @@ def test_list_sessions_dead_kernel(self):
         self.assertEqual(listed, expected)
 
     def test_update_session(self):
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         session_id = sm.create_session(path='/path/to/test.ipynb',
                                        kernel_name='julia')['id']
         sm.update_session(session_id, path='/path/to/new_name.ipynb')
@@ -127,13 +119,13 @@ def test_update_session(self):
     
     def test_bad_update_session(self):
         # try to update a session with a bad keyword ~ raise error
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         session_id = sm.create_session(path='/path/to/test.ipynb',
                                        kernel_name='ir')['id']
         self.assertRaises(TypeError, sm.update_session, session_id=session_id, bad_kw='test.ipynb') # Bad keyword
 
     def test_delete_session(self):
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         sessions = [
             sm.create_session(path='/path/to/1/test1.ipynb', kernel_name='python'),
             sm.create_session(path='/path/to/2/test2.ipynb', kernel_name='python'),
@@ -155,7 +147,7 @@ def test_delete_session(self):
 
     def test_bad_delete_session(self):
         # try to delete a session that doesn't exist ~ raise error
-        sm = self.sm
+        sm = SessionManager(kernel_manager=DummyMKM())
         sm.create_session(path='/path/to/test.ipynb', kernel_name='python')
         self.assertRaises(TypeError, sm.delete_session, bad_kwarg='23424') # Bad keyword
         self.assertRaises(web.HTTPError, sm.delete_session, session_id='23424') # nonexistant