widgetastic_patternfly4.pagination module

class widgetastic_patternfly4.pagination.BaseCompactPagination

Bases: object

current_page

Calculate the current page we are on.

Compact pagination does not explicitly show this, so use some math.

For example, if “per page” is set to ‘20’, we know that a page displaying items:
1-20 is on 20/20 = page 1 21-40 is on page 40/20 = page 2 41-60 is on page 60/20 = page 3

and so on.

first_page()
is_first_disabled

Compact paginator has no ‘first’ button.

is_last_disabled

Compact paginator has no ‘last’ button.

last_page()

Compact paginator has no “last” button, so iterates until last is reached.

total_pages

Calculate total page count.

Compact pagination does not explicitily show the page count, so use some math.

class widgetastic_patternfly4.pagination.BasePagination

Bases: object

Represents the Patternfly pagination.

https://www.patternfly.org/v4/documentation/react/components/pagination

DEFAULT_LOCATOR = ".//div[contains(@class, 'pf-c-pagination') and not(contains(@class, 'pf-m-compact'))]"
cache_per_page_value()

A context manager that can be used to prevent looking up the ‘current page’ value.

This adds some efficiencies when iterating over pages or in cases where it is safe to assume that the “per page” setting is not going to change and it’s not necessary to re-read it from the browser repeatedly.

cached_per_page_value
current_page

Returns an int of the current page number.

current_per_page

Returns an integer detailing how many items are shown per page.

displayed_items

Returns a string detailing the number of displayed items information.

example “1 - 20 of 523 items”

first_page()

Clicks on the first page button.

go_to_page(value)

Navigate to custom page number.

is_first_disabled

Returns boolean detailing if the first page button is disabled.

is_last_disabled

Returns boolean detailing if the last page button is disabled.

is_next_disabled

Returns boolean detailing if the next page button is disabled.

is_previous_disabled

Returns boolean detailing if the previous page button is disabled.

last_page()

Clicks the last page button.

next_page()

Clicks the next page button.

no_items

Returns wether the pagination object has elements or not

per_page_options

Returns an iterable of the available pagination options.

previous_page()

Clicks the previous page button.

set_per_page(count)

Sets the number of items per page. (Will cast to str)

total_items

Returns a string detailing the number of displayed items

total_pages

Returns int detailing the total number of pages.

class widgetastic_patternfly4.pagination.CompactPagination(parent, locator=None, logger=None)

Bases: widgetastic_patternfly4.pagination.BaseCompactPagination, widgetastic_patternfly4.pagination.Pagination

DEFAULT_LOCATOR = ".//div[contains(@class, 'pf-c-pagination') and contains(@class, 'pf-m-compact')]"
class widgetastic_patternfly4.pagination.Pagination(parent, locator=None, logger=None)

Bases: widgetastic_patternfly4.pagination.BasePagination, widgetastic.widget.base.View

ROOT

ParametrizedString modified to return instances of smartloc.Locator

exception widgetastic_patternfly4.pagination.PaginationNavDisabled

Bases: Exception