• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hivesolutions / netius / #615433413

21 Dec 2023 01:14PM UTC coverage: 45.789%. First build
#615433413

Pull #37

travis-ci

Pull Request #37: feat: add src/netius/adapters to typing

7600 of 16598 relevant lines covered (45.79%)

1.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/netius/examples/http.py
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3

4
# Hive Netius System
5
# Copyright (c) 2008-2024 Hive Solutions Lda.
6
#
7
# This file is part of Hive Netius System.
8
#
9
# Hive Netius System is free software: you can redistribute it and/or modify
10
# it under the terms of the Apache License as published by the Apache
11
# Foundation, either version 2.0 of the License, or (at your option) any
12
# later version.
13
#
14
# Hive Netius System is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# Apache License for more details.
18
#
19
# You should have received a copy of the Apache License along with
20
# Hive Netius System. If not, see <http://www.apache.org/licenses/>.
21

22
__author__ = "João Magalhães <joamag@hive.pt>"
×
23
""" The author(s) of the module """
24

25
__copyright__ = "Copyright (c) 2008-2024 Hive Solutions Lda."
×
26
""" The copyright for the module """
27

28
__license__ = "Apache License, Version 2.0"
×
29
""" The license for the module """
30

31
import netius.clients
×
32

33

34
def http_static():
×
35
    request = netius.clients.HTTPClient.get_s(
36
        "https://www.flickr.com/", asynchronous=False
37
    )
×
38
    print(request["data"])
39

40

×
41
def http_callback():
42
    def callback(protocol, parser, request):
×
43
        print(request["data"])
×
44
        protocol.close()
45

46
    def on_close(protocol):
47
        netius.compat_loop(loop).stop()
×
48

49
    client = netius.clients.HTTPClient()
×
50
    loop, _ = client.get(
×
51
        "https://www.flickr.com/", on_result=callback, on_close=on_close
×
52
    )
×
53
    loop.run_forever()
×
54
    loop.close()
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc