class documentation

class NotebookInfoList(list): (source)

View In Hierarchy

Method __init__
Method get_by_name Get the NotebookInfo object for a notebook by name
Method get_interwiki Get the NotebookInfo object for a notebook by interwiki key
Method parse Parses the config and cache and populates the list
Method parse_old_format Parses the config and cache and populates the list
Method read Read the config and cache and populate the list
Method set_default Set the default notebook @param uri: the file uri or file path for the default notebook
Method update Update NotebookInfo objects and write cache
Method write Write the config and cache
Instance Variable default Undocumented
Instance Variable file Undocumented
def __init__(self, file): (source)
def get_by_name(self, name): (source)

Get the NotebookInfo object for a notebook by name

Names are checked case sensitive first, then case-insensitive

Parameters
namenotebook name as string
Returns
a NotebookInfo object or None
def get_interwiki(self, key): (source)

Get the NotebookInfo object for a notebook by interwiki key

First checks the interwiki key for all notebooks (case insensitive) than falls back to get_by_name().

Parameters
keynotebook name or interwiki key as string
Returns
a NotebookInfo object or None
def parse(self, text): (source)

Parses the config and cache and populates the list

Format is:

  [NotebookList]
  Default=uri1
  1=uri1
  2=uri2

  [Notebook 1]
  name=Foo
  uri=uri1

Then followed by more "[Notebook]" sections that are cache data

Parameters
texta string or a list of lines
def parse_old_format(self, text): (source)

Parses the config and cache and populates the list

Method for backward compatibility with list format with no section headers and a whitespace separator between notebook name and uri.

Parameters
texta string or a list of lines
def read(self): (source)
Read the config and cache and populate the list
def set_default(self, uri): (source)
Set the default notebook
Parameters
urithe file uri or file path for the default notebook
def update(self): (source)
Update NotebookInfo objects and write cache
def write(self): (source)
Write the config and cache
default = (source)

Undocumented

file = (source)

Undocumented