mirror of
https://github.com/ComradCollective/Comrad
synced 2024-11-11 13:10:45 +00:00
updates
This commit is contained in:
parent
7a07babe4c
commit
822f080811
@ -12,25 +12,39 @@ class Komrade(Caller):
|
||||
self.cli = CLI(name=name, komrade=self)
|
||||
self.boot(create=False)
|
||||
|
||||
def boot(self,create=False):
|
||||
def boot(self,create=False,ping=False):
|
||||
# Do I already have my keys?
|
||||
# yes? -- login
|
||||
|
||||
keys = self.keychain()
|
||||
if keys.get('pubkey') and keys.get('privkey'):
|
||||
self.log('booted!')
|
||||
self.log('already booted! @'+self.name)
|
||||
return True
|
||||
|
||||
# If not, forge them -- only once!
|
||||
if not have_keys and create:
|
||||
self.get_new_keys()
|
||||
if self.exists_locally_as_account():
|
||||
self.log(f'this account (@{self.name}) can be logged into')
|
||||
return self.login()
|
||||
|
||||
|
||||
elif self.exists_locally_as_contact():
|
||||
self.log(f'this account (@{self.name}) is a contact')
|
||||
return #pass #???
|
||||
|
||||
elif ping and self.exists_on_server():
|
||||
self.log(f'this account exists on server. introduce?')
|
||||
return
|
||||
|
||||
elif create:
|
||||
self.log('account is free: register?')
|
||||
return self.register()
|
||||
|
||||
|
||||
|
||||
def exists_locally_as_contact(self):
|
||||
return self.pubkey and not self.privkey
|
||||
|
||||
def exists_locally_as_Komrade(self):
|
||||
return self.pubkey and self.privkey
|
||||
def exists_locally_as_account(self):
|
||||
return self.pubkey and self.privkey_encr
|
||||
|
||||
def exists_on_server(self):
|
||||
answer = self.phone.ring_ring({
|
||||
|
@ -74,7 +74,7 @@ class Logger(object):
|
||||
|
||||
# try:
|
||||
if pause: do_pause()
|
||||
if pause: clear_screen()
|
||||
if clear: clear_screen()
|
||||
# except KeyboardInterrupt:
|
||||
# exit()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user