Prevent disable and enable from ever being disabled
This commit is contained in:
parent
ea31ada3ce
commit
a61f7688cc
|
@ -83,6 +83,9 @@ class Manager:
|
||||||
|
|
||||||
|
|
||||||
def run(self,name,args=None):
|
def run(self,name,args=None):
|
||||||
|
name = name.strip()
|
||||||
|
|
||||||
|
if (name in self.enabled)==True:
|
||||||
self.enabled[name].run(args)
|
self.enabled[name].run(args)
|
||||||
|
|
||||||
|
|
||||||
|
|
4
src/clean.sh
Normal file
4
src/clean.sh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm -r ./*/*.pyc
|
||||||
|
rm -r ./*/*/*.pyc
|
|
@ -18,7 +18,7 @@ def addch(input):
|
||||||
c = stdscr.getch()
|
c = stdscr.getch()
|
||||||
|
|
||||||
if c == 10:
|
if c == 10:
|
||||||
enter(input)
|
input = enter(input)
|
||||||
|
|
||||||
elif c == 127:
|
elif c == 127:
|
||||||
input = backspace(input)
|
input = backspace(input)
|
||||||
|
@ -42,4 +42,5 @@ def backspace(input):
|
||||||
|
|
||||||
# Attempt to run a command
|
# Attempt to run a command
|
||||||
def enter(input):
|
def enter(input):
|
||||||
run(input)
|
input = run(input)
|
||||||
|
return input
|
|
@ -11,9 +11,11 @@ from manager import manager
|
||||||
|
|
||||||
# Check for valid input
|
# Check for valid input
|
||||||
def run(input):
|
def run(input):
|
||||||
|
prompt = input[0:4]
|
||||||
input = input[4:]
|
input = input[4:]
|
||||||
split = input.split()
|
split = input.strip().split()
|
||||||
if len(split)>1:
|
if len(split)>1:
|
||||||
manager.run(split[0],split[1:])
|
manager.run(split[0],split[1:])
|
||||||
else:
|
else:
|
||||||
manager.run(input)
|
manager.run(input)
|
||||||
|
return prompt
|
||||||
|
|
39
src/core/disable.py
Normal file
39
src/core/disable.py
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#! /usr/bin/python
|
||||||
|
|
||||||
|
# To change this template, choose Tools | Templates
|
||||||
|
# and open the template in the editor.
|
||||||
|
|
||||||
|
__author__="bjschuma"
|
||||||
|
__date__ ="$Dec 20, 2009 12:52:29 AM$"
|
||||||
|
|
||||||
|
|
||||||
|
global name, app, type, path, opt
|
||||||
|
name = "disable"
|
||||||
|
app = "scion"
|
||||||
|
type = "core"
|
||||||
|
path = ""
|
||||||
|
opt = []
|
||||||
|
|
||||||
|
|
||||||
|
from manager import manager
|
||||||
|
|
||||||
|
|
||||||
|
# Called every time the plugin is enabled
|
||||||
|
def open():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Called every time the plugin is stopped
|
||||||
|
def close():
|
||||||
|
# Run this to prevent disable from ever being disabled
|
||||||
|
manager.run("enable",("disable"))
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the plugin needs to perform some action
|
||||||
|
def run(args=None):
|
||||||
|
if args == None:
|
||||||
|
return
|
||||||
|
|
||||||
|
for plugin in args:
|
||||||
|
manager.disablePlugin(plugin)
|
38
src/core/enable.py
Normal file
38
src/core/enable.py
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#! /usr/bin/python
|
||||||
|
|
||||||
|
# To change this template, choose Tools | Templates
|
||||||
|
# and open the template in the editor.
|
||||||
|
|
||||||
|
__author__="bjschuma"
|
||||||
|
__date__ ="$Dec 20, 2009 12:54:32 AM$"
|
||||||
|
|
||||||
|
|
||||||
|
global name, app, type, path, opt
|
||||||
|
name = "enable"
|
||||||
|
app = "scion"
|
||||||
|
type = "core"
|
||||||
|
path = ""
|
||||||
|
opt = []
|
||||||
|
|
||||||
|
from manager import manager
|
||||||
|
|
||||||
|
|
||||||
|
# Called every time the plugin is enabled
|
||||||
|
def open():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Called every time the plugin is stopped
|
||||||
|
def close():
|
||||||
|
# Prevent enable from ever being disabled
|
||||||
|
manager.enablePlugin("enable")
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the plugin needs to perform some action
|
||||||
|
def run(args=None):
|
||||||
|
if args == None:
|
||||||
|
return
|
||||||
|
|
||||||
|
for plugin in args:
|
||||||
|
manager.enablePlugin(plugin)
|
|
@ -30,5 +30,8 @@ def close():
|
||||||
|
|
||||||
# Called when the plugin needs to perform some action
|
# Called when the plugin needs to perform some action
|
||||||
def run(args=None):
|
def run(args=None):
|
||||||
|
if args == None:
|
||||||
|
return
|
||||||
|
|
||||||
for plugin in args:
|
for plugin in args:
|
||||||
manager.reloadPlugin(plugin)
|
manager.reloadPlugin(plugin)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user