core Package

core Package

The core package includes the modules implementing the MVC system.

application Module

command Module

Command Pattern

class vinstall.core.command.Command(func, args=None, description=None)[source]

Bases: object

class vinstall.core.command.CommandExecutor(delegate=None)[source]

Bases: threading.Thread

Execute commands in another thread. Call hooks before and after executing commands, and before and after processing the queue

add_command(func, args=None, description=None)[source]

Create a Command instance and add it to the stack.

command_execution_ended(command)[source]

Command ended hook

command_execution_started(command)[source]

Command started hook

ended()[source]

Execution ended

execute_all(commands)[source]
run()[source]
started()[source]

Execution started

class vinstall.core.command.CommandExecutorTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

testAddCommand()[source]

Create a Command instance and add it to the stack.

testDelegate()[source]
class vinstall.core.command.CommandTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

testCommand()[source]
class vinstall.core.command.Executor(q=None)[source]

Bases: threading.Thread

run()[source]
submit(item)[source]

controller Module

Provides a base class for controllers.

class vinstall.core.controller.Controller[source]

Bases: object

Base class for defining the controller interface, there is no real need for subclassing this.

next()[source]

Return the class implementing the next stage.

previous()[source]

Return the class implementing the previous stage.

process(*args)[source]

Callback executed with the form values as arguments.

render()[source]

This method returns a Render object.

core Module

Utilities for declaring classes as views of certain model.

exception vinstall.core.core.RegistryError[source]

Bases: exceptions.Exception

Exception raised for registry errors.

class vinstall.core.core.ViewRegistry[source]

Bases: object

A registry mapping views and models

get_main_window()[source]

Returns the main window for a given view

get_view(model)[source]

Answer with a view registered for the given model

main_window(cls)[source]

Class decorator for registering a main window

renders(model)[source]

Returns a class decorator that can be used for registering a view against certain model.

log Module

A logging facility for Vinstall.

vinstall.core.log.get_logger(name, level=10, filename='installer.log')[source]

Get a logger, used just to avoid duplication of these line. Call it with __main__ as argument.

model Module

Classes representing option types.

class vinstall.core.model.BoolOption(name, short_desc=None, help_text=None)[source]

Bases: object

User is expected to provide a boolean value.

class vinstall.core.model.DropdownOptionList(label=None, *options)[source]

Bases: object

User is expected to select one option from a list.

add_option(option=None, tooltip=None, help=None)[source]
append(option)[source]

Append an option to the list.

class vinstall.core.model.ExclusiveOptionList(*options)[source]

Bases: object

User is expected to select one option from a list.

add_option(name=None, tooltip=None, help=None)[source]

Add an option to the options list

append(option)[source]

Append an option to the list.

class vinstall.core.model.IPAddress(name, short_desc=None, help_text=None)[source]

Bases: object

Internet Protocol model.

class vinstall.core.model.NumericOption(name, minvalue=0, maxvalue=0, short_desc=None, help_text=None)[source]

Bases: object

User is expected to provide a numeric value.

class vinstall.core.model.PasswordOption(name, maxlen=0, short_desc=None, help_text=None)[source]

Bases: vinstall.core.model.TextOption

A TextOption for passwords

class vinstall.core.model.SimpleText(text, short_desc=None, help_text=None)[source]

Bases: object

informative text label.

process = False
class vinstall.core.model.TextOption(name, maxlen=0, short_desc=None, help_text=None)[source]

Bases: object

User is expected to provide data in form of text.

observer Module

render Module

The render module provides a Render class, which responsibility is to allow access to the view objects at runtime.

class vinstall.core.render.Render(title, intro, *options)[source]

Bases: object

Given a set of model objects, find the proper view and setup window properties.

get_renderer(model)[source]

Given a model, return its view.

get_user_input()[source]

Get the widgets state. Used by controller instances for getting user input. The _process attribute in renderers are set by the core module, and they indicate if the widget provides a value entered by the user or not (for example, simple text labels do not provide any value, and they are not processed by the controller.process method)

get_widgets()[source]

Get the list of configured widgets.

main_window

Lazy initialization of the main window object.

main_window_instance = None
setup_widgets()[source]

Initialize the widgets for each model.

update_main_window()[source]

Update the attributes of the main window instance and refresh the view.

view Module