Implementing a basic plugin architecture shouldn't be a complicated task. The solution described here is working but you still have to import every plugin (inheriting from the base class).
This is my solution:
$ tree
-------------------- DMS Header -------------------- | |
magic - always "PortalSequenceData" | |
int_u32 - size of uncompressed data | |
raw - Compressed data (zlib) | |
-------------------- DMP Header -------------------- | |
magic - always "PortalPartData" | |
int_u32 - size of uncompressed data |
class mc_song: | |
def __init__(self): | |
self.general = None | |
self.section = None | |
self.track = None | |
self.instrument = None | |
self.drum_kit = None | |
self.sound_font = None | |
self.section_order = None |
import ctypes | |
openmpt_log_func = ctypes.CFUNCTYPE( | |
None, ctypes.c_void_p, ctypes.c_int, ctypes.c_char_p | |
) | |
openmpt_error_func = ctypes.CFUNCTYPE( | |
None, ctypes.c_void_p, ctypes.c_int, ctypes.c_char_p | |
) |
class slotted_dict: | |
__slots__ = ['names', 'data'] | |
def __init__(self, names): | |
self.names = names | |
self.data = [0]+[None for _ in names] | |
def __setitem__(self, k, v): | |
if k in self.names: | |
i = self.names.index(k) |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
HISTSIZE=0 | |
HISTFILESIZE=0 | |
# colored GCC warnings and errors | |
export GCC_COLORS='error=01;31:warning=01;33:note=01;32:caret=01;34:locus=01:quote=01' | |
# enable programmable completion features (you don't need to enable | |
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile | |
# sources /etc/bash.bashrc). |
Implementing a basic plugin architecture shouldn't be a complicated task. The solution described here is working but you still have to import every plugin (inheriting from the base class).
This is my solution:
$ tree