From 9449af56cfca81c8229c101a4fca751c4e8d1a90 Mon Sep 17 00:00:00 2001 From: jimeng999 <122824316+jimeng999@users.noreply.github.com> Date: Mon, 6 Jul 2026 19:30:57 +0800 Subject: [PATCH 1/2] feat: Save/Create Account functionality (#11) --- save_account.py | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 save_account.py diff --git a/save_account.py b/save_account.py new file mode 100644 index 0000000..b2a323e --- /dev/null +++ b/save_account.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +""" +Account save/create functionality for inlinegui. +Supports saving user info (Name, Email) from Mozilla Persona +or collecting via a simple form. +""" +import json +import os +from datetime import datetime + +DATA_FILE = os.environ.get('INLINEGUI_DATA', 'accounts.json') + +def load_accounts(): + """Load accounts from JSON file.""" + if os.path.exists(DATA_FILE): + with open(DATA_FILE, 'r') as f: + return json.load(f) + return {} + +def save_accounts(accounts): + """Save accounts to JSON file.""" + with open(DATA_FILE, 'w') as f: + json.dump(accounts, f, indent=2) + +def save_user_info(name, email): + """Save user info from Mozilla Persona or similar auth.""" + accounts = load_accounts() + if email in accounts: + accounts[email]['name'] = name + accounts[email]['updated_at'] = datetime.utcnow().isoformat() + else: + accounts[email] = { + 'name': name, + 'email': email, + 'created_at': datetime.utcnow().isoformat() + } + save_accounts(accounts) + return accounts[email] + +def get_create_account_html(): + """Return HTML for a simple account creation form (Stripe-inspired minimal style).""" + return """ + + + + + Create Account - InlineGUI + + + +
+

Create your account

+

Get started with InlineGUI

+
+ + + +
+
+ +""" + +if __name__ == '__main__': + print("Account save/create module loaded.") + print(f"Data file: {DATA_FILE}") From d02ce4a3f3b8c7018323887c3e4126cff8258f29 Mon Sep 17 00:00:00 2001 From: jimeng999 <122824316+jimeng999@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:45:25 +0800 Subject: [PATCH 2/2] feat: Save/Create Account functionality (#11)