File tree Expand file tree Collapse file tree 5 files changed +12
-6
lines changed
gallery/examples/interest_calculator Expand file tree Collapse file tree 5 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ channels:
33- conda-forge
44- microsoft
55dependencies :
6- - python=3.9
6+ - python=3.10
77- pip=20.2.2
88- pytest=7
99- nodejs=16
Original file line number Diff line number Diff line change 11"""Provide a web server to browse the examples."""
22import contextlib
3+ from collections .abc import Iterator
34from pathlib import PurePath
45from typing import AsyncContextManager
5- from typing import Iterator
66
77from starlette .applications import Starlette
88from starlette .requests import Request
Original file line number Diff line number Diff line change 22from __future__ import annotations
33
44import builtins
5+ from collections .abc import Callable
6+ from collections .abc import Generator
57from dataclasses import dataclass
68from dataclasses import field
79from mimetypes import guess_type
8- from typing import Callable
9- from typing import Generator
1010from urllib .parse import urlparse
1111
1212import pytest
@@ -199,23 +199,28 @@ def fake_document() -> FakeDocument:
199199
200200@dataclass
201201class ElementNode :
202+ """An element node."""
203+
202204 value : str
203205 document : FakeDocument
204206
205207 def write (self , value : str ) -> None :
206208 """Collect anything that is written to the node."""
207209 self .document .log .append (value )
208210
209- def removeAttribute (self , name ) -> None :
211+ def removeAttribute (self , name ) -> None : # noqa
210212 """Pretend to remove an attribute from this node."""
211213 pass
212214
213215
214216@dataclass
215217class ElementCallable :
218+ """A callable that returns an ElementNode."""
219+
216220 document : FakeDocument
217221
218222 def __call__ (self , key : str ) -> ElementNode :
223+ """Return an ElementNode."""
219224 value = self .document .values [key ]
220225 node = ElementNode (value , self .document )
221226 return node
Original file line number Diff line number Diff line change 11def interest (* args , ** kwargs ):
2+ """Main interest calculation function."""
23 # Signal that PyScript is alive by setting the ``Calculate``
34 # button away from disabled.
45 calculate_button = Element ("calc" ) # noqa
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ def test_html_page() -> None:
9090 """Make an instance of a .html Page resource and test it."""
9191 this_page = Page (path = PurePath ("contributing" ))
9292 assert this_page .title == "Contributing"
93- assert this_page .subtitle == "How to get involved in the PyCharm Collective."
93+ assert this_page .subtitle == "How to get involved in the PyScript Collective."
9494 assert 'id="viewer"' in this_page .body
9595
9696
You can’t perform that action at this time.
0 commit comments