main.py
def code_maker_engine(self):
        '''
        Dealing with the main components of QR code making
        '''
        make_status_msg = "----- QR Code Maker -----"
        self.log_msg_entry(make_status_msg)

        file_names = self.maker_text_box.get()
        file_names = [file_name.strip() for file_name in file_names.split(",")]

        for file_path in file_names:
            # IF: The file path is a directory
            # Only accounts for files in the current folder, not subfolders
            if os.path.isdir(file_path):
                for file_name in os.listdir(file_path):
                    target_path = file_path + "/" + file_name
                    if os.path.isfile(target_path):
                        # print(file_path, file_name)
                        if not os.path.isdir(file_path + MAKER_TARGET_DIR):
                            os.mkdir(file_path + MAKER_TARGET_DIR)

                        qr_path = file_path + MAKER_TARGET_DIR + file_name
                        file_link = pyqrcode.create(target_path)
                        file_link.png(qr_path + ".png", scale=6)

                        make_status_msg = "[SUCCESS] " + target_path + ": QR code is generated."
                        self.log_msg_entry(make_status_msg)
            # ELSE: The file path is a file
            else:
                if not os.path.isfile(file_path):
                    make_status_msg = "[ERROR] " + file_path + ": File path not found."
                    self.log_msg_entry(make_status_msg)
                else:
                    # Making QR code for that particular file path
                    current_dir, file_name = file_path.rsplit("/", maxsplit=1)
                    # print(current_dir, file_name)
                    if not os.path.isdir(current_dir + MAKER_TARGET_DIR):
                        os.mkdir(current_dir + MAKER_TARGET_DIR)

                    qr_path = current_dir + MAKER_TARGET_DIR + file_name
                    file_link = pyqrcode.create(file_path)
                    file_link.png(qr_path + ".png", scale=6)

                    make_status_msg = "[SUCCESS] " + file_path + ": QR code is generated."
                    self.log_msg_entry(make_status_msg)

        Dealing with the main components of QR code making
        
Dealing with the main components of QR code making
Dealing with the main components of QR code making
def code_maker_engine(self):
        make_status_msg = "----- QR Code Maker -----"
        self.log_msg_entry(make_status_msg)
        file_names = self.maker_text_box.get()
        file_names = [file_name.strip() for file_name in file_names.split(",")]
        for file_path in file_names:
            if os.path.isdir(file_path):
                for file_name in os.listdir(file_path):
                    target_path = file_path + "/" + file_name
                    if os.path.isfile(target_path):
                        if not os.path.isdir(file_path + MAKER_TARGET_DIR):
                            os.mkdir(file_path + MAKER_TARGET_DIR)
                        qr_path = file_path + MAKER_TARGET_DIR + file_name
                        file_link = pyqrcode.create(target_path)
                        file_link.png(qr_path + ".png", scale=6)
                        make_status_msg = "[SUCCESS] " + target_path + ": QR code is generated."
                        self.log_msg_entry(make_status_msg)
            else:
                if not os.path.isfile(file_path):
                    make_status_msg = "[ERROR] " + file_path + ": File path not found."
                    self.log_msg_entry(make_status_msg)
                else:
                    current_dir, file_name = file_path.rsplit("/", maxsplit=1)
                    if not os.path.isdir(current_dir + MAKER_TARGET_DIR):
                        os.mkdir(current_dir + MAKER_TARGET_DIR)
                    qr_path = current_dir + MAKER_TARGET_DIR + file_name
                    file_link = pyqrcode.create(file_path)
                    file_link.png(qr_path + ".png", scale=6)
                    make_status_msg = "[SUCCESS] " + file_path + ": QR code is generated."
                    self.log_msg_entry(make_status_msg)
def code_maker_engine ( self ) : make_status_msg = "----- QR Code Maker -----" self . log_msg_entry ( make_status_msg ) file_names = self . maker_text_box . get ( ) file_names = [ file_name . strip ( ) for file_name in file_names . split ( "," ) ] for file_path in file_names : if os . path . isdir ( file_path ) : for file_name in os . listdir ( file_path ) : target_path = file_path + "/" + file_name if os . path . isfile ( target_path ) : if not os . path . isdir ( file_path + MAKER_TARGET_DIR ) : os . mkdir ( file_path + MAKER_TARGET_DIR ) qr_path = file_path + MAKER_TARGET_DIR + file_name file_link = pyqrcode . create ( target_path ) file_link . png ( qr_path + ".png" , scale = 6 ) make_status_msg = "[SUCCESS] " + target_path + ": QR code is generated." self . log_msg_entry ( make_status_msg ) else : if not os . path . isfile ( file_path ) : make_status_msg = "[ERROR] " + file_path + ": File path not found." self . log_msg_entry ( make_status_msg ) else : current_dir , file_name = file_path . rsplit ( "/" , maxsplit = 1 ) if not os . path . isdir ( current_dir + MAKER_TARGET_DIR ) : os . mkdir ( current_dir + MAKER_TARGET_DIR ) qr_path = current_dir + MAKER_TARGET_DIR + file_name file_link = pyqrcode . create ( file_path ) file_link . png ( qr_path + ".png" , scale = 6 ) make_status_msg = "[SUCCESS] " + file_path + ": QR code is generated." self . log_msg_entry ( make_status_msg )
Dealing with the main components of QR code making
Dealing with the main components of QR code making
'''
        Dealing with the main components of QR code making
        ''' # IF: The file path is a directory # Only accounts for files in the current folder, not subfolders # print(file_path, file_name) # ELSE: The file path is a file # Making QR code for that particular file path # print(current_dir, file_name)
self