<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi there !<div><br></div><div>You did already a pretty decent job !</div><div><br></div><div>we are starting to document javascript you can see what it looks like here :</div><div><a href="http://elacave.lmdb.eu/~carreau/yui/">http://elacave.lmdb.eu/~carreau/yui/</a></div><div>And if you have more do cot add we'll be happy to take your pull request.</div><div><br></div></div></blockquote><div><br></div>Thanks a lot Matthias,<div><br></div><div><div><br></div><div>i'm trying to go ahead,  but with some problems</div><div><br></div><div>i should go ahead by little steps .. when i'll be able to do something that make sense i'll be more than happy to start a PR</div><div><br></div><div>so for now i'll try to work on a "svn info" button as test case (no input required and no needs to check the notebook name)</div><div><br></div><div>what it should do :</div><div><br></div><div>1)  run a system call that print some text as log</div><div>2)  parse the log in a dict</div><div>3) have the dict printed in a new cell </div><div><br></div><div><br></div><div><div>i'm aware that's my lack of JS knowledge, below some questions to better understand what you suggest me :</div><div><br></div><div><div>Il giorno 05/dic/2012, alle ore 10:23, Matthias BUSSONNIER <<a href="mailto:bussonniermatthias@gmail.com">bussonniermatthias@gmail.com</a>> ha scritto:</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>- detect the name  for the "notebook" (filename.ipnb)</div></div></blockquote><div><br></div><div>I'm not sure this can be easily accessible, but it could be a request for enhancement,</div><div>what you can do is : </div><div>IPython.notebook.notebook_name</div><div>To lowercasse, and space to _ then add ipynb.</div></div></div></div></blockquote><div><br></div><div><br></div><div>i didn't understand this steps :/</div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><br></div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">- clean all the output of the "notebook"</div></blockquote><div><br></div><div>this can be done progrmatically on server side with a custom script on the ipynb file.</div></div></div></div></blockquote><div><br></div><div>i saw the examples on the wiki page, that's great i can follow the example "remove_outputs" but this still require to low the notebook name</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>- save the "notebook"</div></div></blockquote><div><br></div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">IPython.notebook.</span><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">save_notebook()</span></div><div><font class="Apple-style-span" face="Menlo, monospace"><span class="Apple-style-span" style="font-size: 11px; white-space: pre-wrap; "><br></span></font><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>- commit the saved file (here should prompt a js text input box where to add the commit notes, but i can live without it as a start)</div></div></blockquote><div><br></div><div>it is doable, just a question of time to code it.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">            </span>IPython.toolbar.add_buttons_group([</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>    {</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>         'label'   : 'Save & Commit Notebook',</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>         'icon'    : 'ui-icon-circle-arrow-n', </div><div><span class="Apple-tab-span" style="white-space:pre">           </span>         'callback': function(){IPython.notebook.kernel.execute('detect the notebook name'),</div><div><span class="Apple-tab-span" style="white-space:pre">                             </span>                        IPython.notebook.kernel.execute('clean notebook'),</div><div><span class="Apple-tab-span" style="white-space:pre">                                                       </span>IPython.notebook.kernel.execute('save notebook'),</div><div><span class="Apple-tab-span" style="white-space:pre">                                                    </span>IPython.notebook.kernel.execute('svn commit notebook')}</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>    }</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>    ]);</div><div><br></div><div><br></div><div>i need an help to learn how to use "IPython.notebook.kernel.execute" from inside a JS code</div><div>i was looking in `docs/examples/widgets/directview` but i got lost :(</div></div></blockquote><div><br></div><div><br></div><div>So kernel.execute take callbacks, which get the data back, it's a little tricky.</div><div><br></div><div>let's do it for git : </div><div><br></div><div>IPython.notebook.kernel.execute(</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>'a=!git status', </div><div><span class="Apple-tab-span" style="white-space:pre">               </span>{'execute_reply': function(data){console.log('data:',data)}},</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> <span class="Apple-tab-span" style="white-space:pre">      </span>{'user_variables':['a']}</div><div>    )</div><div><br></div><div>( Note for later, to do this properly, it should be done with user_expression, but there is an issue, i don't now why)</div><div><br></div><div>function(data){console.log('data:',data)}</div><div><br></div><div>will be called with the response as parameter, </div><div>here login the data to the js console.</div><div><br></div><div>Data will be an object with a few parameters ( i'll let you explore), the one that interests us is user_variable ( we requested 'a' above) </div><div><br></div><div>which itself as a 'a' key.</div><div><br></div><div>data.user_variables.a is the following strig :</div><div><span style="color: rgb(196, 26, 22); font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">"['# On branch master', '# Changes not staged for commit:', '#   (use "git add <file>..." to update what will be committed)', '#   (use "git checkout -- <file>..." to discard….."</span></div><div>(using user_expression would prevnt polluting the kernel with the 'a' variable but it raises.</div><div>then you can do whatever you wish with the variable in the callback.</div></div></div></div></blockquote><div><br></div><div><br></div><div><div>i changed the code of the svninfo button to :</div><div><br></div><div><br></div><div><div>IPython.toolbar.add_buttons_group([</div><div><span class="Apple-tab-span" style="white-space: pre; ">      </span>{</div><div><span class="Apple-tab-span" style="white-space: pre; ">         </span>'label'   : 'SVN Info',</div><div><span class="Apple-tab-span" style="white-space: pre; ">              </span>'icon'    : 'ui-icon-info', </div><div><span class="Apple-tab-span" style="white-space: pre; ">               </span>'callback': function(){IPython.notebook.kernel.execute('a = !svn info'), </div><div><span class="Apple-tab-span" style="white-space: pre; ">            </span>                       IPython.notebook.kernel.execute('svninfo = {i.split(": ")[0]:i.split(": ")[1] for i in a[:-1]}',</div><div><span class="Apple-tab-span" style="white-space: pre; ">                                                   </span>                                          {'execute_reply': function(data){console.log('data:',data)}},</div><div><span class="Apple-tab-span" style="white-space: pre; ">                                                                                          </span>  {'user_variables':['svninfo']})</div><div><span class="Apple-tab-span" style="white-space: pre; ">                                                       </span>  }</div><div><span class="Apple-tab-span" style="white-space: pre; ">     </span>}</div><div>]);</div></div><div><br></div><div><br></div><div>i'm not yet able to print out the dict in a new cell … </div><div><br></div><div>the svninfo dictionary is available in the notebook's code cell (after i press the info button), </div><div>so the IPython.notebook.kernel.execute works as aspected and the </div><div><br></div><div>svninfo is also available in the JS console.</div><div><br></div><div>but trying to add the svninfo in the "last" cell adding a line in the button like :</div><div><br></div><div>#</div><div>…</div><div>{'user_variables':['svninfo']}),</div><div>IPython.notebook.get_cell(-1).set_text(svninfo)</div><div>#</div><div><br></div><div>but i have errors .. i guess i should not pass the python dict to set_text()</div><div><br></div><div><span style="box-sizing: border-box; color: rgb(255, 0, 0); font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; background-color: rgb(255, 255, 255); ">Uncaught ReferenceError: svninfo is not defined</span><span style="color: rgb(255, 0, 0); font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> </span></div><div><br></div><div><div>i tried to give the JS object :</div><div><br></div><div><div>#</div><div>…</div><div>{'user_variables':['svninfo']}),</div></div><div>IPython.notebook.get_cell(-1).set_text(data.user_variables.svninfo)</div></div><div>#</div><div><br></div><div>but it gave me </div><div><br></div><div><br></div><div><div class="console-group" style="box-sizing: border-box; position: relative; font-family: Menlo, monospace; font-size: 11px; background-color: rgb(255, 255, 255); "><div class="console-group-messages" style="box-sizing: border-box; "><div class="console-message console-error-level" style="box-sizing: border-box; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(240, 240, 240); padding: 1px 22px 1px 0px; margin-left: 24px; min-height: 16px; "><ol class="outline-disclosure" tabindex="0" style="box-sizing: border-box; font-size: inherit; list-style-type: none; -webkit-padding-start: 12px; margin: 0px; outline: none; padding-left: 0px; line-height: 12px; "><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-bottom: 1px; margin-left: -12px; word-wrap: break-word; "><span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; color: red !important; "><span style="box-sizing: border-box; ">Uncaught ReferenceError: data is not defined</span> <a href="http://127.0.0.1:8888/static/js/custom.js?v=417ed" class="console-message-url webkit-html-resource-link" title="http://127.0.0.1:8888/static/js/custom.js?v=417ed" style="box-sizing: border-box; float: right; margin-left: 4px; color: rgb(84, 84, 84); cursor: pointer; max-width: 100%; ">custom.js:32</a></span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 0px 0px 0px 12px !important; list-style-type: none; -webkit-padding-start: 12px; font-size: inherit; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-bottom: 1px; margin-left: -2px; word-wrap: break-word; "><div style="box-sizing: border-box; "><span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; color: red !important; ">IPython.toolbar.add_buttons_group.callback</span><a href="http://127.0.0.1:8888/static/js/custom.js?v=417ed" class="console-message-url webkit-html-resource-link" title="http://127.0.0.1:8888/static/js/custom.js?v=417ed" style="box-sizing: border-box; float: right; margin-left: 4px; color: rgb(84, 84, 84); cursor: pointer; max-width: 100%; ">custom.js:32</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-bottom: 1px; margin-left: -2px; word-wrap: break-word; "><div style="box-sizing: border-box; "><span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; color: red !important; ">f.event.dispatch</span><a href="http://127.0.0.1:8888/static/jquery/js/jquery-1.7.1.min.js?v=ddb84" class="console-message-url webkit-html-resource-link" title="http://127.0.0.1:8888/static/jquery/js/jquery-1.7.1.min.js?v=ddb84" style="box-sizing: border-box; float: right; margin-left: 4px; color: rgb(84, 84, 84); cursor: pointer; max-width: 100%; ">jquery-1.7.1.min.js:3</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-bottom: 1px; margin-left: -2px; word-wrap: break-word; "><div style="box-sizing: border-box; "><span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; color: red !important; ">h.handle.i</span><a href="http://127.0.0.1:8888/static/jquery/js/jquery-1.7.1.min.js?v=ddb84" class="console-message-url webkit-html-resource-link" title="http://127.0.0.1:8888/static/jquery/js/jquery-1.7.1.min.js?v=ddb84" style="box-sizing: border-box; float: right; margin-left: 4px; color: rgb(84, 84, 84); cursor: pointer; max-width: 100%; ">jquery-1.7.1.min.js:3</a></div></li></ol></ol></div><div class="console-message console-log-level" style="box-sizing: border-box; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(240, 240, 240); padding: 1px 22px 1px 0px; margin-left: 24px; min-height: 16px; z-index: auto; "><span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; "><span style="box-sizing: border-box; ">data: <span class="console-formatted-object source-code" style="box-sizing: border-box; position: relative; display: inline-block; vertical-align: top; "><div class="section" style="box-sizing: border-box; position: static; margin: 0px 0px 0px 12px !important; "><div class="header monospace" style="box-sizing: border-box; padding: 0px 8px 0px 0px; min-height: 0px; white-space: nowrap; -webkit-background-origin: padding; -webkit-background-clip: padding; background-image: none; border: none; "><div class="subtitle" style="box-sizing: border-box; float: right; margin-left: 5px; max-width: 55%; text-overflow: ellipsis; overflow: hidden; "></div><div class="title" style="box-sizing: border-box; word-wrap: break-word; white-space: normal; line-height: 13px; "><span class="console-object-preview" style="box-sizing: border-box; font-style: italic; ">Object {<span class="name" style="box-sizing: border-box; color: rgb(136, 19, 145); ">status</span>: <span class="console-formatted-string" style="box-sizing: border-box; color: rgb(196, 26, 22); white-space: pre; ">"ok"</span>, <span class="name" style="box-sizing: border-box; color: rgb(136, 19, 145); ">execution_count</span>: <span class="console-formatted-number" style="box-sizing: border-box; color: rgb(28, 0, 207); ">0</span>, <span class="name" style="box-sizing: border-box; color: rgb(136, 19, 145); ">user_variables</span>: <span class="console-formatted-object" style="box-sizing: border-box; position: relative; display: inline-block; vertical-align: top; ">Object</span>, <span class="name" style="box-sizing: border-box; color: rgb(136, 19, 145); ">payload</span>: <span class="console-formatted-object" style="box-sizing: border-box; position: relative; display: inline-block; vertical-align: top; ">Array[0]</span>, <span class="name" style="box-sizing: border-box; color: rgb(136, 19, 145); ">user_expressions</span>: <span class="console-formatted-object" style="box-sizing: border-box; position: relative; display: inline-block; vertical-align: top; ">Object</span>}</span></div></div></div></span></span> <a href="http://127.0.0.1:8888/static/js/custom.js?v=417ed" class="console-message-url webkit-html-resource-link" title="http://127.0.0.1:8888/static/js/custom.js?v=417ed" style="box-sizing: border-box; float: right; margin-left: 4px; color: rgb(84, 84, 84); cursor: pointer; max-width: 100%; ">custom.js:30</a></span></div></div></div><span style="box-sizing: border-box; font-family: Menlo, monospace; font-size: 11px; background-color: rgb(255, 255, 255); display: block; "></span></div><div><br></div><div></div></div><div><br></div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><br></div><div>see </div><div><a href="http://wiki.ipython.org/Notebook_feedback">http://wiki.ipython.org/Notebook_feedback</a></div><div>to strip notebook programatically ( in the gist at the end of the page) </div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>have you any hints on how can i use the ipython.notebook.kernel  in order to :</div><div><br></div><div>- print out some text in a new notebook cell </div></div></blockquote><div><br></div><div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">IPython.notebook.</span><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">get_cell(i).</span><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">set_text(…)</span></div><div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><br></span></div><div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">IPython.notebook.select(n)</span></span></div><div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">IPython.notebook.</span><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">insert_cell_above()</span></span></div><div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">…</span></span></div><div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><br></span></span></div><div><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><span style="font-family: Menlo, monospace; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">should be of help.</span></span></div></div></div></div></blockquote><div><br></div><div><br></div><div><div>i can print a string (not yet a python object) in the last cell using something like :</div><div><br></div><div>IPython.notebook.get_cell(-1).set_text('…some text….')</div><div><br></div><div>but i don't know how to "add" a new cell,</div><div><br></div><div>let's say i want add a cell at the end, i should select the n=-1 with :</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span style="font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; background-color: rgb(255, 255, 255); ">IPython.notebook.select(n)</span></div></blockquote><br></div><div>then :</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span style="font-family: Menlo, monospace; font-size: 11px; white-space: pre-wrap; background-color: rgb(255, 255, 255); ">IPython.notebook.insert_cell_above()</span></div></blockquote><br></div><div>and at the end :</div><div><br></div><div><br></div><div>IPython.notebook.get_cell(-1).set_text('…some text….')</div></div><div><br></div><div>but the cell is not added</div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>- detect the name for the active notebook</div><div>- clear all the output for the active notebook</div><div><br></div><div><br></div><div>Thanks a lot for you help,</div></div></blockquote><div><br></div><div>click on button -> callback a</div><div><br></div><div>callback a fetch info on the kernel trigger callback b on the response</div><div><br></div><div>callback b -> show a dialog to ask for commit message</div><div><br></div><div>click on ok trigger the correct information to be send on the kernel to commit.</div><div><br></div></div></div></div></blockquote><div><br></div><div>does this means i can have more "callback"  executed when the same "button" is triggered ?</div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><br></div><div>Does it help ? </div><div>We probably want to do something like that in a more generic way embedded into IPython notebook. </div><div><br></div><div>We'll be happy to get your feedback on that !</div><div><br></div><div>-- </div><div>Matthias</div></div></div></div></blockquote><div><br></div><div> i'm a bit slow in learning how the system works (my fault)</div><div><div>it is helping me a lot!</div><div><br></div><div>Thanks!</div><div><br></div><div>--MAssimo.</div><div><br></div></div></div><br></div></div></body></html>