Package nltk :: Module downloader :: Class DownloaderGUI
[hide private]
[frames] | no frames]

type DownloaderGUI

source code

object --+
         |
        DownloaderGUI

Graphical interface for downloading packages from the NLTK data server.

Nested Classes [hide private]
_DownloadThread
Instance Methods [hide private]
 
__init__(self, dataserver, use_threads=True) source code
 
_log(self, msg) source code
 
_init_widgets(self) source code
 
_init_menu(self) source code
 
_select_columns(self) source code
 
_refresh(self) source code
 
_info_edit(self, info_key) source code
 
_info_save(self, e=None) source code
 
_table_reprfunc(self, row, col, val) source code
 
_set_url(self, url) source code
 
_set_download_dir(self, download_dir) source code
 
_show_info(self) source code
 
_prev_tab(self, *e) source code
 
_next_tab(self, *e) source code
 
_select_tab(self, event) source code
 
_fill_table(self) source code
 
_update_table_status(self) source code
 
_download(self, *e) source code
 
_download_cb(self, download_iter, ids) source code
 
_select(self, id) source code
 
_color_table(self) source code
 
_clear_mark(self, id) source code
 
_mark_all(self, *e) source code
 
_table_mark(self, *e) source code
 
_show_log(self) source code
 
_package_to_columns(self, pkg)
Given a package, return a list of values describing that package, one for each column in self.COLUMNS.
source code
 
destroy(self, *e) source code
 
_destroy(self, *e) source code
 
mainloop(self, *args, **kwargs) source code
 
help(self, *e) source code
 
about(self, *e) source code
 
_init_progressbar(self) source code
 
_show_progress(self, percent) source code
 
_progress_alive(self) source code
 
_download_threaded(self, *e) source code
 
_abort_download(self) source code
 
_monitor_message_queue(self) source code
Class Variables [hide private]
  COLUMNS = ['', 'Identifier', 'Name', 'Size', 'Status', 'Unzipp...
A list of the names of columns.
  COLUMN_WEIGHTS = {'': 0, 'Name': 5, 'Size': 0, 'Status': 0}
A dictionary specifying how columns should be resized when the table is resized.
  COLUMN_WIDTHS = {'': 1, 'Identifier': 20, 'Name': 45, 'Size': ...
A dictionary specifying how wide each column should be, in characters.
  DEFAULT_COLUMN_WIDTH = 30
The default width for columns that are not explicitly listed in COLUMN_WIDTHS.
  INITIAL_COLUMNS = ['', 'Identifier', 'Name', 'Size', 'Status']
The set of columns that should be displayed by default.
  _BACKDROP_COLOR = ('#000', '#ccc')
  _ROW_COLOR = {'installed': ('#afa', '#080'), 'not installed': ...
  _MARK_COLOR = ('#000', '#ccc')
  _FRONT_TAB_COLOR = ('#fff', '#45c')
  _BACK_TAB_COLOR = ('#aaa', '#67a')
  _PROGRESS_COLOR = ('#f00', '#aaa')
  _TAB_FONT = 'helvetica -16 bold'
  _tab = 'collections'
  _rows = None
  _DL_DELAY = 10
  HELP = 'This tool can be used to download a variety of corpora...
  _gradient_width = 5
  _MONITOR_QUEUE_DELAY = 100
  c = 'Status'
Method Details [hide private]

__init__(self, dataserver, use_threads=True)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

Class Variable Details [hide private]

COLUMNS

A list of the names of columns. This controls the order in which the columns will appear. If this is edited, then _package_to_columns() may need to be edited to match.

Value:
['',
 'Identifier',
 'Name',
 'Size',
 'Status',
 'Unzipped Size',
 'Copyright',
 'Contact',
...

COLUMN_WEIGHTS

A dictionary specifying how columns should be resized when the table is resized. Columns with weight 0 will not be resized at all; and columns with high weight will be resized more. Default weight (for columns not explicitly listed) is 1.

Value:
{'': 0, 'Name': 5, 'Size': 0, 'Status': 0}

COLUMN_WIDTHS

A dictionary specifying how wide each column should be, in characters. The default width (for columns not explicitly listed) is specified by DEFAULT_COLUMN_WIDTH.

Value:
{'': 1,
 'Identifier': 20,
 'Name': 45,
 'Size': 10,
 'Status': 12,
 'Unzipped Size': 10}

_ROW_COLOR

Value:
{'installed': ('#afa', '#080'),
 'not installed': ('#fff', '#888'),
 'out of date': ('#faa', '#800'),
 'partial': ('#ffa', '#880')}

HELP

Value:
'''This tool can be used to download a variety of corpora and models
that can be used with NLTK.  Each corpus or model is distributed
in a single zip file, known as a "package file."  You can
download packages individually, or you can download pre-defined
collections of packages.

When you download a package, it will be saved to the "download
directory."  A default download directory is chosen when you run
...