kojismokydingo.cli.users

Koji Smoky Dingo - CLI User Commands

author:

Christopher O'Brien <obriencj@gmail.com>

license:

GPL v3

class ShowCGInfo(name=None)[source]

Bases: AnonSmokyDingo

Parameters:

name (str) -- The name that this command is being represented as

arguments(parser)[source]

Override to add relevant arguments to the given parser instance. May return an alternative parser instance or None.

Parameters:

parser -- the parser to decorate with additional arguments

description: str = 'List content generators and their users'

Short description of this command, for use in the help output

handle(options)[source]

Perform the full set of actions for this command.

class ShowPermissionInfo(name=None)[source]

Bases: AnonSmokyDingo

Parameters:

name (str) -- The name that this command is being represented as

arguments(parser)[source]

Override to add relevant arguments to the given parser instance. May return an alternative parser instance or None.

Parameters:

parser -- the parser to decorate with additional arguments

description: str = 'Show information about a permission'

Short description of this command, for use in the help output

handle(options)[source]

Perform the full set of actions for this command.

class ShowUserInfo(name=None)[source]

Bases: AnonSmokyDingo

Parameters:

name (str) -- The name that this command is being represented as

arguments(parser)[source]

Override to add relevant arguments to the given parser instance. May return an alternative parser instance or None.

Parameters:

parser -- the parser to decorate with additional arguments

description: str = 'Show information about a user or group'

Short description of this command, for use in the help output

group: str = 'info'

The koji CLI group that this command will be displayed under in the help output

handle(options)[source]

Perform the full set of actions for this command.

cli_cginfo(session, name=None, json=False)[source]

Implements the koji cginfo command

Parameters:
  • session (ClientSession) -- an active koji client session

  • name (str | None) -- only display information about the content generator with this name

  • json (bool) -- output the data as JSON

Since:

1.0

cli_perminfo(session, permission, verbose=False, by_date=False, json=False)[source]

Implements the koji perminfo command

Parameters:
  • session (ClientSession) -- an active koji client session

  • permission (str) -- the permission name to display information about

  • verbose (bool) -- also display who granted the permission and when

  • by_date (bool) -- sort the user list by the date they were granted the permission

  • json (bool) -- output the data as JSON

Since:

1.0

cli_userinfo(session, user, stats=False, json=False)[source]

Implements the koji userinfo command

Parameters:
  • session (ClientSession) -- an active koji client session

  • user (int | str | UserInfo) -- user specification to output information about

  • stats (bool) -- include simple user stats

  • json (bool) -- produce JSON output

Raises:

NoSuchUser -- if the user specification doesn't correlate to a known user

Since:

1.0

get_userauth_str(userinfo)[source]

Provide a human-readable label for the koji auth type enum value in a koji user info dict. Returns None if the auth

Parameters:

userinfo (UserInfo) -- user info

Since:

2.0

Return type:

str | None

get_userstatus_str(userinfo)[source]

Provide a human-readable label for the koji user status enum value in a koji user info dict.

Parameters:

userinfo (UserInfo) -- user info

Since:

1.0

Return type:

str

get_usertype_str(userinfo)[source]

Provide a human-readable label for the koji user type enum value in a koji user info dict.

Parameters:

userinfo (UserInfo) -- user info

Since:

1.0

Return type:

str