Ticket #1395: 1395.patch

File 1395.patch, 1.7 KB (added by mhansen, 14 years ago)
  • sage/server/notebook/notebook.py

    # HG changeset patch
    # User Mike Hansen <mhansen@gmail.com>
    # Date 1196901428 21600
    # Node ID 224f92c7866ca84624b21ca5b334134a4da1eaa1
    # Parent  eabb9284650a974e24ae2f2d1c580dcbf14fc39b
    Fixed #1395.
    
    diff -r eabb9284650a -r 224f92c7866c sage/server/notebook/notebook.py
    a b class Notebook(SageObject): 
    5151                 port=8000,
    5252                 secure=True,
    5353                 server_pool = []):
     54        if isinstance(dir, basestring) and len(dir) > 0 and dir[-1] == "/":
     55            dir = dir[:-1]
    5456        self.__dir = dir
     57
    5558        self.__server_pool = server_pool
    5659        self.set_system(system)
    5760        self.__worksheets = {}
    class Notebook(SageObject): 
    417420    def set_directory(self, dir):
    418421        if dir == self.__dir:
    419422            return
     423        if isinstance(dir, basestring) and len(dir) > 0 and dir[-1] == "/":
     424            dir = dir[:-1]
    420425        self.__dir = dir
    421426        self.__filename = '%s/nb.sobj'%dir
    422427        self.__worksheet_dir = '%s/worksheets'%dir
  • sage/server/notebook/run_notebook.py

    diff -r eabb9284650a -r 224f92c7866c sage/server/notebook/run_notebook.py
    a b def notebook_twisted(self, 
    6161             start_path = ""):
    6262    if directory is None:
    6363        directory = '%s/sage_notebook'%DOT_SAGE
     64    else:
     65        if isinstance(directory, basestring) and len(directory) > 0 and directory[-1] == "/":
     66            directory = directory[:-1]
     67           
    6468    if not os.path.exists(directory):
    6569        os.makedirs(directory)
    6670