Do not prompt for credentials when they appear in file account.toml.

This commit is contained in:
Schimon Jehudah, Adv. 2024-07-30 10:02:27 +03:00
parent 61c49c678a
commit 9e051fa0a6
4 changed files with 20 additions and 6 deletions

View file

@ -40,13 +40,13 @@ def main():
logging.basicConfig(level=args.loglevel, logging.basicConfig(level=args.loglevel,
format='%(levelname)-8s %(message)s') format='%(levelname)-8s %(message)s')
if args.jid is None:
args.jid = input("Username: ")
if args.password is None:
args.password = getpass("Password: ")
account_xmpp = Config.get_values('accounts.toml', 'xmpp') account_xmpp = Config.get_values('accounts.toml', 'xmpp')
if args.jid is None and not account_xmpp['client']['jid']:
args.jid = input("Username: ")
if args.password is None and not account_xmpp['client']['password']:
args.password = getpass("Password: ")
# Try configuration file # Try configuration file
if 'client' in account_xmpp: if 'client' in account_xmpp:
jid = account_xmpp['client']['jid'] jid = account_xmpp['client']['jid']

View file

@ -96,7 +96,7 @@ fits best to you.
[[friends]] [[friends]]
name = "sid an xmpp bot" name = "sid an xmpp bot"
info = [""" info = ["""
The ultimate XMPP bot! Some of its features include A moderation, syndication and issue tracker bot.
RTBL RTBL
Real Time Block List which would download a hash list of blacklisted JIDs, and \ Real Time Block List which would download a hash list of blacklisted JIDs, and \

6
kaikout/assets/rtbl.toml Normal file
View file

@ -0,0 +1,6 @@
# This file lists default RTBL sources per database.
# See file /usr/share/kaikout/rtbl.toml
[[node]]
jabber_id = "xmppbl.org"
node_name = "muc_bans_sha256"

View file

@ -477,6 +477,14 @@ class XmppClient(slixmpp.ClientXMPP):
""" """
# self.command_list() # self.command_list()
# await self.get_roster() # await self.get_roster()
subscriptions_of_node = await self['xep_0060'].get_node_subscriptions("xmppbl.org", "muc_bans_sha256")
print()
print('=== subscriptions_of_node ===')
print()
print(subscriptions_of_node)
print()
print('=== subscriptions_of_node ===')
print()
await self['xep_0115'].update_caps() await self['xep_0115'].update_caps()
bookmarks = await XmppBookmark.get_bookmarks(self) bookmarks = await XmppBookmark.get_bookmarks(self)
print(bookmarks) print(bookmarks)