forked from indymedia/epicyon
Option to remove delegation
parent
523bae7b06
commit
0bff04d5c2
41
epicyon.py
41
epicyon.py
|
@ -215,6 +215,8 @@ parser.add_argument('--unblock', dest='unblock', type=str,default=None, \
|
||||||
help='Remove a block on a particular address')
|
help='Remove a block on a particular address')
|
||||||
parser.add_argument('--delegate', dest='delegate', type=str,default=None, \
|
parser.add_argument('--delegate', dest='delegate', type=str,default=None, \
|
||||||
help='Address of an account to delegate a role to')
|
help='Address of an account to delegate a role to')
|
||||||
|
parser.add_argument('--undodelegate','--undelegate', dest='undelegate', type=str,default=None, \
|
||||||
|
help='Removes a delegated role for the given address')
|
||||||
parser.add_argument('--filter', dest='filterStr', type=str,default=None, \
|
parser.add_argument('--filter', dest='filterStr', type=str,default=None, \
|
||||||
help='Adds a word or phrase which if present will cause a message to be ignored')
|
help='Adds a word or phrase which if present will cause a message to be ignored')
|
||||||
parser.add_argument('--unfilter', dest='unfilterStr', type=str,default=None, \
|
parser.add_argument('--unfilter', dest='unfilterStr', type=str,default=None, \
|
||||||
|
@ -235,8 +237,8 @@ if args.tests:
|
||||||
|
|
||||||
if args.testsnetwork:
|
if args.testsnetwork:
|
||||||
print('Network Tests')
|
print('Network Tests')
|
||||||
#testPostMessageBetweenServers()
|
testPostMessageBetweenServers()
|
||||||
#testFollowBetweenServers()
|
testFollowBetweenServers()
|
||||||
testClientToServer()
|
testClientToServer()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
@ -733,7 +735,7 @@ if args.availability:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
if args.project:
|
if args.project:
|
||||||
if not args.delegate:
|
if not args.delegate and not args.undelegate:
|
||||||
if not nickname:
|
if not nickname:
|
||||||
print('No nickname given')
|
print('No nickname given')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -842,6 +844,39 @@ if args.delegate:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
if args.undelegate:
|
||||||
|
if not nickname:
|
||||||
|
print('Specify a nickname with the --nickname option')
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
if not args.password:
|
||||||
|
print('Specify a password with the --password option')
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
if not args.project:
|
||||||
|
print('Specify a project with the --project option')
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
if '@' in args.undelegate:
|
||||||
|
delegatedNickname=args.undelegate.split('@')[0]
|
||||||
|
args.undelegate=blockedActor
|
||||||
|
|
||||||
|
session = createSession(domain,port,useTor)
|
||||||
|
personCache={}
|
||||||
|
cachedWebfingers={}
|
||||||
|
print('Sending delegation removal for '+args.undelegate+' from role '+args.role+' in project '+args.project)
|
||||||
|
|
||||||
|
sendRoleViaServer(session,nickname,args.password,
|
||||||
|
domain,port, \
|
||||||
|
httpPrefix,args.delegate, \
|
||||||
|
args.project,None, \
|
||||||
|
cachedWebfingers,personCache, \
|
||||||
|
True)
|
||||||
|
for i in range(10):
|
||||||
|
# TODO detect send success/fail
|
||||||
|
time.sleep(1)
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
if args.unblock:
|
if args.unblock:
|
||||||
if not nickname:
|
if not nickname:
|
||||||
print('Specify a nickname with the --nickname option')
|
print('Specify a nickname with the --nickname option')
|
||||||
|
|
Loading…
Reference in New Issue