mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
PEP8-ify.
Wrap to 80 chars, sanitize imports.
This commit is contained in:
parent
df25dec30a
commit
6cde7fd27a
8 changed files with 142 additions and 110 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# From django.core.paginator
|
||||
from math import ceil
|
||||
|
||||
|
||||
class Paginator(object):
|
||||
def __init__(self, object_list, per_page, orphans=0):
|
||||
self.object_list = object_list
|
||||
|
|
@ -39,6 +40,7 @@ class Paginator(object):
|
|||
return range(1, self.num_pages + 1)
|
||||
page_range = property(_get_page_range)
|
||||
|
||||
|
||||
class Page(object):
|
||||
def __init__(self, object_list, number, paginator):
|
||||
self.object_list = object_list
|
||||
|
|
@ -82,4 +84,3 @@ class Page(object):
|
|||
if self.number == self.paginator.num_pages:
|
||||
return self.paginator.count
|
||||
return self.number * self.paginator.per_page
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue