Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions plugins/SedRegex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,31 @@
import supybot
import supybot.world as world

__version__ = supybot.version.version
__author__ = supybot.Author("Michael Daniel Telatynski", "t3chguy", "postmaster@webdevguru.co.uk")
__contributors__ = {supybot.authors.jlu:
["options bolding the replacement text", "misc. bug fixes and enhancements"],
supybot.Author('nyuszika7h', 'nyuszika7h', 'nyuszika7h@openmailbox.org'):
["_unpack_sed method within plugin.py"]
}
__maintainer__ = supybot.authors.limnoria_core
if not world.supyprocessing:
__version__ = supybot.version.version
__author__ = supybot.Author("Michael Daniel Telatynski", "t3chguy", "postmaster@webdevguru.co.uk")
__contributors__ = {supybot.authors.jlu:
["options bolding the replacement text", "misc. bug fixes and enhancements"],
supybot.Author('nyuszika7h', 'nyuszika7h', 'nyuszika7h@openmailbox.org'):
["_unpack_sed method within plugin.py"]
}
__maintainer__ = supybot.authors.limnoria_core

__url__ = 'https://github.com/progval/Limnoria/tree/master/plugins/SedRegex'
__url__ = 'https://github.com/progval/Limnoria/tree/master/plugins/SedRegex'

from . import sedregex
from . import config
from . import plugin
from importlib import reload
from . import sedregex
from . import config
from . import plugin
from importlib import reload

reload(sedregex)
reload(config)
reload(plugin)
reload(sedregex)
reload(config)
reload(plugin)

if world.testing:
from . import test
if world.testing:
from . import test

Class = plugin.Class
configure = config.configure
Class = plugin.Class
configure = config.configure

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
17 changes: 17 additions & 0 deletions src/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ def __init__(self, *args, **kwargs):
super(SupyProcess, self).__init__(*args, **kwargs)
log.debug('Spawning process %q.', self.name)

def run(self):
global supyprocessing
supyprocessing = True
return super().run()

# significantly speeds up starting SupyProcess
multiprocessing.set_forkserver_preload([
"multiprocessing",
"supybot", "supybot.callbacks", "supybot.plugin", "supybot.plugins",
"supybot.irclib", "supybot.ircmsgs", "supybot.ircutils",
"supybot.shlex", "supybot.utils"])

commandsProcessed = 0

ircs = [] # A list of all the IRCs.
Expand Down Expand Up @@ -231,6 +243,11 @@ def finished():
starting = False
profiling = False
documenting = False
supyprocessing = False
"""Whether the current process is running as the target of SupyProcess.

Plugins can check if this is True to avoid unnecessary imports that slow down
process initialization."""


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: