Skip to content

Commit

Permalink
Changed some http:// links to https://
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Apr 22, 2024
1 parent c8a1e66 commit 1ff0c9b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions docs/tutorials/webnotifier.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ end, you need to set up an asynchronous HTTP client using the httpx_ library::
async def run(self) -> None:
async with httpx.AsyncClient() as http:
while True:
async with http.get("http://imgur.com") as resp:
async with http.get("https://imgur.com") as resp:
await resp.text()

await anyio.sleep(10)

if __name__ == "__main__":
run_application(ApplicationComponent(), logging=logging.DEBUG)

Great, so now the code fetches the contents of ``http://imgur.com`` at 10 second
Great, so now the code fetches the contents of ``https://imgur.com`` at 10 second
intervals. But this isn't very useful yet – you need something that compares the old and
new versions of the contents somehow. Furthermore, constantly loading the contents of a
page exerts unnecessary strain on the hosting provider. We want our application to be as
Expand All @@ -79,7 +79,7 @@ So, modify the code as follows::
headers: dict[str, Any] = (
{"if-modified-since": last_modified} if last_modified else {}
)
async with http.get("http://imgur.com", headers=headers) as resp:
async with http.get("https://imgur.com", headers=headers) as resp:
logger.debug("Response status: %d", resp.status)
if resp.status == 200:
last_modified = resp.headers["date"]
Expand Down Expand Up @@ -116,7 +116,7 @@ to the logger::
headers: dict[str, Any] = (
{"if-modified-since": last_modified} if last_modified else {}
)
async with http.get("http://imgur.com", headers=headers) as resp:
async with http.get("https://imgur.com", headers=headers) as resp:
logger.debug("Response status: %d", resp.status)
if resp.status == 200:
last_modified = resp.headers["date"]
Expand Down Expand Up @@ -178,7 +178,7 @@ And to make the the results look nicer in an email message, you can switch to us
headers: dict[str, Any] = (
{"if-modified-since": last_modified} if last_modified else {}
)
async with http.get("http://imgur.com", headers=headers) as resp:
async with http.get("https://imgur.com", headers=headers) as resp:
logger.debug("Response status: %d", resp.status)
if resp.status == 200:
last_modified = resp.headers["date"]
Expand Down Expand Up @@ -307,7 +307,7 @@ Now that you've moved the change detection code to its own module,

class ApplicationComponent(CLIApplicationComponent):
async def start(self) -> None:
self.add_component("detector", ChangeDetectorComponent, url="http://imgur.com")
self.add_component("detector", ChangeDetectorComponent, url="https://imgur.com")
self.add_component(
"mailer", backend="smtp", host="your.smtp.server.here",
message_defaults={"sender": "[email protected]", "to": "[email protected]"})
Expand Down Expand Up @@ -362,7 +362,7 @@ following contents:
type: !!python/name:webnotifier.app.ApplicationComponent
components:
detector:
url: http://imgur.com/
url: https://imgur.com/
delay: 15
mailer:
host: your.smtp.server.here
Expand Down Expand Up @@ -422,7 +422,7 @@ On Windows:
The ``if __name__ == '__main__':`` block is no longer needed since ``asphalt run``
is now used as the entry point for the application.

.. _YAML: http://yaml.org/
.. _YAML: https://yaml.org/
.. _properly packaged: https://packaging.python.org/

Conclusion
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ so the config file only needs to override settings where necessary.
The following chapters describe in detail how each of these building blocks work.

.. _Qt: https://www.qt.io/
.. _YAML: http://yaml.org/
.. _YAML: https://yaml.org/
4 changes: 2 additions & 2 deletions docs/userguide/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployments that all need their own custom configuration.
For this purpose, Asphalt provides a command line interface that will read a YAML_ formatted
configuration file and run the application it describes.

.. _YAML: http://yaml.org/
.. _YAML: https://yaml.org/

Running the Asphalt launcher
----------------------------
Expand Down Expand Up @@ -266,4 +266,4 @@ Add the following piece to your application's configuration:
backend_options:
use_uvloop: true
.. _uvloop: http://magic.io/blog/uvloop-make-python-networking-great-again/
.. _uvloop: https://magic.io/blog/uvloop-make-python-networking-great-again/
2 changes: 1 addition & 1 deletion docs/userguide/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To run the test suite, make sure you're in the project directory and then do:
For more elaborate examples, please see the test suites of various
`Asphalt subprojects`_.

.. _pytest: http://pytest.org/
.. _pytest: https://pytest.org/
.. _AnyIO's pytest plugin: https://anyio.readthedocs.io/en/stable/testing.html
.. _capsys: https://docs.pytest.org/en/stable/how-to/capture-stdout-stderr.html\
#accessing-captured-output-from-a-test-function
Expand Down
2 changes: 1 addition & 1 deletion docs/versionhistory.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Version history
===============

This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
This library adheres to `Semantic Versioning 2.0 <https://semver.org/>`_.

**UNRELEASED**

Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial2/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
type: webnotifier.app:ApplicationComponent
components:
detector:
url: http://imgur.com/
url: https://imgur.com/
delay: 15
mailer:
host: your.smtp.server.here
Expand Down

0 comments on commit 1ff0c9b

Please sign in to comment.