RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
QrDetection.py
Go to the documentation of this file.
1 from RappCloud.Objects import (
2  File,
3  Payload)
4 
5 from Cloud import (
6  CloudMsg,
7  CloudRequest,
8  CloudResponse)
9 
10 
11 class QrDetection(CloudMsg):
12  """ Qr Detection Cloud Message object"""
13 
14  class Request(CloudRequest):
15  """ Qr Detection Cloud Request object. QrDetection.Request """
16  def __init__(self, **kwargs):
17  """!
18  Constructor
19 
20  @param **kwargs - Keyword arguments. Apply values to the request attributes.
21  - @ref imageFilepath
22  """
23  ## File path to the image to load. This is the image to perform
24  # qr-detection on.
25  self.imageFilepath = ''
26  super(QrDetection.Request, self).__init__(**kwargs)
27 
28 
29  def make_payload(self):
30  """ Create and return the Payload of the Request. """
31  return Payload()
32 
33  def make_files(self):
34  """ Create and return Array of File objects of the Request. """
35  return [File(self.imageFilepath, postfield='file')]
36 
37 
38  class Response(CloudResponse):
39  """ Qr Detection Cloud Response object. QrDetection.Response """
40  def __init__(self, **kwargs):
41  """!
42  Constructor
43 
44  @param **kwargs - Keyword arguments. Apply values to the request attributes.
45  - @ref error
46  - @ref qr_centers
47  - @ref qr_messages
48  """
49 
50  ## Error message
51  self.error = ''
52  ## Found qr centers. Array of qr_center objects.
53  # TODO Create qr_center objects
54  self.qr_centers = []
55  ## Found qr messages. Array of strings.
56  self.qr_messages = []
57  super(QrDetection.Response, self).__init__(**kwargs)
58 
59 
60  def __init__(self, **kwargs):
61  """!
62  Constructor
63 
64  @param **kwargs - Keyword arguments. Apply values to the request attributes.
65  - @ref Request.imageFilepath
66  """
67 
68  # Create and hold the Request object for this CloudMsg
70  # Create and hold the Response object for this CloudMsg
72  super(QrDetection, self).__init__(svcname='qr_detection', **kwargs)
73 
74 
imageFilepath
File path to the image to load.
Definition: QrDetection.py:25