id
int64
0
458k
file_name
stringlengths
4
119
file_path
stringlengths
14
227
content
stringlengths
24
9.96M
size
int64
24
9.96M
language
stringclasses
1 value
extension
stringclasses
14 values
total_lines
int64
1
219k
avg_line_length
float64
2.52
4.63M
max_line_length
int64
5
9.91M
alphanum_fraction
float64
0
1
repo_name
stringlengths
7
101
repo_stars
int64
100
139k
repo_forks
int64
0
26.4k
repo_open_issues
int64
0
2.27k
repo_license
stringclasses
12 values
repo_extraction_date
stringclasses
433 values
16,100
plugin_info_test.py
errbotio_errbot/tests/plugin_info_test.py
import sys from io import StringIO from pathlib import Path import pytest from errbot.plugin_info import PluginInfo plugfile_base = Path(__file__).absolute().parent / "config_plugin" plugfile_path = plugfile_base / "config.plug" def test_load_from_plugfile_path(): pi = PluginInfo.load(plugfile_path) assert...
1,547
Python
.py
62
19.967742
67
0.598639
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,101
utils_test.py
errbotio_errbot/tests/utils_test.py
# coding=utf-8 import logging import sys from datetime import timedelta import pytest from errbot.backend_plugin_manager import BackendPluginManager from errbot.backends.test import ShallowConfig from errbot.bootstrap import CORE_STORAGE, bot_config_defaults from errbot.storage import StoreMixin from errbot.storage....
3,029
Python
.py
82
32.02439
97
0.666324
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,102
commands_test.py
errbotio_errbot/tests/commands_test.py
# coding=utf-8 import logging import os import re import tarfile from os import mkdir, path from queue import Empty from shutil import rmtree from tempfile import mkdtemp from unittest.mock import MagicMock import pytest extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "dummy_plugin") def test_ro...
14,579
Python
.py
298
42.949664
108
0.702383
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,103
syntax_test.py
errbotio_errbot/tests/syntax_test.py
from os import path extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "syntax_plugin") def test_nosyntax(testbot): assert testbot.bot.commands["foo_nosyntax"]._err_command_syntax is None def test_syntax(testbot): assert testbot.bot.commands["foo"]._err_command_syntax == "[optional] <manda...
590
Python
.py
13
40.923077
86
0.698944
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,104
plugin_config_fail_test.py
errbotio_errbot/tests/plugin_config_fail_test.py
from os import path extra_plugin_dir = path.join( path.dirname(path.realpath(__file__)), "fail_config_plugin" ) def test_failed_config(testbot): assert ( "Incorrect plugin configuration: Message explaining why it failed." in testbot.exec_command("!plugin config Failp {}") )
306
Python
.py
9
29.555556
75
0.70068
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,105
md_rendering_test.py
errbotio_errbot/tests/md_rendering_test.py
# vim: ts=4:sw=4 import logging from errbot import rendering log = logging.getLogger(__name__) def test_ansi(): mdc = rendering.ansi() assert mdc.convert("*woot*") == "\x1b[4mwoot\x1b[24m\x1b[0m" def test_text(): mdc = rendering.text() assert mdc.convert("*woot*") == "woot" assert mdc.convert(...
719
Python
.py
20
32.05
77
0.669086
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,106
matchall_test.py
errbotio_errbot/tests/matchall_test.py
# coding=utf-8 from os import path extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "matchall_plugin") def test_botmatch_correct(testbot): assert "Works!" in testbot.exec_command("hi hi hi") def test_botmatch(testbot): assert "Works!" in testbot.exec_command("123123")
301
Python
.py
7
40.142857
86
0.740484
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,107
circular_dependencies_test.py
errbotio_errbot/tests/circular_dependencies_test.py
import os extra_plugin_dir = os.path.join( os.path.dirname(os.path.realpath(__file__)), "circular_dependent_plugins" ) pytest_plugins = ["errbot.backends.test"] def test_if_all_loaded_circular_dependencies(testbot): """https://github.com/errbotio/errbot/issues/1397""" plug_names = testbot.bot.plugin_mana...
459
Python
.py
11
38.272727
77
0.737079
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,108
i18n_test.py
errbotio_errbot/tests/i18n_test.py
# -*- coding=utf-8 -*- from os import path # This is to test end2end i18n behavior. extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "i18n_plugin") def test_i18n_return(testbot): assert "язы́к" in testbot.exec_command("!i18n 1") def test_i18n_simple_name(testbot): assert "OK" in testbot...
698
Python
.py
14
43.214286
82
0.715421
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,109
streaming_test.py
errbotio_errbot/tests/streaming_test.py
from io import BytesIO from errbot.backends.base import Stream from errbot.backends.test import TestPerson from errbot.streaming import Tee class StreamingClient(object): def callback_stream(self, stream): self.response = stream.read() def test_streaming(): canary = b"this is my test" * 1000 so...
533
Python
.py
14
33.857143
66
0.733463
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,110
cascade_dependencies_test.py
errbotio_errbot/tests/cascade_dependencies_test.py
import os import pathlib from unittest import mock import pytest extra_plugin_dir = os.path.join( os.path.dirname(os.path.realpath(__file__)), "cascade_dependent_plugins" ) orig_path_glob = pathlib.Path.glob def reordered_plugin_files(self, pattern): if self.name == "cascade_dependent_plugins": yie...
1,088
Python
.py
26
37.423077
78
0.725546
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,111
mention_test.py
errbotio_errbot/tests/mention_test.py
from os import path extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "mention_plugin") def test_foreign_mention(testbot): assert "Somebody mentioned toto!" in testbot.exec_command( "I am telling you something @toto" ) def test_testbot_mention(testbot): assert "Somebody mentio...
568
Python
.py
14
35.642857
85
0.714808
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,112
config-ci.py
errbotio_errbot/tests/config-ci.py
# config for continus integration testing. # Don't use this for sensible defaults import logging BOT_DATA_DIR = "/tmp" BOT_EXTRA_PLUGIN_DIR = None AUTOINSTALL_DEPS = True BOT_LOG_FILE = "/tmp/err.log" BOT_LOG_LEVEL = logging.DEBUG BOT_LOG_SENTRY = False SENTRY_DSN = "" SENTRY_LOGLEVEL = BOT_LOG_LEVEL BOT_ASYNC = True ...
565
Python
.py
23
23.130435
42
0.724074
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,113
plugin_config_test.py
errbotio_errbot/tests/plugin_config_test.py
from os import path import pytest from errbot.botplugin import ValidationException, recurse_check_structure extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "config_plugin") def test_recurse_check_structure_valid(): sample = dict( string="Foobar", list=["Foo", "Bar"], ...
3,630
Python
.py
135
19.555556
87
0.553797
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,114
webhooks_test.py
errbotio_errbot/tests/webhooks_test.py
import json import logging import os import socket from time import sleep import pytest import requests log = logging.getLogger(__name__) PYTHONOBJECT = ["foo", {"bar": ("baz", None, 1.0, 2)}] JSONOBJECT = json.dumps(PYTHONOBJECT) # Webserver port is picked based on the process ID so that when tests # are run in pa...
6,257
Python
.py
163
32.374233
94
0.677089
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,115
flow_e2e_test.py
errbotio_errbot/tests/flow_e2e_test.py
from os import path from queue import Empty import pytest extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "flow_plugin") def test_list_flows(testbot): assert len(testbot.bot.flow_executor.flow_roots) == 4 testbot.bot.push_message("!flows list") result = testbot.pop_message() asse...
4,908
Python
.py
103
42.951456
88
0.70603
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,116
plugin_entrypoint_test.py
errbotio_errbot/tests/plugin_entrypoint_test.py
from errbot.utils import entry_point_plugins def test_entrypoint_paths(): plugins = entry_point_plugins("console_scripts") match = False for plugin in plugins: if "errbot/errbot.cli" in plugin: match = True assert match def test_entrypoint_paths_empty(): groups = ["errbot.pl...
477
Python
.py
13
30.692308
57
0.686275
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,117
poller_plugin.py
errbotio_errbot/tests/poller_plugin/poller_plugin.py
from __future__ import absolute_import from errbot import BotPlugin, botcmd class PollerPlugin(BotPlugin): def delayed_hello(self, frm): self.send(frm, "Hello world! was sent 5 seconds ago") @botcmd def hello(self, msg, args): """Say hello to the world.""" self.start_poller(0.1, ...
762
Python
.py
18
35.666667
84
0.646341
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,118
dyna.py
errbotio_errbot/tests/dyna_plugin/dyna.py
from __future__ import absolute_import from errbot import BotPlugin, Command, arg_botcmd, botcmd, botmatch def say_foo(plugin, msg, args): return "foo %s" % type(plugin) class Dyna(BotPlugin): """Just a test plugin to see if dynamic plugin API works.""" @botcmd def add_simple(self, _, _1): ...
2,561
Python
.py
76
25.328947
83
0.56998
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,119
roomtest.py
errbotio_errbot/tests/room_plugin/roomtest.py
import logging from queue import Queue from errbot import BotPlugin log = logging.getLogger(__name__) class RoomTest(BotPlugin): def activate(self): super().activate() self.purge() def callback_room_joined(self, room, user, invited_by): log.info("join") self.events.put(f"cal...
640
Python
.py
18
29.444444
60
0.666124
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,120
commandnotfound.py
errbotio_errbot/tests/commandnotfound_plugin/commandnotfound.py
from errbot import BotPlugin, cmdfilter class TestCommandNotFoundFilter(BotPlugin): @cmdfilter(catch_unprocessed=True) def command_not_found(self, msg, cmd, args, dry_run, emptycmd=False): if not emptycmd: return msg, cmd, args return f"Command fell through: {msg}"
305
Python
.py
7
37
73
0.711864
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,121
mp.py
errbotio_errbot/tests/multi_plugin/mp.py
from errbot import BotPlugin, botcmd class WhateverName(BotPlugin): """Test plugin to verify that now class names don't matter.""" @botcmd def myname(self, msg, args): return self.name
208
Python
.py
6
29.833333
66
0.713568
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,122
webtest.py
errbotio_errbot/tests/webhooks_plugin/webtest.py
import logging from flask import abort, after_this_request from errbot import BotPlugin from errbot.core_plugins.webserver import webhook log = logging.getLogger(__name__) class WebTest(BotPlugin): @webhook def webhook1(self, payload): log.debug(str(payload)) return str(payload) @webho...
1,432
Python
.py
43
26.55814
65
0.649927
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,123
test.py
errbotio_errbot/tests/template_plugin/test.py
from __future__ import absolute_import from errbot import BotPlugin, arg_botcmd, botcmd class Test(BotPlugin): @botcmd def test_template1(self, msg, args): self.send_templated(msg.frm, "test", {"variable": "ok"}) @botcmd(template="test") def test_template2(self, msg, args): return {"...
579
Python
.py
15
32.933333
64
0.650538
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,124
text_test.py
errbotio_errbot/tests/backend_tests/text_test.py
import logging import os import sys from tempfile import mkdtemp import pytest from errbot.backends.text import TextBackend from errbot.bootstrap import bot_config_defaults @pytest.fixture def text_backend(): tempdir = mkdtemp() # reset the config every time sys.modules.pop("errbot.config-template", No...
1,047
Python
.py
29
32.068966
60
0.725743
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,125
failp.py
errbotio_errbot/tests/fail_config_plugin/failp.py
from errbot import BotPlugin, ValidationException class FailP(BotPlugin): """ Just a plugin failing at config time. """ def get_configuration_template(self): return {"One": 1, "Two": 2} def check_configuration(self, configuration): raise ValidationException("Message explaining wh...
335
Python
.py
9
31.777778
70
0.708075
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,126
i18n.py
errbotio_errbot/tests/i18n_plugin/i18n.py
# -*- coding=utf-8 -*- from errbot import BotPlugin, botcmd class I18nTest(BotPlugin): """A Just a test plugin to see if it is picked up.""" @botcmd def i18n_1(self, msg, args): return "язы́к" @botcmd(name="ру́сский") def i18n_2(self, msg, args): return "OK" @botcmd(name="pr...
508
Python
.py
16
24.3125
57
0.606127
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,127
parent2.py
errbotio_errbot/tests/cascade_dependent_plugins/parent2.py
from errbot import BotPlugin, botcmd class Parent2(BotPlugin): @botcmd def parent2_to_parent1(self, msg, args): return self.get_plugin("Parent1").shared_function()
182
Python
.py
5
31.8
59
0.731429
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,128
child2.py
errbotio_errbot/tests/cascade_dependent_plugins/child2.py
from errbot import BotPlugin class Child2(BotPlugin): def shared_function(self): return "Hello from Child2"
122
Python
.py
4
26
34
0.75
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,129
parent1.py
errbotio_errbot/tests/cascade_dependent_plugins/parent1.py
from errbot import BotPlugin, botcmd class Parent1(BotPlugin): @botcmd def parent1_to_child1(self, msg, args): return self.get_plugin("Child1").shared_function() @botcmd def parent1_to_child2(self, msg, args): return self.get_plugin("Child2").shared_function() def shared_function...
364
Python
.py
10
30.6
58
0.694286
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,130
child1.py
errbotio_errbot/tests/cascade_dependent_plugins/child1.py
from errbot import BotPlugin class Child1(BotPlugin): def shared_function(self): return "Hello from Child1"
122
Python
.py
4
26
34
0.75
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,131
parent1.py
errbotio_errbot/tests/dependent_plugins/parent1.py
from errbot import BotPlugin class Parent1(BotPlugin): def shared_function(self): return "youpi"
111
Python
.py
4
23.25
30
0.742857
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,132
single.py
errbotio_errbot/tests/dependent_plugins/single.py
from errbot import BotPlugin, botcmd class Single(BotPlugin): @botcmd def depfunc(self, msg, args): return self.get_plugin("Parent1").shared_function()
170
Python
.py
5
29.4
59
0.723926
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,133
matchall.py
errbotio_errbot/tests/matchall_plugin/matchall.py
from errbot import BotPlugin, botmatch class MatchAll(BotPlugin): @botmatch(r".*") def all(self, msg, match): return "Works!"
144
Python
.py
5
24.2
38
0.678832
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,134
config.py
errbotio_errbot/tests/config_plugin/config.py
from errbot import BotPlugin class Config(BotPlugin): """ Just a plugin with a simple string config. """ def get_configuration_template(self): return {"One": "one"}
192
Python
.py
7
22.571429
46
0.67033
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,135
test.py
errbotio_errbot/tests/syntax_plugin/test.py
from __future__ import absolute_import from errbot import BotPlugin, arg_botcmd, botcmd, re_botcmd class Test(BotPlugin): """Just a test plugin to see if _err_botcmd_syntax is consistent on all types of botcmd""" @botcmd # no syntax def foo_nosyntax(self, msg, args): pass @botcmd(syntax="[...
654
Python
.py
17
32.823529
94
0.657143
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,136
flowtest_flows.py
errbotio_errbot/tests/flow_plugin/flowtest_flows.py
# ruff: noqa: F841 from __future__ import absolute_import from errbot import BotFlow, FlowRoot, botflow class FlowDefinitions(BotFlow): """A plugin to test the flows see flowtest.png for the structure. """ @botflow def w1(self, flow: FlowRoot): "documentation of W1" a_node = flow...
1,465
Python
.py
44
25.727273
69
0.584278
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,137
flowtest.py
errbotio_errbot/tests/flow_plugin/flowtest.py
from __future__ import absolute_import from errbot import BotPlugin, botcmd class FlowTest(BotPlugin): """A plugin to test the flows see flowtest.png for the structure. """ @botcmd def a(self, msg, args): return "a" @botcmd def b(self, msg, args): return "b" @botcmd...
504
Python
.py
21
18.238095
39
0.6
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,138
dummy.py
errbotio_errbot/tests/dummy_plugin/dummy.py
from __future__ import absolute_import from errbot import BotPlugin, botcmd, botmatch, re_botcmd class DummyTest(BotPlugin): """Just a test plugin to see if it is picked up.""" @botcmd def foo(self, msg, args): """This runs foo.""" return "bar" @re_botcmd(pattern=r"plz dont match th...
1,039
Python
.py
34
23.823529
57
0.600604
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,139
mention.py
errbotio_errbot/tests/mention_plugin/mention.py
from errbot import BotPlugin class MentionTestPlugin(BotPlugin): def callback_mention(self, msg, people): if self.bot_identifier in people: self.send(msg.frm, "Somebody mentioned me!", msg) return self.send( msg.frm, "Somebody mentioned %s!" % ",".join(p.person ...
352
Python
.py
9
30.777778
87
0.627566
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,140
broken.py
errbotio_errbot/tests/borken_plugin/broken.py
from errbot import BotPlugin, botcmd import borken # fails on purpose # noqa: F401 class Broken(BotPlugin): @botcmd def hello(self, msg, args): """this command says hello""" return "Hello World !"
224
Python
.py
7
27.285714
46
0.67907
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,141
botplugin.py
errbotio_errbot/errbot/botplugin.py
import logging import re import shlex from io import IOBase from threading import Timer, current_thread from types import ModuleType from typing import Any, Callable, List, Mapping, Optional, Sequence, Tuple from errbot.backends.base import ( ONLINE, Card, Identifier, Message, Presence, Reactio...
29,231
Python
.py
718
31.384401
119
0.613728
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,142
plugin_manager.py
errbotio_errbot/errbot/plugin_manager.py
"""Logic related to plugin loading and lifecycle""" import logging import os import subprocess import sys import traceback from copy import deepcopy from graphlib import CycleError from graphlib import TopologicalSorter as BaseTopologicalSorter from pathlib import Path from typing import Any, Callable, Dict, List, Opt...
24,665
Python
.py
561
33.012478
122
0.599167
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,143
config-template.py
errbotio_errbot/errbot/config-template.py
########################################################################## # # # This is the config-template for Err. This file should be copied and # # renamed to config.py, then modified as you see fit to run Errbot # # the way you like ...
18,339
Python
.py
348
51.227011
111
0.684122
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,144
flow.py
errbotio_errbot/errbot/flow.py
import atexit import logging from multiprocessing.pool import ThreadPool from threading import RLock from typing import Any, Callable, List, Mapping, Optional, Tuple, Union from errbot import Message from errbot.backends.base import Identifier, Room, RoomOccupant log = logging.getLogger(__name__) Predicate = Callabl...
17,964
Python
.py
420
31.952381
114
0.588074
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,145
templating.py
errbotio_errbot/errbot/templating.py
import logging from pathlib import Path from jinja2 import Environment, FileSystemLoader from errbot.plugin_info import PluginInfo log = logging.getLogger(__name__) def make_templates_path(root: Path) -> Path: return root / "templates" system_templates_path = str(make_templates_path(Path(__file__).parent)) t...
1,550
Python
.py
40
33.3
87
0.713904
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,146
streaming.py
errbotio_errbot/errbot/streaming.py
import io import logging import os from itertools import repeat, starmap from threading import Thread from typing import Callable, Optional from .backends.base import STREAM_TRANSFER_IN_PROGRESS, STREAM_WAITING_TO_START CHUNK_SIZE = 4096 log = logging.getLogger(__name__) def repeatfunc( func: Callable[..., Non...
3,395
Python
.py
84
29.75
91
0.581791
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,147
cli.py
errbotio_errbot/errbot/cli.py
#!/usr/bin/env python # This program 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. # # This program is distributed in the hope...
13,691
Python
.py
338
31.523669
115
0.61165
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,148
logs.py
errbotio_errbot/errbot/logs.py
import inspect import logging import sys from typing import Optional COLORS = { "DEBUG": "cyan", "INFO": "green", "WARNING": "yellow", "ERROR": "red", "CRITICAL": "red", } NO_COLORS = { "DEBUG": "", "INFO": "", "WARNING": "", "ERROR": "", "CRITICAL": "", } def ispydevd(): ...
2,197
Python
.py
66
27.787879
88
0.645892
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,149
utils.py
errbotio_errbot/errbot/utils.py
import collections import fnmatch import inspect import logging import os import re import sys import time from functools import wraps from platform import system from typing import List, Tuple, Union import pkg_resources from dulwich import porcelain log = logging.getLogger(__name__) ON_WINDOWS = system() == "Windo...
7,410
Python
.py
188
31.159574
120
0.600056
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,150
backend_plugin_manager.py
errbotio_errbot/errbot/backend_plugin_manager.py
import logging import sys from pathlib import Path from typing import Any, Iterator, List, Type, Union from errbot.plugin_info import PluginInfo from .utils import collect_roots, entry_point_plugins log = logging.getLogger(__name__) class PluginNotFoundException(Exception): pass def enumerate_backend_plugins...
2,217
Python
.py
58
30.155172
86
0.643357
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,151
__init__.py
errbotio_errbot/errbot/__init__.py
import argparse import inspect import logging import re import shlex from functools import wraps from typing import Any, Callable, Optional, Tuple from .backends.base import AWAY, DND, OFFLINE, ONLINE, Message # noqa from .botplugin import ( # noqa BotPlugin, Command, CommandError, SeparatorArgParser...
22,197
Python
.py
511
34.90411
98
0.637126
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,152
plugin_info.py
errbotio_errbot/errbot/plugin_info.py
import inspect import sys from configparser import ConfigParser from configparser import Error as ConfigParserError from dataclasses import dataclass from importlib._bootstrap import module_from_spec from importlib._bootstrap_external import spec_from_file_location from pathlib import Path from typing import List, Tupl...
3,921
Python
.py
98
30.285714
106
0.609346
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,153
core.py
errbotio_errbot/errbot/core.py
# This program 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. # # This program is distributed in the hope that it will ...
34,614
Python
.py
743
34.211306
112
0.577122
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,154
plugin_wizard.py
errbotio_errbot/errbot/plugin_wizard.py
import errno import os import re import sys from configparser import ConfigParser from typing import List, Optional import jinja2 from errbot.version import VERSION def new_plugin_wizard(directory: Optional[str] = None) -> None: """ Start the wizard to create a new plugin in the current working directory. ...
4,981
Python
.py
135
29.42963
103
0.614715
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,155
bootstrap.py
errbotio_errbot/errbot/bootstrap.py
import importlib import logging import sys import warnings from os import makedirs, path from typing import Callable, Optional from errbot.backend_plugin_manager import BackendPluginManager from errbot.core import ErrBot from errbot.logs import format_logs from errbot.plugin_manager import BotPluginManager from errbot...
10,328
Python
.py
233
36.085837
103
0.65722
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,156
repo_manager.py
errbotio_errbot/errbot/repo_manager.py
import json import logging import os import re import shutil import tarfile from collections import namedtuple from datetime import datetime, timedelta from os import path from pathlib import Path from typing import Dict, Generator, List, Optional, Sequence, Tuple from urllib.error import HTTPError, URLError from urlli...
11,285
Python
.py
274
31.160584
98
0.587097
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,157
version.py
errbotio_errbot/errbot/version.py
# Just the current version of Errbot. # It is used for deployment on pypi AND for version checking at plugin load time. VERSION = "9.9.9" # leave it at 9.9.9 on master until it is branched to a version.
204
Python
.py
3
67
83
0.746269
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,158
shelf.py
errbotio_errbot/errbot/storage/shelf.py
import logging import os import shelve import shutil from typing import Any from errbot.storage.base import StorageBase, StoragePluginBase log = logging.getLogger("errbot.storage.shelf") class ShelfStorage(StorageBase): def __init__(self, path): log.debug("Open shelf storage %s", path) self.shel...
1,997
Python
.py
50
30.58
104
0.594413
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,159
memory.py
errbotio_errbot/errbot/storage/memory.py
from typing import Any from errbot.storage.base import StorageBase, StoragePluginBase ROOTS = {} # make a little bit of an emulated persistence. class MemoryStorage(StorageBase): def __init__(self, namespace): self.namespace = namespace self.root = ROOTS.get(namespace, {}) def get(self, ke...
991
Python
.py
26
31.115385
62
0.648478
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,160
__init__.py
errbotio_errbot/errbot/storage/__init__.py
import logging from collections.abc import MutableMapping from contextlib import contextmanager log = logging.getLogger(__name__) class StoreException(Exception): pass class StoreAlreadyOpenError(StoreException): pass class StoreNotOpenError(StoreException): pass class StoreMixin(MutableMapping): ...
2,544
Python
.py
74
26.581081
108
0.622395
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,161
base.py
errbotio_errbot/errbot/storage/base.py
from abc import abstractmethod from typing import Any, Iterable class StorageBase: """ Contract to implemement a storage. """ @abstractmethod def set(self, key: str, value: Any) -> None: """ Atomically set the key to the given value. The caller of set will protect against ...
2,048
Python
.py
67
23.089552
84
0.602649
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,162
new_plugin.py.tmpl
errbotio_errbot/errbot/templates/new_plugin.py.tmpl
from errbot import BotPlugin, arg_botcmd, botcmd, webhook class {{ class_name }}(BotPlugin): """ {{ description }} """ def activate(self): """ Triggers on plugin activation You should delete it if you're not using it to override any default behaviour """ super...
2,901
Python
.py
73
31.493151
95
0.636266
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,163
example.py
errbotio_errbot/errbot/templates/initdir/example.py
from errbot import BotPlugin, botcmd class Example(BotPlugin): """ This is a very basic plugin to try out your new installation and get you started. Feel free to tweak me to experiment with Errbot. You can find me in your init directory in the subdirectory plugins. """ @botcmd # flags a comm...
667
Python
.py
15
38.2
85
0.687211
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,164
config.py.tmpl
errbotio_errbot/errbot/templates/initdir/config.py.tmpl
import logging # This is a minimal configuration to get you started with the Text mode. # If you want to connect Errbot to chat services, checkout # the options in the more complete config-template.py from here: # https://raw.githubusercontent.com/errbotio/errbot/master/errbot/config-template.py BACKEND = "Text" # E...
729
Python
.py
14
50.428571
107
0.73662
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,165
webserver.py
errbotio_errbot/errbot/core_plugins/webserver.py
import logging import os import sys from json import loads from random import randrange from threading import Thread from urllib.request import unquote from OpenSSL import crypto from webtest import TestApp from werkzeug.serving import ThreadedWSGIServer from errbot import BotPlugin, botcmd, webhook from errbot.core_...
7,352
Python
.py
185
30.281081
96
0.597786
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,166
help.py
errbotio_errbot/errbot/core_plugins/help.py
import textwrap from dulwich import errors as dulwich_errors from errbot import BotPlugin, botcmd from errbot.utils import git_tag_list from errbot.version import VERSION class Help(BotPlugin): MSG_HELP_TAIL = ( "Type help <command name> to get more info " "about that specific command." ) MSG_HE...
7,318
Python
.py
168
30.267857
96
0.519893
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,167
plugins.py
errbotio_errbot/errbot/core_plugins/plugins.py
import logging import os import shutil from ast import literal_eval from pprint import pformat from errbot import BotPlugin, botcmd from errbot.plugin_manager import ( PluginActivationException, PluginConfigurationException, ) from errbot.repo_manager import RepoException class Plugins(BotPlugin): @botcm...
14,566
Python
.py
302
36.629139
136
0.601069
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,168
backup.py
errbotio_errbot/errbot/core_plugins/backup.py
import os from errbot import BotPlugin, botcmd class Backup(BotPlugin): """Backup related commands.""" @botcmd(admin_only=True) def backup(self, msg, args): """Backup everything. Makes a backup script called backup.py in the data bot directory. You can restore the backup from the...
2,200
Python
.py
44
36.636364
104
0.528399
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,169
acls.py
errbotio_errbot/errbot/core_plugins/acls.py
import fnmatch from errbot import BotPlugin, cmdfilter from errbot.backends.base import RoomOccupant BLOCK_COMMAND = (None, None, None) def get_acl_usr(msg): """Return the ACL attribute of the sender of the given message""" if hasattr( msg.frm, "aclattr" ): # if the identity requires a special ...
5,645
Python
.py
132
31.439394
89
0.578871
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,170
wsview.py
errbotio_errbot/errbot/core_plugins/wsview.py
import logging from inspect import getmembers, ismethod from json import loads from flask import request from flask.app import Flask from flask.views import View import errbot.core_plugins log = logging.getLogger(__name__) def strip_path(): # strip the trailing slashes on incoming requests request.environ[...
3,376
Python
.py
83
30.216867
86
0.57906
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,171
utils.py
errbotio_errbot/errbot/core_plugins/utils.py
from os import path from errbot import BotPlugin, botcmd def tail(f, window=20): return "".join(f.readlines()[-window:]) class Utils(BotPlugin): # noinspection PyUnusedLocal @botcmd def echo(self, _, args): """A simple echo command. Useful for encoding tests etc ...""" return args ...
2,462
Python
.py
62
31.193548
105
0.552389
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,172
cnf_filter.py
errbotio_errbot/errbot/core_plugins/cnf_filter.py
from errbot import BotPlugin, cmdfilter class CommandNotFoundFilter(BotPlugin): @cmdfilter(catch_unprocessed=True) def cnf_filter(self, msg, cmd, args, dry_run, emptycmd=False): """ Check if command exists. If not, signal plugins. This plugin will be called twice: once as a command f...
1,404
Python
.py
30
36.533333
87
0.621245
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,173
textcmds.py
errbotio_errbot/errbot/core_plugins/textcmds.py
from errbot import BotPlugin, botcmd INROOM, USER, MULTILINE = "inroom", "user", "multiline" class TextModeCmds(BotPlugin): """ Internal to TextBackend. """ __errdoc__ = "Added commands for testing purposes" def activate(self): # This won't activate the plugin in anything else than text...
2,816
Python
.py
80
26.3375
108
0.569327
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,174
chatRoom.py
errbotio_errbot/errbot/core_plugins/chatRoom.py
import logging from errbot import BotPlugin, ShlexArgParser, botcmd from errbot.backends.base import RoomNotJoinedError log = logging.getLogger(__name__) class ChatRoom(BotPlugin): connected = False def callback_connect(self): self.log.info("Connecting bot chatrooms") if not self.connected:...
8,117
Python
.py
209
27.933014
84
0.559878
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,175
health.py
errbotio_errbot/errbot/core_plugins/health.py
import gc import os import signal from datetime import datetime from errbot import BotPlugin, arg_botcmd, botcmd from errbot.utils import format_timedelta, global_restart class Health(BotPlugin): @botcmd(template="status") def status(self, msg, args): """If I am alive I should be able to respond to t...
3,805
Python
.py
102
27.843137
90
0.579447
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,176
vcheck.py
errbotio_errbot/errbot/core_plugins/vcheck.py
import sys import threading from json import JSONDecodeError from urllib.error import HTTPError, URLError import requests from requests.exceptions import ConnectionError from errbot import BotPlugin from errbot.utils import version2tuple from errbot.version import VERSION HOME = "https://errbot.io/versions.json" in...
2,728
Python
.py
66
32.363636
94
0.638218
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,177
flows.py
errbotio_errbot/errbot/core_plugins/flows.py
import io import json from errbot import BotPlugin, arg_botcmd, botcmd from errbot.core_plugins.acls import get_acl_usr, glob from errbot.flow import FLOW_END, Flow, FlowNode, FlowRoot class Flows(BotPlugin): """Management commands related to flows / conversations.""" def recurse_node( self, respons...
6,478
Python
.py
143
31.132867
108
0.506654
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,178
test.py
errbotio_errbot/errbot/backends/test.py
import importlib import logging import sys import textwrap import unittest from os.path import abspath, sep from queue import Empty, Queue from tempfile import mkdtemp from threading import Thread from typing import BinaryIO, List, Optional import pytest from errbot.backends.base import ( ONLINE, Identifier, ...
22,382
Python
.py
571
30.259194
119
0.611931
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,179
null.py
errbotio_errbot/errbot/backends/null.py
import logging from time import sleep from errbot.backends.base import ONLINE from errbot.backends.test import TestPerson from errbot.core import ErrBot log = logging.getLogger(__name__) class ConnectionMock: def send(self, msg): pass def send_message(self, msg): pass class NullBackend(Er...
1,771
Python
.py
55
24.309091
79
0.620507
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,180
text.py
errbotio_errbot/errbot/backends/text.py
import copyreg import logging import re import sys from time import sleep from typing import BinaryIO, List, Optional, Union from ansi.color import fg, fx from markdown import Markdown from markdown.extensions.extra import ExtraExtension from pygments import highlight from pygments.formatters import Terminal256Formatt...
14,985
Python
.py
392
28.293367
104
0.579325
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,181
base.py
errbotio_errbot/errbot/backends/base.py
import io import logging import random import time from abc import ABC, abstractmethod from collections import defaultdict, deque from typing import Any, BinaryIO, List, Mapping, Optional, Sequence, Tuple, Type log = logging.getLogger(__name__) class Identifier(ABC): """This is just use for type hinting represen...
28,814
Python
.py
813
27.206642
120
0.610322
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,182
xmpp.py
errbotio_errbot/errbot/backends/xmpp.py
from __future__ import annotations import logging import sys from datetime import datetime from functools import lru_cache from time import sleep from typing import Callable, List, Optional, Tuple, Union from errbot.backends.base import ( AWAY, DND, OFFLINE, ONLINE, Identifier, Message, Pe...
22,837
Python
.py
588
29.454082
114
0.59402
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,183
irc.py
errbotio_errbot/errbot/backends/irc.py
from __future__ import absolute_import import logging import re import struct import subprocess import sys import threading from typing import Any, BinaryIO, List, Optional, Union from markdown import Markdown from markdown.extensions.extra import ExtraExtension from errbot.backends.base import ( ONLINE, Ide...
28,216
Python
.py
740
28.966216
109
0.596152
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,184
telegram_messenger.py
errbotio_errbot/errbot/backends/telegram_messenger.py
import logging import sys from typing import Any, BinaryIO, Optional, Union from errbot.backends.base import ( ONLINE, Identifier, Message, Person, Room, RoomError, RoomOccupant, Stream, ) from errbot.core import ErrBot from errbot.rendering import text from errbot.rendering.ansiext imp...
16,107
Python
.py
417
28.561151
116
0.588642
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,185
__init__.py
errbotio_errbot/errbot/rendering/__init__.py
# vim: noai:ts=4:sw=4 import re from markdown import Markdown from markdown.extensions.extra import ExtraExtension # Attribute regexp looks for extendend syntax: {: ... } ATTR_RE = re.compile(r"{:([^}]*)}") MD_ESCAPE_RE = re.compile( "|".join( re.escape(c) for c in ( "\\", ...
3,059
Python
.py
92
26.586957
102
0.620326
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,186
ansiext.py
errbotio_errbot/errbot/rendering/ansiext.py
import io import logging from collections import namedtuple from functools import partial from html import unescape from itertools import chain from ansi.colour import bg, fg, fx from markdown import Markdown from markdown.extensions import Extension from markdown.extensions.fenced_code import FencedBlockPreprocessor ...
15,663
Python
.py
480
23.383333
100
0.525697
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,187
xhtmlim.py
errbotio_errbot/errbot/rendering/xhtmlim.py
import re from html.entities import entitydefs # Helpers for xhtml-im SAFE_ENTITIES = { e: entitydefs[e] for e in entitydefs if e not in ("amp", "quot", "apos", "gt", "lt") } _invalid_codepoints = { # 0x0001 to 0x0008 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, # 0x000E to 0x0...
4,271
Python
.py
207
15.217391
88
0.556981
errbotio/errbot
3,120
612
59
GPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,188
notest_dump_last.py
cve-search_cve-search/test/unit/notest_dump_last.py
import pytest from test.runners.cli_test_runner import CLITestRunner @pytest.fixture def runner(): return CLITestRunner() def test_dump_last_atom(runner): result = runner.runcommand("bin/dump_last.py -f atom -l 2") test_results = result.stdout.replace("\n", "") assert result.returncode == 0 a...
1,183
Python
.py
28
37.571429
78
0.676937
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,189
test_db_dump.py
cve-search_cve-search/test/unit/test_db_dump.py
import pytest from test.runners.cli_test_runner import CLITestRunner @pytest.fixture def runner(): return CLITestRunner() def test_db_dump(runner): result = runner.runcommand("bin/db_dump.py -l 1 -r -v -c") assert result.returncode == 0
255
Python
.py
8
28.625
62
0.746888
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,190
notest_cve_doc.py
cve-search_cve-search/test/unit/notest_cve_doc.py
import pytest from test.runners.cli_test_runner import CLITestRunner @pytest.fixture def runner(): return CLITestRunner() def test_cve_doc(runner): result = runner.runcommand("bin/cve_doc.py") test_results = result.stdout.replace("\n", "") assert result.returncode == 0 assert test_results[105...
345
Python
.py
10
30.8
54
0.731707
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,191
test_search.py
cve-search_cve-search/test/unit/test_search.py
import json import pytest from test.runners.cli_test_runner import CLITestRunner @pytest.fixture def runner(): return CLITestRunner() def test_search(runner): result = runner.runcommand("bin/search.py -p cisco:ios:12.4") assert result.returncode == 0 assert result.stdout[:20] == "CVE\t: CVE-2017-...
4,098
Python
.py
93
39.204301
86
0.676456
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,192
test_search_cpe.py
cve-search_cve-search/test/unit/test_search_cpe.py
import pytest from test.runners.cli_test_runner import CLITestRunner @pytest.fixture def runner(): return CLITestRunner() def test_search_cpe(runner): result = runner.runcommand("bin/search_cpe.py -s wordpress") resultlist = result.stdout.split("\n") assert result.returncode == 0 # check if ...
1,173
Python
.py
27
38.814815
99
0.712766
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,193
setup_test_data.py
cve-search_cve-search/test/test_data/setup_test_data.py
import os import sys runPath = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(runPath, "../..")) from dateutil.parser import parse as parse_datetime from lib.Config import Configuration as conf data = { "cves": [ { "id": "CVE-2015-0001", "assigner": "cve@...
58,258
Python
.py
929
47.159311
1,688
0.428973
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,194
notest_web.py
cve-search_cve-search/test/web/notest_web.py
import pytest from bs4 import BeautifulSoup from test.runners.web_test_runner import WebTestRunner @pytest.fixture def webrunner(): return WebTestRunner(address=("localhost", 443)) def test_web_up(webrunner): result = webrunner.call(method="GET", resource="/") soup = BeautifulSoup(result.text, feature...
448
Python
.py
11
37.272727
72
0.753488
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,195
cli_test_runner.py
cve-search_cve-search/test/runners/cli_test_runner.py
from subprocess import run, PIPE, STDOUT class CLITestRunner(object): def __init__(self): self.runner = None self.cmd = None def runcommand(self, cmd): self.cmd = cmd self.runner = run( self.cmd.split(" "), stdout=PIPE, stderr=STDOUT, ...
414
Python
.py
15
18.6
40
0.549367
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,196
web_test_runner.py
cve-search_cve-search/test/runners/web_test_runner.py
import json from json import JSONDecodeError import requests class WebTestRunner(object): """ The WebTestRunner class serves as a base class for all API's used within the tests """ def __init__(self, address, api_path=None, proxies={}, protocol="https"): """ The WebTestRunner caller ...
6,286
Python
.py
163
28.441718
115
0.578679
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,197
cve_doc.py
cve-search_cve-search/bin/cve_doc.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # cve_doc converts CVE to asciidoc # # Software is free software released under the "GNU Affero General Public License v3.0" # # Copyright (c) 2015-2018 Alexandre Dulaunoy - a@foo.be import json import os import re import sys from optparse import OptionParser runPath =...
2,329
Python
.py
72
28.847222
88
0.617163
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,198
db_dump.py
cve-search_cve-search/bin/db_dump.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Tool to dump in JSON the database along with the associated ranking # # Software is free software released under the "GNU Affero General Public License v3.0" # # Copyright (c) 2012-2018 Alexandre Dulaunoy - a@foo.be # Copyright (c) 2015-2018 Pieter-Jan Moreels - piet...
1,713
Python
.py
51
30.627451
87
0.726119
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)
16,199
cve_refs.py
cve-search_cve-search/bin/cve_refs.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Lookup NIST CVE Reference Key/Maps from a CVE # # Software is free software released under the "GNU Affero General Public License v3.0" # # Copyright (c) 2015-2018 Alexandre Dulaunoy - a@foo.be import argparse import os import sys runPath = os.path.dirname(os.path....
1,881
Python
.py
58
28.396552
87
0.655991
cve-search/cve-search
2,271
587
2
AGPL-3.0
9/5/2024, 5:12:14 PM (Europe/Amsterdam)