On this page will be documentation about creating Hakku framework modules.
Here are few commands that can be useful when developing a module.
new module
This command creates a new module from the template.
usage:
reload
This command reloads the currently loaded or specified module.
usage:
check module
Does basic checks to the module (variables and functions).
usage:
redb
Add new modules to the database.
usage:
Don’t use print(), use functions below to print.
List of functions:
These functions have optional arguments start and end for defining line beginning and ending.
Please use the colour pallet from “core/colors”.
from core import colorsprint(colors.blue+"hello world"+colors.end)List of colours:
purple
blue
green
cyan
yellow
red
end
bold (bold text)
uline (underline)customcommands = {
"example": "example command"
}This variable holds a description for the “example” command and lets the framework know this command exists.
Custom command function should always have one argument:
def example(args):To print some messages when the module is loaded, use the message variable.
message = "hello world"If the module needs root privileges, add this variable:
needroot = 1Use prebuild function to modify module variables at runtime (the OrderedDict variables).
from core.setvar import *
setvar('variable', 'value', variables)from core import getpathgetpath module finds absolute paths to various locations.
List of functions:
Example usage:
from core import getpath
print(getpath.db())init function will be executed if it exists when the module is loaded.
Example:
def init():
print('hello world')