Skip to content

Commit d3f3eea

Browse files
author
SD4RK
committed
Update docs copyright & example code, add readthedocs configuration.
1 parent f1ae3aa commit d3f3eea

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.readthedocs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.12"
7+
8+
sphinx:
9+
configuration: docs/source/conf.py

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# -- Project information -----------------------------------------------------
2020

2121
project = 'epicstore_api'
22-
copyright = '2023, SD4RK'
22+
copyright = '2024, SD4RK'
2323
author = 'SD4RK'
2424

2525

docs/source/intro.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ You can see other examples in ``examples/`` directory:
4040
from epicstore_api import EpicGamesStoreAPI, OfferData
4141
4242
api = EpicGamesStoreAPI()
43-
namespace, slug = list(api.get_product_mapping().items())[0]
43+
namespace, slug = next(iter(api.get_product_mapping().items()))
4444
first_product = api.get_product(slug)
45-
offers = []
46-
for page in first_product['pages']:
47-
if page.get('offer') is not None:
48-
offers.append(OfferData(page['namespace'], page['offer']['id']))
45+
offers = [
46+
OfferData(page['namespace'], page['offer']['id'])
47+
for page in first_product['pages']
48+
if page.get('offer') and 'id' in page['offer']
49+
]
4950
offers_data = api.get_offers_data(*offers)
5051
for offer_data in offers_data:
5152
data = offer_data['data']['Catalog']['catalogOffer']

0 commit comments

Comments
 (0)