(id, cmd, ignored)
| 94 | |
| 95 | # {acc} |
| 96 | def accMsg(id, cmd, ignored): |
| 97 | if cmd.uname: |
| 98 | cmd.scheme = 'basic' |
| 99 | if cmd.password == None: |
| 100 | cmd.password = '' |
| 101 | cmd.secret = str(cmd.uname) + ":" + str(cmd.password) |
| 102 | |
| 103 | if cmd.secret: |
| 104 | if cmd.scheme == None: |
| 105 | cmd.scheme = 'basic' |
| 106 | cmd.secret = cmd.secret.encode('utf-8') |
| 107 | else: |
| 108 | cmd.secret = b'' |
| 109 | |
| 110 | state = None |
| 111 | if cmd.suspend == 'true': |
| 112 | state = 'susp' |
| 113 | elif cmd.suspend == 'false': |
| 114 | state = 'ok' |
| 115 | |
| 116 | cmd.public = encode_to_bytes(makeTheCard(cmd.fn, cmd.note, cmd.photo)) |
| 117 | cmd.private = encode_to_bytes(cmd.private) |
| 118 | return pb.ClientMsg(acc=pb.ClientAcc(id=str(id), user_id=cmd.user, state=state, |
| 119 | scheme=cmd.scheme, secret=cmd.secret, login=cmd.do_login, tags=cmd.tags.split(",") if cmd.tags else None, |
| 120 | desc=pb.SetDesc(default_acs=pb.DefaultAcsMode(auth=cmd.auth, anon=cmd.anon), |
| 121 | public=cmd.public, private=cmd.private, trusted=encode_to_bytes(parse_trusted(cmd.trusted))), |
| 122 | cred=parse_cred(cmd.cred)), |
| 123 | extra=pack_extra(cmd)) |
| 124 | |
| 125 | |
| 126 | # {login} |
nothing calls this directly
no test coverage detected
searching dependent graphs…