From 0d0dd6d35966532fc696380f999621100b00b3b9 Mon Sep 17 00:00:00 2001 From: missytake Date: Wed, 9 Apr 2025 12:24:29 +0200 Subject: [PATCH 1/2] feat: allow setting displayname + selfavatar via CLI --- .../src/deltachat_rpc_client/_utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py b/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py index bfbcfc70e9..1cedccdd69 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py @@ -92,6 +92,12 @@ def _run_cli( ) parser.add_argument("--email", action="store", help="email address", default=os.getenv("DELTACHAT_EMAIL")) parser.add_argument("--password", action="store", help="password", default=os.getenv("DELTACHAT_PASSWORD")) + parser.add_argument( + "--displayname", action="store", help="the profile's display name", default=os.getenv("DELTACHAT_DISPLAYNAME") + ) + parser.add_argument( + "--avatar", action="store", help="filename of the profile's avatar", default=os.getenv("DELTACHAT_AVATAR") + ) args = parser.parse_args(argv[1:]) with Rpc(accounts_dir=args.accounts_dir, **kwargs) as rpc: @@ -108,7 +114,12 @@ def _run_cli( configure_thread = Thread( target=client.configure, daemon=True, - kwargs={"email": args.email, "password": args.password}, + kwargs={ + "email": args.email, + "password": args.password, + "displayname": args.displayname, + "selfavatar": args.avatar, + }, ) configure_thread.start() client.run_forever() From 8d2615423499bb226a1583eaf365f3f9f56fcd8f Mon Sep 17 00:00:00 2001 From: missytake Date: Wed, 9 Apr 2025 14:51:04 +0200 Subject: [PATCH 2/2] fix ruff --- deltachat-rpc-client/src/deltachat_rpc_client/_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py b/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py index 1cedccdd69..ee07569eae 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/_utils.py @@ -93,10 +93,10 @@ def _run_cli( parser.add_argument("--email", action="store", help="email address", default=os.getenv("DELTACHAT_EMAIL")) parser.add_argument("--password", action="store", help="password", default=os.getenv("DELTACHAT_PASSWORD")) parser.add_argument( - "--displayname", action="store", help="the profile's display name", default=os.getenv("DELTACHAT_DISPLAYNAME") + "--displayname", action="store", help="the profile's display name", default=os.getenv("DELTACHAT_DISPLAYNAME"), ) parser.add_argument( - "--avatar", action="store", help="filename of the profile's avatar", default=os.getenv("DELTACHAT_AVATAR") + "--avatar", action="store", help="filename of the profile's avatar", default=os.getenv("DELTACHAT_AVATAR"), ) args = parser.parse_args(argv[1:])