Page 1 of 1

Command decorators

Posted: Fri Dec 04, 2015 2:57 pm
by MrMalina
Hello. I have tried to use two decorators to declare "say" and "client" commands:

Syntax: Select all

from commands import CommandReturn
from commands.say import SayCommand
from commands.client import ClientCommand
from commands.server import ServerCommand

@ClientCommand("pony")
@SayCommand("pony")
def pony(command, index, team_only=False):
print(command.get_arg(0))

return CommandReturn.BLOCK



It's work perfect, but when i try to restart plug-in with "sp reload <plugin_name>" I got next error:
The attachment Скриншот 2015-12-04 17.43.31.jpg is no longer available


Click

Posted: Fri Dec 04, 2015 3:08 pm
by Ayuto
Thanks for reporting! I have fixed the issue. https://github.com/Source-Python-Dev-Team/Source.Python/commit/df3055b9991313c2d946e45399d1897624c1bf09

The new version is already downloadable.