tcurl_login

Credential collection using Urwid with password masking Equivalent to dialog –form but with modern curses features Colors match the classic dialog blue theme

Module Contents

Classes

FormPile

Pile that treats Enter like Tab on edit fields.

CredentialForm

Urwid form for collecting credentials with masking

Functions

get_credentials

Show credential form and return results

parser_factory

Create and configure the command-line argument parser.

main

Data

VERSION

PALETTE

API

tcurl_login.VERSION

‘2026.05-DEV’

class tcurl_login.FormPile

Bases: urwid.Pile

Pile that treats Enter like Tab on edit fields.

keypress(size, key)
_focus_is_edit()

Check if the current focus chain ends at an Edit widget.

tcurl_login.PALETTE

[(‘body’, ‘white’, ‘light blue’), (‘title’, ‘white’, ‘light blue’, ‘bold’), (‘prompt’, ‘yellow’, ‘li…

class tcurl_login.CredentialForm(defaults: dict[str, str] | None = None)

Urwid form for collecting credentials with masking

Initialization

_on_otp_change(widget: urwid.Edit, old_text: str) None

Strip non-digit characters and show a status message

on_submit(button: urwid.Button) None

Handle form submission

on_cancel(button: urwid.Button) None

Handle form cancellation

run() dict | None

Run the form and return credentials

_handle_escape() bool

Clear the current edit field or focus the Cancel button.

tcurl_login.get_credentials(defaults: dict[str, str] | None = None) dict[str, str] | None

Show credential form and return results

Returns: Dictionary with ‘username’, ‘password’, ‘domain’, ‘otp’ keys, or None if cancelled

tcurl_login.parser_factory(color: bool = False) argparse.ArgumentParser

Create and configure the command-line argument parser.

Returns:

Configured argument parser

tcurl_login.main()