Python Forum
What does non-existent method start mean?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What does non-existent method start mean?
#1
I am new and hadn't write any python program before. Now, I was assigned to take over a finished program. I found codes in main.py as:
#!/usr/bin/python3
from qr_validator import QRValidator

def main():

    app = QRValidator()
    app.start()

if __name__ == "__main__":
    main()
The code snippet in qr_validator.py is:
import threading
from modules.pydispatch import dispatcher
from modules.mitac.socket_broker import SocketBroker as BROKER
from modules.mitac.application import Application
from sc_client import SCClient
from modules.mitac.reader.qr_reader import QRReader

class QRData():
    val = None
    
    @classmethod
    def is_valid(cls, data):
        return data == b'{ACK}\x00'
    .....

class QRValidator(Application):
    
    SIGNAL_QR_CODE_ENTER = "QR_Code_Enter"
    
    def gen_broker_message(self, msg_type, message):
        jmessage = self._gen_post_jmessage(msg_type, message)
        message = self._gen_post_message(msg_type, jmessage)
        return message
    def handle_message(self, sender, signal, message):
      ....
I didn't find 'start' method at qr_validator.py. So, my questions are:
1) how come start appears in main.py / app.start
2) Why is classmethod in QRData appendix with a '@'?
Reply
#2
How can I edit it? Thanks.
Reply
#3
'start' is a method of base class of QRValidator, Application. That's my mistake. Sorry.
Reply
#4
Thanks for coming back with the answer :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What's the difference b/w assigning start=None and start=" " Madara 1 2,276 Aug-06-2018, 08:23 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020