Package sage :: Package server :: Package notebook :: Module twist
[hide private]
[frames] | no frames]

Module twist

source code


The Sage Notebook Twisted Web Server



Classes [hide private]
  WorksheetFile
  DocStatic
  DocLive
  Doc
  SageTex
  SourceBrowser
  Source
  NewWorksheet
  Upload
  UploadWorksheet
  WorksheetResource
  Worksheet_savedatafile
  Worksheet_link_datafile
  Worksheet_upload_data
  Worksheet_do_upload_data
  Worksheet_datafile
  Worksheet_data
  CellData
  Worksheet_cells
  Worksheet_alive
  Worksheet_conf
  TrivialResource
  Worksheet_system
  Worksheet_pretty_print
  Worksheet_introspect
Cell introspection.
  Worksheet_edit
Return a window that allows the user to edit the text of the worksheet with the given filename.
  Worksheet_text
Return a window that allows the user to edit the text of the worksheet with the given filename.
  Worksheet_copy
  Worksheet_edit_published_page
  Worksheet_save
Save the contents of a worksheet after editing it in plain-text edit mode.
  Worksheet_save_snapshot
Save a snapshot of a worksheet.
  Worksheet_save_and_quit
Save a snapshot of a worksheet and quit.
  Worksheet_discard_and_quit
Save a snapshot of a worksheet and quit.
  Worksheet_revert_to_last_saved_state
  Worksheet_save_and_close
Save a snapshot of a worksheet then quit it.
  Worksheet_share
  Worksheet_invite_collab
  PublishWorksheetRevision
  RevertToWorksheetRevision
  Worksheet_revisions
Show a list of revisions of this worksheet.
  Worksheet_input_settings
  Worksheet_settings
  ProcessUserSettings
  ProcessNotebookSettings
  NotebookSettings
  SettingsPage
  Worksheet_set_cell_output_type
Set the output type of the cell.
  Worksheet_new_cell_before
Adds a new cell before a given cell.
  Worksheet_new_cell_after
Adds a new cell after a given cell.
  Worksheet_delete_cell
Deletes a notebook cell.
  Worksheet_cell_update
  Worksheet_eval
Evaluate a worksheet cell.
  Worksheet_publish
This is a child resource of the Worksheet resource.
  Worksheet_rating_info
  Worksheet_rate
  Worksheet_download
  Worksheet_rename
  Worksheet_restart_sage
  Worksheet_quit_sage
  Worksheet_interrupt
  Worksheet_plain
  Worksheet_hide_all
  Worksheet_show_all
  Worksheet_delete_all_output
  Worksheet_print
  NotImplementedWorksheetOp
  Worksheet
  WorksheetsByUser
  EmptyTrash
  SendWorksheetToFolder
  SendWorksheetToTrash
  SendWorksheetToArchive
  SendWorksheetToActive
  SendWorksheetToStop
Saves and quits each selected worksheet.
  PublicWorksheets
  PublicWorksheetsHome
  Worksheets
  WorksheetsByUserAdmin
  WorksheetsAdmin
  NotebookConf
  AddWorksheet
  Help
  History
  LiveHistory
  Main_css
  Reset_css
  CSS
  Main_js
  Keyboard_js_specific
  Keyboard_js
  Javascript
  Java
  Slider
  Logout
  Images
  RegConfirmation
  RegistrationPage
  ForgotPassPage
  InvalidPage
  RedirectLogin
  Toplevel
  LoginResourceClass
  AnonymousToplevel
  FailedToplevel
  UserToplevel
  AdminToplevel
Functions [hide private]
 
word_wrap_cols() source code
 
encode_list(v) source code
 
init_updates() source code
 
notebook_save_check() source code
 
notebook_idle_check() source code
 
notebook_updates() source code
 
message(msg, cont=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a...) source code
 
doc_worksheet() source code
 
redirect(url) source code
 
worksheet_revision_publish(worksheet, rev, username) source code
 
worksheet_revision_revert(worksheet, rev, username) source code
 
render_worksheet_list(args, pub, username) source code
 
is_valid_username(username)
Returns True if and only if \var{username} is valid, i.e., starts with a letter, is between 4 and 32 characters long, and contains only letters, numbers, underscores, and and one dot (.).
source code
 
is_valid_password(password, username)
Return True if and only if \var{password} is valid, i.e., is between 6 and 32 characters long, doesn't contain space(s), and doesn't contain \var{username}.
source code
 
do_passwords_match(pass1, pass2)
EXAMPLES:...
source code
 
is_valid_email(email)
from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65215...
source code
 
set_cookie(cookie) source code
 
user_type(username) source code
 
extract_title(html_page) source code
Variables [hide private]
  notebook = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas...
  OPEN_MODE = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atla...
  SID_COOKIE = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atl...
  HISTORY_MAX_OUTPUT = 460
  HISTORY_NCOLS = 90
  css_path = '/opt/sage/data/extcode/notebook/css'
  image_path = '/opt/sage/data/extcode/notebook/images'
  javascript_path = '/opt/sage/data/extcode/notebook/javascript'
  slider_path = '/opt/sage/data/extcode/notebook/slider'
  java_path = '/opt/sage/local/java'
  waiting = {}
  users = <sage.server.notebook.user_db.UserDatabase instance at...
  _cols = ['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3....
  SEP = '___S_A_G_E___'
  doc_worksheet_number = 0
  DOC = '/opt/sage/doc'
  SAGETEX_PATH = ''
  SRC = '/opt/sage/devel/sage/sage'
  re_valid_username = re.compile(r'[a-z\|A-Z\|0-9\|_\|\.]*')
  LoginResource = <sage.server.notebook.twist.LoginResourceClass...
Function Details [hide private]

is_valid_username(username)

source code 

Returns True if and only if \var{username} is valid, i.e., starts with a letter,
is between 4 and 32 characters long, and contains only letters, numbers,
underscores, and and one dot (.).

EXAMPLES:
    sage: from sage.server.notebook.twist import is_valid_username
    
\var{username} must start with a letter
    sage: is_valid_username('mark10')
    True
    sage: is_valid_username('10mark')
    False
    
\var{username} must be between 4 and 32 characters long
    sage: is_valid_username('bob') 
    False
    sage: is_valid_username('I_love_computer_science_and_maths') #33 characters long
    False
    
\var{username} must not have more than one dot (.)
    sage: is_valid_username('david.andrews')
    True
    sage: is_valid_username('david.m.andrews')
    False
    sage: is_valid_username('math125.TA.5')
    False
    
\var{username} must not have any spaces
    sage: is_valid_username('David Andrews')
    False
    sage: is_valid_username('David M. Andrews')
    False
    
    sage: is_valid_username('sarah_andrews')
    True
    
    sage: is_valid_username('TA-1')
    False
    sage: is_valid_username('math125-TA')
    False
    
    sage: is_valid_username('dandrews@sagemath.org')
    False

is_valid_password(password, username)

source code 

Return True if and only if \var{password} is valid, i.e., is between 6 and
32 characters long, doesn't contain space(s), and doesn't contain \var{username}.

EXAMPLES:
    sage: from sage.server.notebook.twist import is_valid_password
    sage: is_valid_password('uip@un7!', None)
    True
    sage: is_valid_password('markusup89', None)
    True
    sage: is_valid_password('8u7', None)
    False
    sage: is_valid_password('fUmDagaz8LmtonAowjSe0Pvu9C5Gvr6eKcC6wsAT', None)
    False
    sage: is_valid_password('rrcF !u78!', None)
    False
    sage: is_valid_password('markusup89', 'markus')
    False

do_passwords_match(pass1, pass2)

source code 

EXAMPLES:
    sage: from sage.server.notebook.twist import do_passwords_match
    sage: do_passwords_match('momcat', 'mothercat')
    False
    sage: do_passwords_match('mothercat', 'mothercat')
    True

is_valid_email(email)

source code 

from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65215

EXAMPLES:
    sage: from sage.server.notebook.twist import is_valid_email
    sage: is_valid_email('joe@washinton.gov')
    True
    sage: is_valid_email('joe.washington.gov')
    False


Variables Details [hide private]

notebook

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...

OPEN_MODE

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...

SID_COOKIE

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...

users

Value:
UserDatabase()

_cols

Value:
['4ti2-20061025',
 'R-2.6.0',
 'atlas-3.7.37',
 'atlas-3.8.1',
 'atlas-3.8.1.p1',
 'atlas-3.8.1.p3',
 'atlas-3.8.p11',
 'atlas-3.8.p6',
...

LoginResource

Value:
LoginResourceClass()