Opened 8 years ago

Last modified 7 years ago

#13621 closed enhancement

slight improvement in notebook documentation — at Version 4

Reported by: startakovsky Owned by: jason, mpatel, was
Priority: trivial Milestone: sage-duplicate/invalid/wontfix
Component: notebook Keywords:
Cc: kini, jason Merged in:
Authors: Reviewers:
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by kcrisman)

The documentation at http://www.sagemath.org/doc/reference/sagenb/notebook/notebook_object.html#sagenb.notebook.notebook_object.NotebookObject is potentially slightly confusing to a newcomer - see below.


Original: My output is the following based on instructions from the website. I am using Sage 5.3.

Thanks.

sage: from sagenb.notebook.notebook import load_notebook
sage: nb = load_notebook(dir)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/steven/<ipython console> in <module>()

/home/steven/sage-5.3/devel/sagenb/sagenb/notebook/notebook.pyc in load_notebook(dir, interface, port, secure, user_manager)
   1779     - a Notebook instance
   1780     """
-> 1781     if not dir.endswith('.sagenb'):
   1782         if not os.path.exists(dir + '.sagenb') and os.path.exists(os.path.join(dir, 'nb.sobj')):
   1783             try:

AttributeError: 'builtin_function_or_method' object has no attribute 'endswith'
sage: 

Change History (4)

comment:1 Changed 8 years ago by kcrisman

  • Component changed from PLEASE CHANGE to notebook
  • Owner changed from tbd to jason, mpatel, was
  • Type changed from PLEASE CHANGE to defect

comment:2 Changed 8 years ago by kcrisman

  • Description modified (diff)

comment:3 Changed 8 years ago by kcrisman

  • Cc kini jason added

Assuming you're referring to the instructions below this point, you have to actually give the dir a name! Otherwise you're just using Python's built-in dir command. I suppose this depends on what you want.

sage: load_notebook?
Definition:     load_notebook(dir, interface=None, port=None, secure=None, user_manager=None)
Docstring:
       Load and return a notebook from a given directory.  Create a new
       one in that directory, if one isn't already there.
    
       INPUT:
    
       * "dir" - a string that defines a directory name
    

I'm not sure this is really a bug, though perhaps a little change in documentation wouldn't hurt.

comment:4 Changed 8 years ago by kcrisman

  • Description modified (diff)
  • Priority changed from major to trivial
  • Summary changed from adding new user in notebook to slight improvement in notebook documentation
  • Type changed from defect to enhancement
Note: See TracTickets for help on using tickets.