File: test_qt.py

package info (click to toggle)
libcharon 5.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 576 kB
  • sloc: python: 1,575; sh: 388; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (3)
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
import sys

from PyQt5.QtCore import QCoreApplication, QTimer

import Charon.Client

if len(sys.argv) != 2:
    print("Usage: test.py [file]")
    exit(1)

app = QCoreApplication(sys.argv)

request = Charon.Client.Request(sys.argv[1], ["/Metadata/thumbnail.png"])
request.start()

while(request.state == Charon.Client.Request.State.Running):
    app.processEvents()

if request.state == Charon.Client.Request.State.Completed:
    print("Request Complete")
    print(request.data)
elif request.state == Charon.Client.Request.State.Error:
    print("Request Error")
    print(request.errorString)
else:
    print("Request did not finish properly")
    print(request.state)