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:
1) how come start appears in main.py / app.start
2) Why is classmethod in QRData appendix with a '@'?
#!/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 '@'?