Skip to content

Commit

Permalink
Issue 3 | Widget (#70)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: IceKhan13 <[email protected]>
Co-authored-by: Iskandar Sitdikov <[email protected]>
Co-authored-by: Michaël <[email protected]>
  • Loading branch information
4 people authored Jun 19, 2023
1 parent 1061fa7 commit 1eb711c
Show file tree
Hide file tree
Showing 9 changed files with 643 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ max-bool-expr=5
max-branches=13

# Maximum number of locals for function / method body.
max-locals=15
max-locals=25

# Maximum number of parents for a class (see R0901).
max-parents=11
Expand Down
1 change: 1 addition & 0 deletions client/purplecaffeine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
"""

from .core import Trial, LocalStorage, ApiStorage, BaseStorage
from .widget import Widget
3 changes: 2 additions & 1 deletion client/purplecaffeine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ def list(
limit = limit or 10

trials_path = glob.glob(f"{self.path}/**.json")
trials_path.sort(key=os.path.getmtime, reverse=True)
trials = []
for path in trials_path:
with open(path, "r", encoding="utf-8") as trial_file:
Expand All @@ -525,7 +526,7 @@ def list(
or (trial.description.find(query) != -1)
]

trials = trials[offset:limit]
trials = trials[offset : offset + limit]
return trials


Expand Down
Loading

0 comments on commit 1eb711c

Please sign in to comment.