EditorWindow Module

This module contains the editor window.

class kniteditor.EditorWindow.EditorWindow(**kwargs)[source]

Bases: kivy.app.App

The editor window.

build()[source]

Build the application.

build_config(config)[source]

Build the configuration.

Parameters:config (kivy.config.ConfigParser) – the configuration parser
build_settings(settings)[source]

Create the applications settings dialog.

Parameters:settings (kivy.uix.settings.Settings) – the settings for this app
config_change_in_section_language_key_current(new_language)[source]

Set the new language of the application.

Same as kniteditor.localization.change_language_to()

get_application_config()[source]

Return the application’s configuration directory.

Returns:the path to the configuration file
Return type:str
on_config_change(config, section, key, value)[source]

The configuration was changed.

Parameters:
  • config (kivy.config.ConfigParser) – the configuration that was changed
  • section (str) – the section that was changed
  • key (str) – the key in the section that was changed
  • value – the value this key was changed to

When this method is called, it issued calls to change methods if they exist in this order:

  • config_change_in_section_{section}_key_{key}(value)
  • config_change_in_section_{section}(key, value)
on_start()[source]

The application is started.

on_stop()[source]

The application terminates.

settings_specification

The settings specification as JSON string.

Return type:str
Returns:a JSON string
show_example()[source]

Show an example knitting pattern.

update_language_from_config()[source]

Set the current language of the application from the configuration.

class kniteditor.EditorWindow.Root(**kwargs)[source]

Bases: kivy.uix.pagelayout.PageLayout

This is the root of the application.

dismiss_popup()[source]

Close the popup window.

load_path(path, filenames)[source]

Load knitting patterns from several files.

save_path(path, filename)[source]

Save a knitting pattern to a path.

show_open_file_dialog()[source]

Open the file dialog for loading.

show_save_file_dialog()[source]

Open the file dialog for saving.

kniteditor.EditorWindow.LANGUAGE_CODE = 'current'

the language code name

kniteditor.EditorWindow.LANGUAGE_SECTION = 'language'

the language section name