geotribu_cli.comments.comments_latest module#

geotribu_cli.comments.comments_latest.format_output_result(results, format_type=None, count=5)#

Format result according to output option.

Paramètres:
  • results (list[Comment]) – result to format

  • format_type (str) – format output option. Defaults to None.

  • count (int) – default number of results to display. Defaults to 5.

Type renvoyé:

str

Renvoie:

formatted result ready to print

geotribu_cli.comments.comments_latest.get_latest_comments(number=5, sort_by='created_asc', expiration_rotating_hours=1)#

Download and parse latest comments published.

Paramètres:
  • number (int) – count of comments to download. Must be > 1. Defaults to 5.

  • sort_by (Literal['author_asc', 'author_desc', 'created_asc', 'created_desc']) – comments sorting criteria. Defaults to « created_asc ».

  • expiration_rotating_hours (int, optional) – number in hours to consider the local file outdated. Defaults to 1.

Type renvoyé:

list[Comment]

Renvoie:

list of comments objects

geotribu_cli.comments.comments_latest.parser_comments_latest(subparser)#

Set the argument parser for subcommand.

Paramètres:

subparser (argparse.ArgumentParser) – parser to set up

Renvoie:

parser ready to use

Type renvoyé:

argparse.ArgumentParser

geotribu_cli.comments.comments_latest.run(args)#

Run the sub command logic.

Open result of a previous command.

Paramètres:

args (argparse.Namespace) – arguments passed to the subcommand