MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / HandleLeaveChan

Method HandleLeaveChan

src/api.py:451–465  ·  view source on GitHub ↗
(self, params)

Source from the content-addressed store, hash-verified

449 return "success"
450
451 def HandleLeaveChan(self, params):
452 if len(params) == 0:
453 raise APIError(0, 'I need parameters.')
454 elif len(params) == 1:
455 address, = params
456 status, addressVersionNumber, streamNumber, toRipe = self._verifyAddress(address)
457 address = addBMIfNotPresent(address)
458 if not BMConfigParser().has_section(address):
459 raise APIError(13, 'Could not find this address in your keys.dat file.')
460 if not BMConfigParser().safeGetBoolean(address, 'chan'):
461 raise APIError(25, 'Specified address is not a chan address. Use deleteAddress API call instead.')
462 BMConfigParser().remove_section(address)
463 with open(state.appdata + 'keys.dat', 'wb') as configfile:
464 BMConfigParser().write(configfile)
465 return 'success'
466
467 def HandleDeleteAddress(self, params):
468 if len(params) == 0:

Callers

nothing calls this directly

Calls 6

_verifyAddressMethod · 0.95
addBMIfNotPresentFunction · 0.90
BMConfigParserClass · 0.90
APIErrorClass · 0.85
safeGetBooleanMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected