Commit Graph

17 Commits

Author SHA1 Message Date
Falk Rund
f9fd05c307 Welcome to 2023 2023-01-01 06:49:00 +01:00
Alexey Sokolov
9c855b5c01 Test module translation of commands 2022-07-05 00:24:38 +01:00
Alexey Sokolov
e0c05ddb63 Rename cmd/desc to command/description
Ref #1832
2022-07-04 23:16:22 +01:00
Ernestas Kulik
94f1c32729 modules: modpython: Implement Module.AddCommand()
Currently, there is no usable wrapper for CModCommand for use within
bindings, so this commit adds a proxy class that adds itself as a
callback and allows implementing Python classes to implement commands
via __call__().

A completely synthetic example:

import znc

class foo(znc.Module):
    module_types = [znc.CModInfo.UserModule]

    def OnLoad(self, args, message):
        self.AddHelpCommand()
        self.AddCommand(FooCmd)

        return True

class FooCmd(znc.Command):
    cmd = 'foo'
    args = foo.t_d('bar')
    desc = foo.t_d('baz')

    def __call__(self, line):
        self.GetModule().PutModule('I have been foo’d!')

Fixes https://github.com/znc/znc/issues/198
2022-07-04 07:28:24 +03:00
Falk Rund
6402d241ac Welcome to 2022
The same procedure as last year, Miss Sophie?
Same procedure as every year, James.
2022-01-01 14:05:32 +01:00
MAGIC
99687b0f24 Welcome to 2021 2021-01-01 19:37:07 +01:00
Alexey Sokolov
47e633b267 Don't load modperl as a python module
Close #1757
2020-09-17 23:08:19 +01:00
Alexey Sokolov
b3b38956a7 Rewrite how modpython loads modules
'imp' was deprecated since python 3.3.
This removes the undocumented feature of loading python C extension as
ZNC module, but adds a test that python package can be loaded.

Bump python requirements to 3.4
2020-05-23 13:32:50 +01:00
Alexey Sokolov
f3d7922499 Update copyright in files which were missing in the previous update 2020-01-05 11:37:51 +00:00
Alexey Sokolov
8d309bbb3d Merge branch '1.7.x' 2019-03-30 16:17:59 +00:00
Alexey Sokolov
64613bc8b6 Don't crash if user specified invalid encoding.
This is CVE-2019-9917
2019-03-22 00:22:00 +00:00
Pierre Gordon
6af027c5dd Normalize methods with 'UserName' to 'Username' 2019-01-01 16:19:27 -05:00
Alexey Sokolov
4b92790562 Fix #1543 for modperl too
While at it, fix a memory leak in NV handling

Add some tests
2018-06-04 22:03:10 +01:00
Alexey Sokolov
c6a04023a4 Reformat test 2018-04-04 01:21:09 +01:00
Alexey Sokolov
d8327977ca Add socket test to modperl 2018-03-27 22:49:23 +01:00
Alexey Sokolov
6eaa93f8da Fix python sockets after latest changes.
The issue was triggered by CCoreTranslationMixin being parent of
CZNCSock, and DisableReadLine wasn't found as attribute anymore.

Thanks to obiw4n for report.
2018-03-27 22:26:05 +01:00
Alexey Sokolov
70dabc07dc Split integration test file to several files. 2018-02-13 21:25:17 +00:00