Exemplo n.º 1
0
    def _create_plugin_info(self, plugin_name):
        """Create a new :class:`plugins.info.PluginInfo` instance.

        :param str plugin_name:
            Name of the plugin whose plugin info should be created.
        :raise PluginFileNotFoundError:
            Raised if the plugin's main file wasn't found.
        :rtype: PluginInfo
        """
        if not self.plugin_exists(plugin_name):
            raise PluginFileNotFoundError(
                'Plugin "{}" does not exist.'.format(plugin_name))

        info_file = self.get_plugin_directory(plugin_name) / 'info.ini'
        if not info_file.isfile():
            # Just return an "empty" PluginInfo instance. We don't have more
            # information.
            return PluginInfo(plugin_name)

        info = ConfigObj(info_file)
        return PluginInfo(plugin_name, info.pop('verbose_name', None),
                          info.pop('author', None),
                          info.pop('description', None),
                          info.pop('version', None), info.pop('url', None),
                          tuple(info.pop('permissions', dict()).items()),
                          self._get_public_convar_from_info_file(info),
                          self._get_display_in_listing_from_info_file(info),
                          **info.dict())
Exemplo n.º 2
0
import importlib.machinery
import os

from glob import glob

from cvars.public import PublicConVar
from plugins.info import PluginInfo

from . import bans, commands
from .utils import utils


info = PluginInfo()
info.name = "Admin Commands"
info.author = "necavi"
info.version = "0.1"
info.basename = "admin_commands"
info.variable = info.basename + "_version"
info.convar = PublicConVar(info.variable, info.version, info.name + " Version")


cwd = os.getcwd()
os.chdir(os.path.dirname(os.path.abspath(__file__)))
for module in glob("commands/*.py"):
    name = "admin_commands.commands." + os.path.splitext(os.path.basename(module))[0]
    loader = importlib.machinery.SourceFileLoader(name, module)
    loader.load_module(name)
os.chdir(cwd)


def unload():
Exemplo n.º 3
0
from plugins.info import PluginInfo

from translations.strings import LangStrings

from commands.client import ClientCommand

from filters.players import PlayerIter


# ======================================================================
# >> GLOBALS
# ======================================================================

# Plugin info
info = PluginInfo()
info.name = 'Hero-Wars'
info.author = 'Mahi'
info.version = '0.6.1'
info.basename = 'hw'
info.variable = "{0}_version".format(info.basename)

# Public variable for plugin info
info.convar = PublicConVar(
    info.variable,
    info.version,
    0,
    "{0} Version".format(info.name)
)

# Translation messages
Exemplo n.º 4
0
from commands.typed import TypedSayCommand, TypedClientCommand
from cvars.public import PublicConVar
from events import Event
from filters.players import PlayerIter
from mathlib import Vector
from menus.radio import PagedRadioMenu, PagedRadioOption
from messages import SayText2
from players.dictionary import PlayerDictionary
from players.entity import Player
from plugins.info import PluginInfo
from translations.strings import LangStrings

# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo("simple_teleport")
info.basename = "simple_teleport"
info.name = "Simple Teleport"
info.description = "Easily teleport players"
info.author = "Kill, iPlayer"
info.version = "1.0"
info.url = "https://steamcommunity.com/id/killtmwc | " \
           "https://steamcommunity.com/id/its_iPlayer"

PublicConVar(name=info.basename + "_version",
             value=info.version,
             description=info.description)

# =============================================================================
# >> CONSTANTS
# =============================================================================
Exemplo n.º 5
0
from wcgo.effects import level_up
from wcgo.entities import Hero
from wcgo.heroes import *
from wcgo.items import *
from wcgo.menus import menus
from wcgo.player import Player
from wcgo.player import PlayerIter
from wcgo.tools import get_messages
from wcgo.tools import find_element

# ======================================================================
# >> GLOBALS
# ======================================================================

# Plugin info
info = PluginInfo()
info.name = 'Warcraft: GO'
info.author = 'Mahi'
info.version = '0.6.1'
info.basename = 'wcgo'
info.variable = "{0}_version".format(info.basename)

# Public variable for plugin info
info.convar = PublicConVar(info.variable, info.version, 0,
                           "{0} Version".format(info.name))

# Experience Values
exp_values = cfg._retrieve_exp_values(cfg.exp_multiplier)

# Translation messages
exp_messages = get_messages(LangStrings('wcgo/exp'), HintText)
Exemplo n.º 6
0
# This file is part of ArcJail.
#
# ArcJail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ArcJail is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ArcJail.  If not, see <http://www.gnu.org/licenses/>.

from cvars.public import PublicConVar
from plugins.info import PluginInfo


info = PluginInfo()
info.name = "ArcJail"
info.basename = 'arcjail'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '1.0'
info.variable = '{}_version'.format(info.basename)
info.convar = PublicConVar(
    info.variable, info.version, "{} version".format(info.name))

info.url = "http://arcjail.ru/"
Exemplo n.º 7
0
# ../victim_stats/info.py

"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
#   Cvars
from cvars.public import PublicConVar

#   Plugins
from plugins.info import PluginInfo


# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = "Victim Stats"
info.author = "Satoon101"
info.version = "1.0"
info.basename = "victim_stats"
info.variable = info.basename + "_version"
info.url = ""
info.convar = PublicConVar(info.variable, info.version, 0, info.name + " Version")
Exemplo n.º 8
0
Arquivo: WCX.py Projeto: necavi/WCX
from cvars.public import PublicConVar
from plugins.info import PluginInfo

info = PluginInfo()
info.name = "War3 Extended"
info.author = "necavi"
info.version = "0.1"
info.basename = "wcx"
info.variable = info.basename + "_version"
info.convar = PublicConVar(info.variable, info.version, 0, info.name + " Version")
Exemplo n.º 9
0
# ../anti_team_flash/info.py

"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
#   Cvars
from cvars.public import PublicConVar
#   Plugins
from plugins.info import PluginInfo


# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = 'Anti Team Flash'
info.author = 'Satoon101'
info.version = '1.2'
info.basename = 'anti_team_flash'
info.variable = info.basename + '_version'
info.url = 'http://forums.sourcepython.com/showthread.php?895'
info.convar = PublicConVar(info.variable, info.version, info.name + ' Version')
Exemplo n.º 10
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo


info = PluginInfo()
info.name = "KillerInfo"
info.basename = 'killerinfo'
info.author = 'Luka "craziest" Volovec'
info.version = '0.1'
info.variable = 'killerinfo_version'
info.convar = PublicConVar(
    info.variable, info.version, "{} version".format(info.name))

info.url = "https://github.com/craziest/sp-killerinfo"
Exemplo n.º 11
0
# ../most_damage/info.py
"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
#   Cvars
from cvars.public import PublicConVar
#   Plugins
from plugins.info import PluginInfo

# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = 'Most Damage'
info.author = 'Satoon101'
info.version = '1.2'
info.basename = 'most_damage'
info.variable = info.basename + '_version'
info.url = 'http://www.sourcepython.com/showthread.php?85'
info.convar = PublicConVar(info.variable, info.version, info.name + ' Version')
Exemplo n.º 12
0
"""Stores information about the plugin."""

# Source.Python
from cvars.flags import ConVarFlags
from cvars.public import PublicConVar
from plugins.info import PluginInfo

info = PluginInfo()
info.name = "Warcraft-GO"
info.author = "Warcraft-GO-Team"
info.version = ""
info.basename = "wcgo"
info.url = ""
info.convar = PublicConVar(
    info.basename + "_version", info.version,
    ConVarFlags.NONE, info.name + ' Version')
Exemplo n.º 13
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo


info = PluginInfo()
info.name = "iPlayer's Killstreaker"
info.basename = 'ip_killstreaker'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '2.0'
info.variable = 'ipk_version'
info.convar = PublicConVar(
    info.variable, info.version, "{} version".format(info.name))

info.url = "https://github.com/KirillMysnik/sp-killstreaker"
Exemplo n.º 14
0
from engines.server import engine_server

from cvars.public import PublicConVar

from plugins.info import PluginInfo

from translations.strings import LangStrings

from commands.client import ClientCommand

# ======================================================================
# >> GLOBALS
# ======================================================================

# Plugin info
info = PluginInfo()
info.name = 'Hero-Wars'
info.author = 'Mahi, Kamiqawa'
info.version = '0.4.5'
info.basename = 'hw'
info.variable = "{0}_version".format(info.basename)

# Public variable for plugin info
info.convar = PublicConVar(info.variable, info.version, 0,
                           "{0} Version".format(info.name))

# Translation messages
exp_messages = get_messages(LangStrings('hw/exp'))
gold_messages = get_messages(LangStrings('hw/gold'))
other_messages = get_messages(LangStrings('hw/other'))
Exemplo n.º 15
0
import importlib.machinery
import os

from glob import glob

from cvars.public import PublicConVar
from plugins.info import PluginInfo

from . import bans, commands
from .utils import utils

info = PluginInfo()
info.name = "Admin Commands"
info.author = "necavi"
info.version = "0.1"
info.basename = "admin_commands"
info.variable = info.basename + "_version"
info.convar = PublicConVar(info.variable, info.version, info.name + " Version")

cwd = os.getcwd()
os.chdir(os.path.dirname(os.path.abspath(__file__)))
for module in glob("commands/*.py"):
    name = "admin_commands.commands." + os.path.splitext(
        os.path.basename(module))[0]
    loader = importlib.machinery.SourceFileLoader(name, module)
    loader.load_module(name)
os.chdir(cwd)


def unload():
    utils.unload()
Exemplo n.º 16
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo


info = PluginInfo()
info.name = "CS:GO Rainbow Six Mod"
info.basename = 'csgors'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '0.1'
info.variable = '{}_version'.format(info.basename)
info.convar = PublicConVar(
    info.variable, info.version, "{} version".format(info.name))

info.url = "https://github.com/KirillMysnik/CSGO-RS"
Exemplo n.º 17
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo


info = PluginInfo()
info.name = "Map Cycle"
info.basename = 'map_cycle'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '2.0'
info.variable = 'mc_version'
info.convar = PublicConVar(
    info.variable, info.version, "{} version".format(info.name))

info.url = "https://github.com/KirillMysnik/sp-map-cycle"
Exemplo n.º 18
0
Arquivo: WCX.py Projeto: Necavi/WCX
from cvars.public import PublicConVar
from plugins.info import PluginInfo

info = PluginInfo()
info.name = "War3 Extended"
info.author = "necavi"
info.version = "0.1"
info.basename = "wcx"
info.variable = info.basename + "_version"
info.convar = PublicConVar(info.variable, info.version, 0,
                           info.name + " Version")
Exemplo n.º 19
0
# ../most_damage/info.py

"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
#   Cvars
from cvars.public import PublicConVar
#   Plugins
from plugins.info import PluginInfo


# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = 'Most Damage'
info.author = 'Satoon101'
info.version = '1.2'
info.basename = 'most_damage'
info.variable = info.basename + '_version'
info.url = 'http://www.sourcepython.com/showthread.php?85'
info.convar = PublicConVar(info.variable, info.version, info.name + ' Version')
Exemplo n.º 20
0
from wcgo.entities import Hero
from wcgo.heroes import *
from wcgo.items import *
from wcgo.menus import menus
from wcgo.player import Player
from wcgo.player import PlayerIter
from wcgo.tools import get_messages
from wcgo.tools import find_element


# ======================================================================
# >> GLOBALS
# ======================================================================

# Plugin info
info = PluginInfo()
info.name = 'Warcraft: GO'
info.author = 'Mahi'
info.version = '0.6.1'
info.basename = 'wcgo'
info.variable = "{0}_version".format(info.basename)

# Public variable for plugin info
info.convar = PublicConVar(
    info.variable,
    info.version,
    0,
    "{0} Version".format(info.name)
)

# Experience Values
Exemplo n.º 21
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo

info = PluginInfo()
info.name = "Zombie Waves"
info.basename = 'zombie_waves'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '1.1'
info.variable = '{}_version'.format(info.basename)
info.convar = PublicConVar(info.variable, info.version,
                           "{} version".format(info.name))

info.url = "https://github.com/KirillMysnik/SP-HL2DM-ZombieWaves"
Exemplo n.º 22
0
# ../cut_wire/info.py

"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
#   Cvars
from cvars.public import PublicConVar
#   Plugins
from plugins.info import PluginInfo


# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = 'Cut Wire'
info.author = 'Satoon101'
info.version = '1.1'
info.basename = 'cut_wire'
info.variable = info.basename + '_version'
info.url = 'http://forums.sourcepython.com/showthread.php?779'
info.convar = PublicConVar(
    info.variable, info.version, 0, info.name + ' Version')
Exemplo n.º 23
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo

info = PluginInfo()
info.name = "Simple DeathMatch"
info.basename = 'simple_deathmatch'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '0.1'
info.variable = 'sdm_version'
info.convar = PublicConVar(info.variable, info.version,
                           "{} version".format(info.name))
Exemplo n.º 24
0
from commands.client import ClientCommand, ClientCommandFilter
from commands.server import ServerCommand
from commands import CommandReturn

from colors import Color

from listeners.tick import Delay

from filters.recipients import RecipientFilter
 
from core import AutoUnload
 
base_path = Path(__file__).parent
MODNAME = base_path.namebase
 
info = PluginInfo()
info.author = "Yiggles Moto"
info.basename = MODNAME
info.description = "Testing Area"
info.name = "Playground - Work Area"
info.version = "0.1.2 Alpha"
info.url = ""
 
GOD_MODE = "god"
CHAT_COMMAND = "cut"
CLIENT_COMMAND = "kill"
HEALTH_COMMAND = "sethealth"
MENU_COMMAND = "menu"
RESPAWN_COMMAND = "respawn"

EXTRA_HP = 100
Exemplo n.º 25
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo


info = PluginInfo()
info.name = "LimitZones (Editor)"
info.basename = 'limit_zones_editor'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '1.0'
info.variable = '{}_version'.format(info.basename)
info.convar = PublicConVar(
    info.variable, info.version, "{} version".format(info.name))

info.url = "https://github.com/KirillMysnik/SP-LimitZones"
Exemplo n.º 26
0
# ../sweet_and_sour_chicken/info.py
"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python
from cvars.public import PublicConVar
from plugins.info import PluginInfo

# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = 'Sweet And Sour Chicken'
info.author = 'satoon101'
info.version = '1.0'
info.basename = 'sweet_and_sour_chicken'
info.variable = info.basename + '_version'
info.url = ''
info.convar = PublicConVar(info.variable, info.version, info.name + ' Version')
Exemplo n.º 27
0
# ../cut_wire/info.py
"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
#   Cvars
from cvars.public import PublicConVar
#   Plugins
from plugins.info import PluginInfo

# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = 'Cut Wire'
info.author = 'Satoon101'
info.version = '1.1'
info.basename = 'cut_wire'
info.variable = info.basename + '_version'
info.url = 'http://forums.sourcepython.com/showthread.php?779'
info.convar = PublicConVar(info.variable, info.version, 0,
                           info.name + ' Version')
Exemplo n.º 28
0
from commands.say import SayCommand
from core import console_message
from core.version import VERSION
from plugins.info import PluginInfo

from motdplayer import Page

info = PluginInfo(__name__)


def log_console(message):
    console_message("[{}] {}".format(info.verbose_name, message))


class Example1Page(Page):
    plugin_id = "motd_example1"
    page_id = "example1_page"

    def on_data_received(self, data):
        if data['action'] == "get-sp-version":
            self.send_data({'version': VERSION})

        else:
            log_console("Error! Unexpected action: {}".format(data['action']))


@SayCommand('!example1_page')
def say_test_st_page(command, index, team_only):
    Example1Page.send(index)
Exemplo n.º 29
0
# ../dissolver/info.py

"""Provides/stores information about the plugin."""

# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Python Imports
#   Cvars
from cvars.public import PublicConVar
#   Plugins
from plugins.info import PluginInfo


# =============================================================================
# >> PLUGIN INFO
# =============================================================================
info = PluginInfo()
info.name = 'Dissolver'
info.author = 'Satoon101'
info.version = '1.1'
info.basename = 'dissolver'
info.variable = info.basename + '_version'
info.url = ''
info.convar = PublicConVar(info.variable, info.version, info.name + ' Version')
Exemplo n.º 30
0
from cvars.public import PublicConVar
from plugins.info import PluginInfo


info = PluginInfo()
info.name = "TripMines"
info.basename = 'tripmines'
info.author = 'Kirill "iPlayer" Mysnik'
info.version = '0.2'
info.variable = 'tm_version'
info.convar = PublicConVar(
    info.variable, info.version, "{} version".format(info.name))

info.url = "https://github.com/KirillMysnik/sp-tripmines"