Coverage for gws-app/gws/plugin/account/cli.py: 0%

17 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-16 22:59 +0200

1from typing import Optional, cast 

2 

3import gws 

4import gws.config 

5 

6from . import helper 

7 

8class AccountResetParams(gws.CliParams): 

9 uid: Optional[list[str]] 

10 """List of account IDs to reset.""" 

11 

12 

13 

14 

15class Object(gws.Node): 

16 @gws.ext.command.cli('accountReset') 

17 def account_reset(self, p: AccountResetParams): 

18 """Reset an account or multiple accounts.""" 

19 

20 root = gws.config.load() 

21 h = cast(helper.Object, root.app.helper('account')) 

22 

23 for uid in p.uid: 

24 account = h.get_account_by_id(uid) 

25 if not account: 

26 continue 

27 h.reset(account) 

28 

29 

30 

31 ## 

32