Exemple #1
0
    def __init__(self, application, name):
        BasePlugin.__init__(self, application, name)

        # Argumentparser
        self.setup_conf()
        self.setup_argparser()
        return None
Exemple #2
0
 def __init__(self):
     BasePlugin.__init__(self)
     discord.Client.__init__(self)
     self.token = None
     self.channel = None
     self.staff_channel = None
     self.token = None
     self.client_id = None
     self.mock_connection = None
     self.prefix = None
     self.command_prefix = None
     self.dispatcher = None
     self.color_strip = re.compile("\^(.*?);")
     self.command_target = None
     self.sc = None
     self.irc_bot_exists = False
     self.irc = None
     self.chat_manager = None
     self.rank_roles = None
     self.discord_logger = None
     self.allowed_commands = ('who', 'help', 'uptime', 'motd', 'show_spawn',
                              'ban', 'unban', 'kick', 'list_bans', 'mute',
                              'unmute', 'set_motd', 'whois', 'broadcast',
                              'user', 'del_player', 'maintenance_mode',
                              'shutdown', 'save')
Exemple #3
0
    def __init__(self, application, name):
        # We need to init the BasePlugin. It will create the references
        # described above.
        BasePlugin.__init__(self, application, name)

        # Configuration

        # This is the number of rows that we want to allow to print at once.
        self.max_rows = self.conf.getint("max_rows", 5)
        self.conf["max_rows"] = str(self.max_rows)
        
        # Here, we store the used lyrics.
        self.lyrics_file = os.path.join(self.data_dir, "lyrics.txt")

        # If the lyrics file does not exist, we'll init it with the default
        # lyrics.
        if not os.path.exists(self.lyrics_file):
            with open(self.lyrics_file, "w") as file:
                file.write(_DEFAULT_LYRICS)

        # Now, we set our argparser up.
        self.argparser.description = (
            "Demonstrates the implementation of a plugin. Inspired by the "
            "wordpress plugin \"Hello, Dolly\"."
            )
        self.argparser.epilog = "https://emsm.benediktschmitt.de/"
        self.argparser.add_argument(
            "--rows", "-r",
            action="store", dest="rows", type=int,
            default=1, metavar="ROWS",
            help="The number of lines that will be printed. "
            )
        return None
 def __init__(self):
     BasePlugin.__init__(self)
     discord.Client.__init__(self)
     self.token = None
     self.channel = None
     self.staff_channel = None
     self.token = None
     self.client_id = None
     self.mock_connection = None
     self.prefix = None
     self.command_prefix = None
     self.dispatcher = None
     self.color_strip = re.compile("\^(.*?);")
     self.command_target = None
     self.sc = None
     self.irc_bot_exists = False
     self.irc = None
     self.chat_manager = None
     self.rank_roles = None
     self.discord_logger = None
     self.allowed_commands = ('who', 'help', 'uptime', 'motd', 'show_spawn',
                              'ban', 'unban', 'kick', 'list_bans', 'mute',
                              'unmute', 'set_motd', 'whois', 'broadcast',
                              'user', 'del_player', 'maintenance_mode',
                              'shutdown', 'save')
Exemple #5
0
 def __init__(self, project_base_dir=None):
     self.name               = "docker_jenkins"
     self.project_dir_name   = "docker_jenkins"
     self.git_repo           = "https://github.com/sabhiram/docker-jenkins"
     
     # Super Init...
     BasePlugin.__init__(self, project_base_dir)
Exemple #6
0
    def __init__(self, app, name):
        BasePlugin.__init__(self, app, name)

        self.initd_start = self.app.events.get_event("initd_start")
        self.initd_stop = self.app.events.get_event("initd_stop")

        self.start_occured = False
        self.stop_occured = False

        self.setup_conf()
        self.setup_argparser()
        return None
Exemple #7
0
    def __init__(self, app, name):
        BasePlugin.__init__(self, app, name)

        # Argparser
        self.argparser.description = (
            "This plugin provides methods to install or remove plugins from "
            "this application.")
        
        self.argparser.add_argument(
            "-i", "--install",
            action = "store",
            dest = "install",
            metavar = "ARCHIVE",
            help = "Installs the plugin from the archive."
            )
        self.argparser.add_argument(
            "-r", "--remove",
            action = "store",
            dest = "remove",
            metavar = "PLUGIN",
            choices = self.app.plugins.get_plugin_names(),            
            help = "Removes the plugin from the EMSM."
            )

##        self.argparser.add_argument(
##            "-u", "--update",
##            action = "append",
##            dest = "update",
##            metavar = "PLUGIN",
##            choices = self.app.plugins.get_plugin_names(),
##            help = "Tries to update the plugin, if a new version is available."
##            )
##        self.argparser.add_argument(
##            "-U", "--update-all",
##            action = "count",
##            dest = "update_all",
##            help = "Updates all plugins."
##            )
        
        self.argparser.add_argument(
            "-d", "--doc",
            action = "store",
            dest = "print_doc",
            metavar = "PLUGIN",
            choices = self.app.plugins.get_plugin_names(),
            help = "Prints the docstring of the plugin."
            )
        return None
Exemple #8
0
    def __init__(self, app, name):
        BasePlugin.__init__(self, app, name)

        # Configuration
        # Whats to do if a world is offline.
        self.error_action = self.conf.get("error_action")
        if self.error_action not in ("none", "restart", "stop", "stderr"):
            self.error_action = "none"

        self.error_regex = self.conf.get("error_regex", "(\[SEVERE\])")
        self.auto_run = self.conf.getboolean("auto_run", False)
        self.guard_all_worlds = self.conf.getboolean("guard_all_worlds", False)
               
        self.conf["error_action"] = self.error_action
        self.conf["error_regex"] = self.error_regex
        self.conf["auto_run"] = "yes" if self.auto_run else "no"
        self.conf["guard_all_worlds"] = "yes" if self.guard_all_worlds else "no"

        # Argparser
        self.argparser.description = (
            "Watches the logfiles and checks if the worlds are running smooth.")
        return None
Exemple #9
0
 def __init__(self, config):
     BasePlugin.__init__(self, config)
 def __init(self, app):
     BasePlugin.__init__(self, app)
Exemple #11
0
 def __init__(self, *args, **kwargs):
     BasePlugin.__init__(self, *args, **kwargs)