class documentation

class DownloaderGUI(object): (source)

Constructor: DownloaderGUI(dataserver, use_threads)

View In Hierarchy

Graphical interface for downloading packages from the NLTK data server.

Method __init__ Undocumented
Method about Undocumented
Method destroy Undocumented
Method help Undocumented
Method mainloop Undocumented
Constant 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.
Constant 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.
Constant 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.
Constant DEFAULT_COLUMN_WIDTH The default width for columns that are not explicitly listed in COLUMN_WIDTHS.
Constant HELP Undocumented
Constant INITIAL_COLUMNS The set of columns that should be displayed by default.
Instance Variable top Undocumented
Class _DownloadThread Undocumented
Method _abort_download Undocumented
Method _clear_mark Undocumented
Method _color_table Undocumented
Method _destroy Undocumented
Method _download Undocumented
Method _download_cb Undocumented
Method _download_threaded Undocumented
Method _fill_table Undocumented
Method _info_edit Undocumented
Method _info_save Undocumented
Method _init_menu Undocumented
Method _init_progressbar Undocumented
Method _init_widgets Undocumented
Method _log Undocumented
Method _mark_all Undocumented
Method _monitor_message_queue Undocumented
Method _next_tab Undocumented
Method _package_to_columns Given a package, return a list of values describing that package, one for each column in self.COLUMNS.
Method _prev_tab Undocumented
Method _progress_alive Undocumented
Method _refresh Undocumented
Method _select Undocumented
Method _select_columns Undocumented
Method _select_tab Undocumented
Method _set_download_dir Undocumented
Method _set_url Undocumented
Method _show_info Undocumented
Method _show_log Undocumented
Method _show_progress Undocumented
Method _table_mark Undocumented
Method _table_reprfunc Undocumented
Method _update_table_status Undocumented
Constant _BACK_TAB_COLOR Undocumented
Constant _BACKDROP_COLOR Undocumented
Constant _DL_DELAY Undocumented
Constant _FRONT_TAB_COLOR Undocumented
Constant _MARK_COLOR Undocumented
Constant _MONITOR_QUEUE_DELAY Undocumented
Constant _PROGRESS_COLOR Undocumented
Constant _ROW_COLOR Undocumented
Constant _TAB_FONT Undocumented
Class Variable _gradient_width Undocumented
Class Variable _rows Undocumented
Instance Variable _afterid Undocumented
Instance Variable _column_vars Undocumented
Instance Variable _destroyed Undocumented
Instance Variable _download_abort_queue Undocumented
Instance Variable _download_button Undocumented
Instance Variable _download_lock Undocumented
Instance Variable _download_msg_queue Undocumented
Instance Variable _downloading Undocumented
Instance Variable _ds Undocumented
Instance Variable _info Undocumented
Instance Variable _log_indent Undocumented
Instance Variable _log_messages Undocumented
Instance Variable _progressbar Undocumented
Instance Variable _progresslabel Undocumented
Instance Variable _refresh_button Undocumented
Instance Variable _tab Undocumented
Instance Variable _tab_names Undocumented
Instance Variable _table Undocumented
Instance Variable _tabs Undocumented
Instance Variable _use_threads Undocumented
def __init__(self, dataserver, use_threads=True): (source)

Undocumented

def about(self, *e): (source)

Undocumented

def destroy(self, *e): (source)

Undocumented

def help(self, *e): (source)

Undocumented

def mainloop(self, *args, **kwargs): (source)

Undocumented

COLUMN_WEIGHTS: dict[str, int] = (source)

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: dict[str, int] = (source)

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,
 'Unzipped Size': 10,
 'Status': 12}
COLUMNS: list[str] = (source)

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',
...
DEFAULT_COLUMN_WIDTH: int = (source)

The default width for columns that are not explicitly listed in COLUMN_WIDTHS.

Value
30

Undocumented

Value
textwrap.dedent('''    This tool can be used to download a variety of corpora an
d 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.

...
INITIAL_COLUMNS: list[str] = (source)

The set of columns that should be displayed by default.

Value
['', 'Identifier', 'Name', 'Size', 'Status']

Undocumented

def _abort_download(self): (source)

Undocumented

def _clear_mark(self, id): (source)

Undocumented

def _color_table(self): (source)

Undocumented

def _destroy(self, *e): (source)

Undocumented

def _download(self, *e): (source)

Undocumented

def _download_cb(self, download_iter, ids): (source)

Undocumented

def _download_threaded(self, *e): (source)

Undocumented

def _fill_table(self): (source)

Undocumented

def _info_edit(self, info_key): (source)

Undocumented

def _info_save(self, e=None): (source)

Undocumented

def _init_menu(self): (source)

Undocumented

def _init_progressbar(self): (source)

Undocumented

def _init_widgets(self): (source)

Undocumented

def _log(self, msg): (source)

Undocumented

def _mark_all(self, *e): (source)

Undocumented

def _monitor_message_queue(self): (source)

Undocumented

def _next_tab(self, *e): (source)

Undocumented

def _package_to_columns(self, pkg): (source)

Given a package, return a list of values describing that package, one for each column in self.COLUMNS.

def _prev_tab(self, *e): (source)

Undocumented

def _progress_alive(self): (source)

Undocumented

def _refresh(self): (source)

Undocumented

def _select(self, id): (source)

Undocumented

def _select_columns(self): (source)

Undocumented

def _select_tab(self, event): (source)

Undocumented

def _set_download_dir(self, download_dir): (source)

Undocumented

def _set_url(self, url): (source)

Undocumented

def _show_info(self): (source)

Undocumented

def _show_log(self): (source)

Undocumented

def _show_progress(self, percent): (source)

Undocumented

def _table_mark(self, *e): (source)

Undocumented

def _table_reprfunc(self, row, col, val): (source)

Undocumented

def _update_table_status(self): (source)

Undocumented

_BACK_TAB_COLOR: tuple[str, ...] = (source)

Undocumented

Value
('#aaa', '#67a')
_BACKDROP_COLOR: tuple[str, ...] = (source)

Undocumented

Value
('#000', '#ccc')
_DL_DELAY: int = (source)

Undocumented

Value
10
_FRONT_TAB_COLOR: tuple[str, ...] = (source)

Undocumented

Value
('#fff', '#45c')
_MARK_COLOR: tuple[str, ...] = (source)

Undocumented

Value
('#000', '#ccc')
_MONITOR_QUEUE_DELAY: int = (source)

Undocumented

Value
100
_PROGRESS_COLOR: tuple[str, ...] = (source)

Undocumented

Value
('#f00', '#aaa')
_ROW_COLOR = (source)

Undocumented

Value
{Downloader.INSTALLED: ('#afa', '#080'),
 Downloader.PARTIAL: ('#ffa', '#880'),
 Downloader.STALE: ('#faa', '#800'),
 Downloader.NOT_INSTALLED: ('#fff', '#888')}
_TAB_FONT: str = (source)

Undocumented

Value
'helvetica -16 bold'
_gradient_width: int = (source)

Undocumented

Undocumented

_afterid: dict = (source)

Undocumented

_column_vars: dict = (source)

Undocumented

_destroyed: bool = (source)

Undocumented

_download_abort_queue: list = (source)

Undocumented

_download_button = (source)

Undocumented

_download_lock = (source)

Undocumented

_download_msg_queue: list = (source)

Undocumented

_downloading: bool = (source)

Undocumented

Undocumented

_info: dict = (source)

Undocumented

_log_indent: int = (source)

Undocumented

_log_messages: list = (source)

Undocumented

_progressbar = (source)

Undocumented

_progresslabel = (source)

Undocumented

_refresh_button = (source)

Undocumented

_tab: str = (source)

Undocumented

_tab_names: list[str] = (source)

Undocumented

Undocumented

_tabs: dict = (source)

Undocumented

_use_threads = (source)

Undocumented