Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
guppy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
msemper
guppy
Commits
6b205139
Commit
6b205139
authored
11 years ago
by
Svetlana Tkachenko
Browse files
Options
Downloads
Patches
Plain Diff
Actually remove the old plugintools file
parent
86002658
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/plugintools.py
+0
-96
0 additions, 96 deletions
plugins/plugintools.py
with
0 additions
and
96 deletions
plugins/plugintools.py
deleted
100644 → 0
+
0
−
96
View file @
86002658
# guppy Copyright (C) 2010-2011 guppy team members.
#
# This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
# This is free software, and you are welcome to redistribute it
# under certain conditions; type `show c' for details.
# 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
import
sys
@plugin
class
Plugintools
(
object
):
def
__init__
(
self
,
server
):
self
.
server
=
server
self
.
server
.
pluginManager
.
loadPlugin
(
"
Auth
"
)
self
.
commands
=
[
"
load
"
,
"
unload
"
,
"
reload
"
,
"
reloadall
"
,
"
loaded
"
,
"
allplugins
"
]
self
.
ownerOnly
=
1
self
.
server
.
handle
(
"
command
"
,
self
.
handle_command
,
self
.
commands
)
def
handle_command
(
self
,
channel
,
user
,
cmd
,
args
):
if
self
.
server
.
getPlugin
(
"
auth
"
).
isMod
(
user
):
if
cmd
==
"
reloadall
"
:
self
.
server
.
pluginManager
.
unloadAllPlugins
()
self
.
server
.
pluginManager
.
loadAllPlugins
()
self
.
server
.
doMessage
(
channel
,
user
+
"
: Reloaded all plugins
"
)
return
elif
cmd
==
"
allplugins
"
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: Available plugins:
"
+
"
"
.
join
(
list
(
sys
.
modules
[
"
irc
"
].
plugins
.
pList
.
keys
())))
return
if
len
(
args
)
<
1
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: Not enough arguments.
"
)
return
if
cmd
==
"
load
"
:
success
,
failed
,
dne
=
[],
[],
[]
for
arg
in
args
:
if
self
.
server
.
pluginManager
.
pluginExists
(
arg
):
if
self
.
server
.
pluginManager
.
loadedPlugin
(
arg
):
failed
.
append
(
arg
)
else
:
self
.
server
.
pluginManager
.
loadPlugin
(
arg
)
success
.
append
(
arg
)
else
:
dne
.
append
(
arg
)
if
len
(
dne
):
self
.
server
.
doMessage
(
channel
,
user
+
"
: Non-existent plugins:
"
+
"
,
"
.
join
(
dne
))
if
len
(
failed
):
self
.
server
.
doMessage
(
channel
,
user
+
"
: Already loaded plugins:
"
+
"
,
"
.
join
(
failed
))
if
len
(
success
):
self
.
server
.
doMessage
(
channel
,
user
+
"
: Successfully loaded plugins:
"
+
"
,
"
.
join
(
success
))
elif
cmd
==
"
unload
"
:
for
arg
in
args
:
if
self
.
server
.
pluginManager
.
pluginExists
(
arg
):
if
self
.
server
.
pluginManager
.
loadedPlugin
(
arg
):
self
.
server
.
pluginManager
.
unloadPlugin
(
arg
)
self
.
server
.
doMessage
(
channel
,
user
+
"
: Successfully unloaded plugin
"
+
arg
)
else
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: Plugin
"
+
arg
+
"
has not been loaded
"
)
else
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: No such plugin
"
+
arg
)
elif
cmd
==
"
reload
"
:
for
arg
in
args
:
if
self
.
server
.
pluginManager
.
pluginExists
(
arg
):
if
self
.
server
.
pluginManager
.
loadedPlugin
(
arg
):
self
.
server
.
pluginManager
.
reloadPlugin
(
arg
)
self
.
server
.
doMessage
(
channel
,
user
+
"
: Successfully reloaded plugin
"
+
arg
)
else
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: Plugin
"
+
arg
+
"
has not been loaded
"
)
else
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: No such plugin
"
+
arg
)
elif
cmd
==
"
loaded
"
:
if
self
.
server
.
pluginManager
.
loadedPlugin
(
args
[
0
]):
self
.
server
.
doMessage
(
channel
,
user
+
"
: Plugin
"
+
args
[
0
]
+
"
is loaded
"
)
else
:
if
self
.
server
.
pluginManager
.
pluginExists
(
args
[
0
]):
self
.
server
.
doMessage
(
channel
,
user
+
"
: Plugin
"
+
args
[
0
]
+
"
is not loaded
"
)
else
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: Plugin
"
+
args
[
0
]
+
"
does not exist
"
)
else
:
self
.
server
.
doMessage
(
channel
,
user
+
"
: You are not authorized to use this function.
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment