-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.py
34 lines (28 loc) · 836 Bytes
/
api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (C) 2018 O.S. Systems Software LTDA.
"""
Example to describe methods available on the API.
"""
from __future__ import print_function
from updatehub.api import Api
def main():
"""
The execution of the program is simple: instantiate the API object and
access every method available to it, printing it's return to STDOUT. The
last method is the abort download to prevent any unwanted updates.
"""
api = Api()
print(api.get_info())
print("")
print(api.get_log())
print("")
print(api.probe())
print("")
print(api.probe("http://www.example.com:8080"))
print("")
print(api.abort_download())
print("")
print(api.local_install("/tmp/update.uhu"))
print("")
print(api.remote_install("https://foo.bar/update.uhu"))
if __name__ == '__main__':
main()