This provides a crude means of managing multiple accounts. At the
moment my only use case for this is logging in to a test server so
that I can test the fine points of posting without making a fool of
myself on the live fediverse. So I don't need to run the accounts in
parallel in a user-friendly way, and I can easily just pass a weird
command-line option when I'm doing testing.
import os
import xdg
+override_config_dir = None
def config_dir():
+ if override_config_dir is not None:
+ return override_config_dir
try:
config_home = xdg.XDG_CONFIG_HOME
except AttributeError:
"HTTP retrievals.")
parser.add_argument("--login", action="store_const", dest="action",
const=login.LoginUI, help="Log in to a user account.")
+ parser.add_argument("--config", help="Alternative config directory.")
parser.set_defaults(action=cursesclient.CursesUI)
args = parser.parse_args()
+ login.override_config_dir = args.config
+
if args.test is not None:
return unittest.main(argv=[sys.argv[0]] + args.test,
testLoader=MyTestLoader())