view plugins/server/base_plugin.py @ 189:7c1a8b36b729 beta

Traipse Beta 'OpenRPG' {100125-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Beta) New Features: Added Bookmarks Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager New TrueDebug Class in orpg_log (See documentation for usage) Portable Mercurial Tip of the Day added, from Core and community New Reference Syntax added for custom PC sheets New Child Reference for gametree New Parent Reference for gametree New Gametree Recursion method, mapping, context sensitivity, and effeciency.. New Features node with bonus nodes and Node Referencing help added Dieroller structure from Core New DieRoller portability for odd Dice Added 7th Sea die roller; ie [7k3] = [7d10.takeHighest(3).open(10)] New 'Mythos' System die roller added Added new vs. die roller method for WoD; ie [3v3] = [3d10.vs(3)]. Included for Mythos roller also New Warhammer FRPG Die Roller (Special thanks to Puu-san for the support) New EZ_Tree Reference system. Push a button, Traipse the tree, get a reference (Beta!) Fixes: Fix to Text based Server Fix to Remote Admin Commands Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Fix to Map from gametree not showing to all clients Fix to gametree about menus Fix to Password Manager check on startup Fix to PC Sheets from tool nodes. They now use the tabber_panel Fix to Whiteboard ID to prevent random line or text deleting. Fixes to Server, Remote Server, and Server GUI Fix to Update Manager; cleaner clode for saved repositories Fixes made to Settings Panel and now reactive settings when Ok is pressed Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of a Splice Fix to Use panel of Forms and Tabbers. Now longer enters design mode Fix made Image Fetching. New fetching image and new failed image Modified ID's to prevent non updated clients from ruining the fix. default_manifest.xml renamed to default_upmana.xml
author sirebral
date Mon, 25 Jan 2010 10:03:16 -0600
parents 4385a7d0efd1
children
line wrap: on
line source

import sys
import os

class BasePluginClass(object):
    def __init__(self):
        self.__name = ""
        self.__author = ""
        self.__help = ""
        self.__file = __file__
        self.__activated = False
        self.__inputpriority = -1 # -1 = not used; 99 = priority doesn't matter
                                  # Any other number is priority, lowest number
                                  # executes first
        self.__outputpriority = -1# -1 = not used; 99 = priority doesn't matter
                                  # Any other number is priority, lowest number
                                  # executes first
        self.__pollpriority = -1  # -1 = not used; 99 = priority doesn't matter
                                  # Any other number is priority, lowest number
                                  # executes first


    def preParseIncoming(self, xml_dom, data):
        return xml_dom, data

    def postParseIncoming(self, data):
        return data

    def getPlayer(self):
        return None

    def setPlayer(self, playerData):
        return

    def preParseOutgoing(self):
        return []


    def _getName(self):
        return self.__name

    def _setName(self, val):
        if isinstance(val, basestring):
            self.__name = val
        else:
            self.__name = str(val)


    def _getAuthor(self):
        return self.__author

    def _setAuthor(self, val):
        if isinstance(val, basestring):
            self.__author = val
        else:
            self.__author = str(val)


    def _getHelp(self):
        return self.__help

    def _setHelp(self, val):
        if isinstance(val, basestring):
            self.__help = val
        else:
            self.__help = str(val)


    def _getFile(self):
        return self.__file

    def _setFile(self, val):
        if isinstance(val, basestring):
            self.__file = val
        else:
            self.__file = str(val)


    def _getActivated(self):
        return self.__activated

    def _setActivated(self, val):
        if isinstance(val, bool):
            self.__activated = val
        elif isinstance(val, int):
            if val <= 0:
                self.__activated = False
            else:
                self.__activated = True
        else:
            self.__activated = False


    def _getInputPriority(self):
        return self.__activated

    def _setInputPriority(self, val):
        if isinstance(val, int) and val in xrange(-1, 100):
            self.__inputpriority = val
        else:
            self.__inputpriority = -1


    def _getOutputPriority(self):
        return self.__activated

    def _setOutputPriority(self, val):
        if isinstance(val, int) and val in xrange(-1, 100):
            self.__outputpriority = val
        else:
            self.__outputpriority = -1


    def _getPollPriority(self):
        return self.__pollpriority

    def _setPollPriority(self, val):
        if isinstance(val, int) and val in xrange(-1, 100):
            self.__pollpriority = val
        else:
            self.__pollpriority = -1

    Name = property(_getName, _setName)
    Author = property(_getAuthor, _setAuthor)
    Help = property(_getHelp, _setHelp)
    File = property(_getFile, _setFile)
    Activated = property(_getActivated, _setActivated)
    InputPriority = property(_getInputPriority, _setInputPriority)
    OutputPriority = property(_getOutputPriority, _setOutputPriority)
    PollPriority = property(_getPollPriority, _setPollPriority)