Implement fair channel allocation in ChanKeep
* Allocate channels to relays only if they have free space based on their chanlimit value * Minify channels by removing ones that are already covered before passing them off to be joined
This commit is contained in:
26
commands/list.py
Normal file
26
commands/list.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import main
|
||||
|
||||
class ListCommand:
|
||||
def __init__(self, *args):
|
||||
self.list(*args)
|
||||
|
||||
def list(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||
if authed:
|
||||
if length == 2:
|
||||
if not spl[1] in main.network.keys():
|
||||
failure("No such network: %s" % spl[1])
|
||||
return
|
||||
if not 1 in main.network[spl[1]].relays.keys():
|
||||
failure("Network has no first instance")
|
||||
return
|
||||
if not spl[1]+"1" in main.IRCPool.keys():
|
||||
failure("No IRC instance: %s - 1" % spl[1])
|
||||
return
|
||||
main.IRCPool[spl[1]+"1"].list()
|
||||
success("Requested list with first instance of %s" % spl[1])
|
||||
return
|
||||
else:
|
||||
incUsage("list")
|
||||
return
|
||||
else:
|
||||
incUsage(None)
|
||||
Reference in New Issue
Block a user