Chargement en cours README.md +15 −2 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff # objQRCode # objQRCode  **objQRCode** est un utilitaire pour créer des QRCode écrit en python. **objQRCode** est un utilitaire pour créer des QRCode écrit en python. C'est en fait une interface graphique pour **qrcode** (https://pypi.org/project/qrcode/) sous python. C'est en fait une interface graphique pour **qrcode** (https://pypi.org/project/qrcode/) sous python. L'application est en cours de développement. Toute les fonctions sont opérationnelles : - ouverture d'un QRCode au format PNG - décodage de l'image - codage au format PNG d'un texte, une url - codage d'un accès WIFI - choix des couleurs (points et fond) - taille du QRCode - épaisseur de la bordure - enregistrement de l'image au format PNG Il reste quelles petites améliorations à faire, tant fonctionnelles qu'esthétiques, voire quelques fonctions supplémentaires à ajouter. ## Paquets à installer : ## Paquets à installer : Chargement en cours Chargement en cours @@ -37,4 +51,3 @@ WIFI:T:*cryptage(nopass, WEP, WAPA)*;S:ssid;P:*motdepasse*;H:*caché(true)* ### qrcode - python ### qrcode - python - https://pypi.org/project/qrcode/ - https://pypi.org/project/qrcode/ images/objQRCode-01.png 0 → 100644 +65,7 ko Chargement de la diff d'image… images/objQRCode-02.png 0 → 100644 +44,9 ko Chargement de la diff d'image… main.py +26 −15 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -16,14 +16,14 @@ from PIL import Image fg_color = "#000000" fg_color = "#000000" bg_color = "#FFFFFF" bg_color = "#FFFFFF" version = 3 version = 3 curent_file = "" current_file = "temp.png" # ===== FONCTIONS ===== # ===== FONCTIONS ===== def new_file(): def new_file(): global curent_file global current_file curent_file = "" current_file = "temp.png" # on vide toutes les zones de saisie # on vide toutes les zones de saisie ssid_name.delete(0, 'end') ssid_name.delete(0, 'end') password.delete(0, 'end') password.delete(0, 'end') Chargement en cours @@ -33,11 +33,13 @@ def new_file(): # ouverture d'un fichier # ouverture d'un fichier def open_file(): def open_file(): global curent_file global current_file file = filedialog.askopenfilename(title="Ouvrir un QRCode au format PNG", defaultextension="png", file = filedialog.askopenfilename(title="Ouvrir un QRCode au format PNG", defaultextension="png", initialdir="./qrcodes") initialdir="./qrcodes") curent_file = file current_file = file # on vide les zones de saisie du WIFI ssid_name.delete(0, 'end') ssid_name.delete(0, 'end') password.delete(0, 'end') password.delete(0, 'end') text.delete(0, 'end') text.delete(0, 'end') Chargement en cours @@ -49,15 +51,14 @@ def open_file(): # enregistrer un fichier sous # enregistrer un fichier sous def save_as(): def save_as(): global curent_file global current_file if curent_file != "": if current_file != "": file = filedialog.asksaveasfilename(title="Enregistrer le QRCode au format PNG sous", file = filedialog.asksaveasfilename(title="Enregistrer le QRCode au format PNG sous", filetypes=[("Fichier PNG", "png")], filetypes=[("Fichier PNG", "png")], defaultextension="png", defaultextension="png", initialdir="./qrcodes") initialdir="./qrcodes") current_file = file curent_file = file code() print(curent_file) else: else: messagebox.showerror("Erreur", "Le fichier est vide") messagebox.showerror("Erreur", "Le fichier est vide") Chargement en cours Chargement en cours @@ -148,6 +149,7 @@ def verif_before_code(): def code(): def code(): global current_file global qrcode_img global qrcode_img bs = boxe_size_scale.get() bs = boxe_size_scale.get() Chargement en cours @@ -164,17 +166,19 @@ def code(): # création et sauvegarde de l'image du QRCode # création et sauvegarde de l'image du QRCode img = qr.make_image(fill_color=fg_color, back_color=bg_color) img = qr.make_image(fill_color=fg_color, back_color=bg_color) img.save('qrcode.png') img.save(current_file) def display_qrcode(): def display_qrcode(): global qrcode_img global qrcode_img global current_file # calcul de la taille du QRCode pour le centrer dans la fenêtre # calcul de la taille du QRCode pour le centrer dans la fenêtre img = Image.open("qrcode.png") img = Image.open(current_file) size = img.size size = img.size # affichage du QRCode # affichage du QRCode qrcode_img = PhotoImage(file="qrcode.png") qrcode_img = PhotoImage(file=current_file) qrcode_label.config(image=qrcode_img, bg="white") qrcode_label.config(image=qrcode_img, bg="white") qrcode_label.place(x=198 - size[0] // 2, y=198 - size[1] // 2) # centrage qrcode_label.place(x=198 - size[0] // 2, y=198 - size[1] // 2) # centrage Chargement en cours @@ -201,16 +205,18 @@ menu_general = Menu(root) # Création du menu principal 'Fichier' # Création du menu principal 'Fichier' menu_fichier = Menu(menu_general, tearoff=0) menu_fichier = Menu(menu_general, tearoff=0) menu_general.add_cascade(label="Fichier", menu=menu_fichier) menu_general.add_cascade(label="Fichier", menu=menu_fichier) # Création des sous menus 'Fichiers' # Création des sous menus 'Fichiers' menu_fichier.add_command(label="Nouveau", command=new_file) menu_fichier.add_command(label="Nouveau", command=new_file) menu_fichier.add_command(label="Ouvrir", command=open_file) menu_fichier.add_command(label="Ouvrir", command=open_file) menu_fichier.add_command(label="Enregistrer") menu_fichier.add_command(label="Enregistrer", command=code) menu_fichier.add_command(label="Enregistrer sous", command=save_as) menu_fichier.add_command(label="Enregistrer sous", command=save_as) menu_fichier.add_command(label="Quitter", command=quit) menu_fichier.add_command(label="Quitter", command=quit) # Création du menu principal 'Aide' # Création du menu principal 'Aide' menu_aide = Menu(menu_general, tearoff=0) menu_aide = Menu(menu_general, tearoff=0) menu_general.add_cascade(label="Aide", menu=menu_aide) menu_general.add_cascade(label="Aide", menu=menu_aide) # Création des sous menus 'Aide' # Création des sous menus 'Aide' menu_aide.add_command(label="Info", command=info) menu_aide.add_command(label="Info", command=info) Chargement en cours Chargement en cours @@ -254,16 +260,19 @@ border_size_scale.place(x=180, y=90) # ===== point d'accès WIFI ===== # ===== point d'accès WIFI ===== wifi_title = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") wifi_title = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") wifi_title.place(x=30, y=175) wifi_title.place(x=30, y=175) # SSID # SSID ssid_name_title = Label(left_frame, text='SSID :', bg="#CCCCCC") ssid_name_title = Label(left_frame, text='SSID :', bg="#CCCCCC") ssid_name_title.place(x=30, y=200) ssid_name_title.place(x=30, y=200) ssid_name = Entry(left_frame, width=40) ssid_name = Entry(left_frame, width=40) ssid_name.place(x=30, y=225) ssid_name.place(x=30, y=225) # Password # Password password_title = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") password_title = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") password_title.place(x=30, y=250) password_title.place(x=30, y=250) password = Entry(left_frame, width=40) password = Entry(left_frame, width=40) password.place(x=30, y=275) password.place(x=30, y=275) # Cryptage # Cryptage crypt_title = Label(left_frame, text='Cryptage :', bg="#CCCCCC") crypt_title = Label(left_frame, text='Cryptage :', bg="#CCCCCC") crypt_title.place(x=300, y=200) crypt_title.place(x=300, y=200) Chargement en cours @@ -271,12 +280,14 @@ crypt_list = ["WPA", "WEP", "Aucun"] crypt_choice = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, crypt_choice = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, values=crypt_list, callback=no_password) values=crypt_list, callback=no_password) crypt_choice.place(x=300, y=225) crypt_choice.place(x=300, y=225) # Caché # Caché hide_title = Label(left_frame, text='Caché :', bg="#CCCCCC") hide_title = Label(left_frame, text='Caché :', bg="#CCCCCC") hide_title.place(x=300, y=250) hide_title.place(x=300, y=250) hide_list = ["NON", "OUI"] hide_list = ["NON", "OUI"] hide_choice = Spinbox(left_frame, values=hide_list, width=8, justify=CENTER) hide_choice = Spinbox(left_frame, values=hide_list, width=8, justify=CENTER) hide_choice.place(x=300, y=275) hide_choice.place(x=300, y=275) # Transfert du code dans les données à coder # Transfert du code dans les données à coder transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", bg="#61AEF9", command=transfert) bg="#61AEF9", command=transfert) Chargement en cours Chargement en cours
README.md +15 −2 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff # objQRCode # objQRCode  **objQRCode** est un utilitaire pour créer des QRCode écrit en python. **objQRCode** est un utilitaire pour créer des QRCode écrit en python. C'est en fait une interface graphique pour **qrcode** (https://pypi.org/project/qrcode/) sous python. C'est en fait une interface graphique pour **qrcode** (https://pypi.org/project/qrcode/) sous python. L'application est en cours de développement. Toute les fonctions sont opérationnelles : - ouverture d'un QRCode au format PNG - décodage de l'image - codage au format PNG d'un texte, une url - codage d'un accès WIFI - choix des couleurs (points et fond) - taille du QRCode - épaisseur de la bordure - enregistrement de l'image au format PNG Il reste quelles petites améliorations à faire, tant fonctionnelles qu'esthétiques, voire quelques fonctions supplémentaires à ajouter. ## Paquets à installer : ## Paquets à installer : Chargement en cours Chargement en cours @@ -37,4 +51,3 @@ WIFI:T:*cryptage(nopass, WEP, WAPA)*;S:ssid;P:*motdepasse*;H:*caché(true)* ### qrcode - python ### qrcode - python - https://pypi.org/project/qrcode/ - https://pypi.org/project/qrcode/
main.py +26 −15 Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -16,14 +16,14 @@ from PIL import Image fg_color = "#000000" fg_color = "#000000" bg_color = "#FFFFFF" bg_color = "#FFFFFF" version = 3 version = 3 curent_file = "" current_file = "temp.png" # ===== FONCTIONS ===== # ===== FONCTIONS ===== def new_file(): def new_file(): global curent_file global current_file curent_file = "" current_file = "temp.png" # on vide toutes les zones de saisie # on vide toutes les zones de saisie ssid_name.delete(0, 'end') ssid_name.delete(0, 'end') password.delete(0, 'end') password.delete(0, 'end') Chargement en cours @@ -33,11 +33,13 @@ def new_file(): # ouverture d'un fichier # ouverture d'un fichier def open_file(): def open_file(): global curent_file global current_file file = filedialog.askopenfilename(title="Ouvrir un QRCode au format PNG", defaultextension="png", file = filedialog.askopenfilename(title="Ouvrir un QRCode au format PNG", defaultextension="png", initialdir="./qrcodes") initialdir="./qrcodes") curent_file = file current_file = file # on vide les zones de saisie du WIFI ssid_name.delete(0, 'end') ssid_name.delete(0, 'end') password.delete(0, 'end') password.delete(0, 'end') text.delete(0, 'end') text.delete(0, 'end') Chargement en cours @@ -49,15 +51,14 @@ def open_file(): # enregistrer un fichier sous # enregistrer un fichier sous def save_as(): def save_as(): global curent_file global current_file if curent_file != "": if current_file != "": file = filedialog.asksaveasfilename(title="Enregistrer le QRCode au format PNG sous", file = filedialog.asksaveasfilename(title="Enregistrer le QRCode au format PNG sous", filetypes=[("Fichier PNG", "png")], filetypes=[("Fichier PNG", "png")], defaultextension="png", defaultextension="png", initialdir="./qrcodes") initialdir="./qrcodes") current_file = file curent_file = file code() print(curent_file) else: else: messagebox.showerror("Erreur", "Le fichier est vide") messagebox.showerror("Erreur", "Le fichier est vide") Chargement en cours Chargement en cours @@ -148,6 +149,7 @@ def verif_before_code(): def code(): def code(): global current_file global qrcode_img global qrcode_img bs = boxe_size_scale.get() bs = boxe_size_scale.get() Chargement en cours @@ -164,17 +166,19 @@ def code(): # création et sauvegarde de l'image du QRCode # création et sauvegarde de l'image du QRCode img = qr.make_image(fill_color=fg_color, back_color=bg_color) img = qr.make_image(fill_color=fg_color, back_color=bg_color) img.save('qrcode.png') img.save(current_file) def display_qrcode(): def display_qrcode(): global qrcode_img global qrcode_img global current_file # calcul de la taille du QRCode pour le centrer dans la fenêtre # calcul de la taille du QRCode pour le centrer dans la fenêtre img = Image.open("qrcode.png") img = Image.open(current_file) size = img.size size = img.size # affichage du QRCode # affichage du QRCode qrcode_img = PhotoImage(file="qrcode.png") qrcode_img = PhotoImage(file=current_file) qrcode_label.config(image=qrcode_img, bg="white") qrcode_label.config(image=qrcode_img, bg="white") qrcode_label.place(x=198 - size[0] // 2, y=198 - size[1] // 2) # centrage qrcode_label.place(x=198 - size[0] // 2, y=198 - size[1] // 2) # centrage Chargement en cours @@ -201,16 +205,18 @@ menu_general = Menu(root) # Création du menu principal 'Fichier' # Création du menu principal 'Fichier' menu_fichier = Menu(menu_general, tearoff=0) menu_fichier = Menu(menu_general, tearoff=0) menu_general.add_cascade(label="Fichier", menu=menu_fichier) menu_general.add_cascade(label="Fichier", menu=menu_fichier) # Création des sous menus 'Fichiers' # Création des sous menus 'Fichiers' menu_fichier.add_command(label="Nouveau", command=new_file) menu_fichier.add_command(label="Nouveau", command=new_file) menu_fichier.add_command(label="Ouvrir", command=open_file) menu_fichier.add_command(label="Ouvrir", command=open_file) menu_fichier.add_command(label="Enregistrer") menu_fichier.add_command(label="Enregistrer", command=code) menu_fichier.add_command(label="Enregistrer sous", command=save_as) menu_fichier.add_command(label="Enregistrer sous", command=save_as) menu_fichier.add_command(label="Quitter", command=quit) menu_fichier.add_command(label="Quitter", command=quit) # Création du menu principal 'Aide' # Création du menu principal 'Aide' menu_aide = Menu(menu_general, tearoff=0) menu_aide = Menu(menu_general, tearoff=0) menu_general.add_cascade(label="Aide", menu=menu_aide) menu_general.add_cascade(label="Aide", menu=menu_aide) # Création des sous menus 'Aide' # Création des sous menus 'Aide' menu_aide.add_command(label="Info", command=info) menu_aide.add_command(label="Info", command=info) Chargement en cours Chargement en cours @@ -254,16 +260,19 @@ border_size_scale.place(x=180, y=90) # ===== point d'accès WIFI ===== # ===== point d'accès WIFI ===== wifi_title = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") wifi_title = Label(left_frame, text='CONFIGURATION DU WIFI :', bg="#CCCCCC") wifi_title.place(x=30, y=175) wifi_title.place(x=30, y=175) # SSID # SSID ssid_name_title = Label(left_frame, text='SSID :', bg="#CCCCCC") ssid_name_title = Label(left_frame, text='SSID :', bg="#CCCCCC") ssid_name_title.place(x=30, y=200) ssid_name_title.place(x=30, y=200) ssid_name = Entry(left_frame, width=40) ssid_name = Entry(left_frame, width=40) ssid_name.place(x=30, y=225) ssid_name.place(x=30, y=225) # Password # Password password_title = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") password_title = Label(left_frame, text='Mot de passe :', bg="#CCCCCC") password_title.place(x=30, y=250) password_title.place(x=30, y=250) password = Entry(left_frame, width=40) password = Entry(left_frame, width=40) password.place(x=30, y=275) password.place(x=30, y=275) # Cryptage # Cryptage crypt_title = Label(left_frame, text='Cryptage :', bg="#CCCCCC") crypt_title = Label(left_frame, text='Cryptage :', bg="#CCCCCC") crypt_title.place(x=300, y=200) crypt_title.place(x=300, y=200) Chargement en cours @@ -271,12 +280,14 @@ crypt_list = ["WPA", "WEP", "Aucun"] crypt_choice = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, crypt_choice = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER, values=crypt_list, callback=no_password) values=crypt_list, callback=no_password) crypt_choice.place(x=300, y=225) crypt_choice.place(x=300, y=225) # Caché # Caché hide_title = Label(left_frame, text='Caché :', bg="#CCCCCC") hide_title = Label(left_frame, text='Caché :', bg="#CCCCCC") hide_title.place(x=300, y=250) hide_title.place(x=300, y=250) hide_list = ["NON", "OUI"] hide_list = ["NON", "OUI"] hide_choice = Spinbox(left_frame, values=hide_list, width=8, justify=CENTER) hide_choice = Spinbox(left_frame, values=hide_list, width=8, justify=CENTER) hide_choice.place(x=300, y=275) hide_choice.place(x=300, y=275) # Transfert du code dans les données à coder # Transfert du code dans les données à coder transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", transfert_btn = Button(left_frame, text="Transfert\nvers\ndonnées", bg="#61AEF9", command=transfert) bg="#61AEF9", command=transfert) Chargement en cours