Templated function-files for Gladex to manipulate

Registered by Charles Edward Pax

Gladex should use templates for functions in the same way it does for the main program file and the callback functions file.

The getText() function will be implemented in gladex_functions.py

Gladex should provide a getText(<template file name>, variable1, variable2, ...) function which returns the text of a template file. The variables in this template file will be replaced with the corresponding value stated in the variable array.

For example, a pluging author might write code to generate functions code as follows:
# Generate functions text
getFunctionsText():
    functions_text = ""
    handlers = getHandlers()
    for each h in handlers:
        replacementArray = [[FUNCTION_NAME, h],[CONTENTS, ""Function not implemented""]]
        functions_text = functions_text + getText(function.template, replacementArray) + '\n'
    return functions_text

This eliminates the need for the author to hard code the function generation into their plugin. By making the getText() function generic it can be used for templating anything the author chooses.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Not started
Milestone target:
None
Completed by
Charles Edward Pax

Related branches

Sprints

Whiteboard

This is up to the plugin writer. This is a suggested feature for a plugin to have.
2007-08018: pax: I agree. Marked as Obsolete.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.