fix: update output() signature with format and title parameters, fix Config import in dual_mode_wallet_adapter
Some checks failed
CLI Tests / test-cli (push) Failing after 3s
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m20s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Security Scanning / security-scan (push) Successful in 35s
Some checks failed
CLI Tests / test-cli (push) Failing after 3s
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m20s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Security Scanning / security-scan (push) Successful in 35s
- Added format and title parameters to output() function in utils/__init__.py - Handle format='json'/'yaml' for structured data output - Display optional title with underline separator when provided - Fixed import in dual_mode_wallet_adapter.py from config.Config to aitbc_cli.config.CLIConfig
This commit is contained in:
@@ -16,11 +16,18 @@ from .wallet import decrypt_private_key
|
||||
from .blockchain import get_chain_info, get_network_status, get_blockchain_analytics
|
||||
|
||||
|
||||
def output(message, **kwargs):
|
||||
def output(message, format=None, title=None, **kwargs):
|
||||
"""Print a regular output message (handles strings and structured data)"""
|
||||
if not isinstance(message, str):
|
||||
import json
|
||||
if format == 'json' or format == 'yaml':
|
||||
message = json.dumps(message, indent=2)
|
||||
else:
|
||||
# Table format — just JSON for now
|
||||
message = json.dumps(message, indent=2)
|
||||
if title:
|
||||
echo(f"\n{title}")
|
||||
echo("=" * len(title))
|
||||
echo(message, **kwargs)
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from datetime import datetime
|
||||
|
||||
sys.path.insert(0, "/opt/aitbc/cli")
|
||||
from utils.wallet_daemon_client import WalletDaemonClient, WalletInfo, WalletBalance, ChainInfo, WalletMigrationResult
|
||||
from config import Config
|
||||
from aitbc_cli.config import CLIConfig as Config
|
||||
from utils import error, success, output
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user