diff --git a/.gitignore b/.gitignore index 28e8ea2..5c5449d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ MANIFEST dist build *.egg-info +deb_dist diff --git a/BraceletGenerator/bracelet.py b/BraceletGenerator/bracelet.py index f4e5603..da53fe9 100755 --- a/BraceletGenerator/bracelet.py +++ b/BraceletGenerator/bracelet.py @@ -1273,7 +1273,7 @@ def del_recent_file(self, file): self.menu_file.entryconfigure(3, state="disabled") if file in RECENT_BICOLOR: - RECENT_BICOLOR.delete(file) + RECENT_BICOLOR.remove(file) def _importe(self, fils, g_out, fil_noeud): """ importe les informations sur le motif et actualise le bracelet """ diff --git a/BraceletGenerator/constantes.py b/BraceletGenerator/constantes.py index 0a7390f..0958c91 100755 --- a/BraceletGenerator/constantes.py +++ b/BraceletGenerator/constantes.py @@ -44,7 +44,17 @@ APP_NAME = "BraceletGenerator" # Get the local directory -PATH = os.path.split(__file__)[0] +if platform == 'linux' and os.path.exists("/usr/share/bracelet-generator"): + # the app has been installed + IMAGES_LOCATION = '/usr/share/bracelet-generator/images' + PATH_LOCALE = "/usr/share/locale" + PATH_DOC = '/usr/share/doc/bracelet-generator' +else: + PATH = os.path.split(__file__)[0] + IMAGES_LOCATION = os.path.join(PATH, 'images') + PATH_LOCALE = os.path.join(PATH, "locale") + PATH_DOC = os.path.join(PATH, "doc") + LOCAL_PATH = os.path.expanduser("~") LOCAL_PATH = os.path.join(LOCAL_PATH, "BraceletGenerator") if not os.path.exists(LOCAL_PATH): @@ -52,19 +62,14 @@ PATH_CONFIG = os.path.join(LOCAL_PATH, 'BraceletGenerator.ini') -IMAGES_LOCATION = os.path.join(PATH, 'images') - -PATH_LOCALE = os.path.join(PATH, "locale") - -PATH_DOC = os.path.join(PATH, "doc") - -# lecture du fichier de configuration +# configuration file CONFIG = ConfigParser() if os.path.exists(PATH_CONFIG): CONFIG.read(PATH_CONFIG) LANGUE = CONFIG.get("General","language") else: LANGUE = "" + CONFIG.add_section("General") CONFIG.set("General", "last_path", LOCAL_PATH) CONFIG.set("General", "recent_files", "") @@ -94,7 +99,7 @@ languages=[LANGUE], fallback=True) LANG.install() - +# get recent files RECENT_FILES = CONFIG.get("General", "recent_files").split(",") if RECENT_FILES == [""]: RECENT_FILES = [] @@ -102,7 +107,7 @@ if RECENT_BICOLOR == [""]: RECENT_BICOLOR = [] -# chemins des images +# pictures IM_EXIT_M = os.path.join(IMAGES_LOCATION, "exit_m.png") IM_EXIT = os.path.join(IMAGES_LOCATION, "exit.png") IM_EXPORT_M = os.path.join(IMAGES_LOCATION, "export_m.png") @@ -160,7 +165,7 @@ IM_SYM_HORIZ_M = os.path.join(IMAGES_LOCATION, "sym_horizontal_m.png") IM_SYM_VERT_M = os.path.join(IMAGES_LOCATION, "sym_vertical_m.png") - +# colors if platform == 'darwin' or PL == 'nt': BG_COLOR = '#F0F0F0' CANVAS_COLOR = "#ffffff" diff --git a/BraceletGenerator/doc/doc.html b/BraceletGenerator/doc/doc.html old mode 100755 new mode 100644 diff --git a/BraceletGenerator/doc/doc_fr.html b/BraceletGenerator/doc/doc_fr.html old mode 100755 new mode 100644 diff --git a/BraceletGenerator/doc/style.css b/BraceletGenerator/doc/style.css old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/about.png b/BraceletGenerator/images/about.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/aide.png b/BraceletGenerator/images/aide.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/bg.png b/BraceletGenerator/images/bg.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/bicolore.png b/BraceletGenerator/images/bicolore.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/bicolore_en.png b/BraceletGenerator/images/bicolore_en.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/bicolore_fr.png b/BraceletGenerator/images/bicolore_fr.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/bicolore_m.png b/BraceletGenerator/images/bicolore_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/chevrons.png b/BraceletGenerator/images/chevrons.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/color.png b/BraceletGenerator/images/color.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/color_m.png b/BraceletGenerator/images/color_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/couleurs_en.png b/BraceletGenerator/images/couleurs_en.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/couleurs_fr.png b/BraceletGenerator/images/couleurs_fr.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/efface.png b/BraceletGenerator/images/efface.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/efface_m.png b/BraceletGenerator/images/efface_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/exit.png b/BraceletGenerator/images/exit.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/exit_m.png b/BraceletGenerator/images/exit_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/export.png b/BraceletGenerator/images/export.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/export_m.png b/BraceletGenerator/images/export_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/favicon.ico b/BraceletGenerator/images/favicon.ico old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/fg.png b/BraceletGenerator/images/fg.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon.ico b/BraceletGenerator/images/icon.ico old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon128.png b/BraceletGenerator/images/icon128.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon16.png b/BraceletGenerator/images/icon16.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon22.png b/BraceletGenerator/images/icon22.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon24.png b/BraceletGenerator/images/icon24.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon32.png b/BraceletGenerator/images/icon32.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon48.png b/BraceletGenerator/images/icon48.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/icon64.png b/BraceletGenerator/images/icon64.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/main_en.png b/BraceletGenerator/images/main_en.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/main_fr.png b/BraceletGenerator/images/main_fr.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/moins.png b/BraceletGenerator/images/moins.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/moins_m.png b/BraceletGenerator/images/moins_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move.png b/BraceletGenerator/images/move.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_e.png b/BraceletGenerator/images/move_e.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_e_m.png b/BraceletGenerator/images/move_e_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_m.png b/BraceletGenerator/images/move_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_n.png b/BraceletGenerator/images/move_n.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_n_m.png b/BraceletGenerator/images/move_n_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_ne.png b/BraceletGenerator/images/move_ne.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_ne_m.png b/BraceletGenerator/images/move_ne_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_nw.png b/BraceletGenerator/images/move_nw.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_nw_m.png b/BraceletGenerator/images/move_nw_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_s.png b/BraceletGenerator/images/move_s.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_s_m.png b/BraceletGenerator/images/move_s_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_se.png b/BraceletGenerator/images/move_se.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_se_m.png b/BraceletGenerator/images/move_se_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_sw.png b/BraceletGenerator/images/move_sw.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_sw_m.png b/BraceletGenerator/images/move_sw_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_w.png b/BraceletGenerator/images/move_w.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/move_w_m.png b/BraceletGenerator/images/move_w_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/new.png b/BraceletGenerator/images/new.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/new_m.png b/BraceletGenerator/images/new_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/ouvrir.png b/BraceletGenerator/images/ouvrir.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/ouvrir_m.png b/BraceletGenerator/images/ouvrir_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/plus.png b/BraceletGenerator/images/plus.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/plus_m.png b/BraceletGenerator/images/plus_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/redo.png b/BraceletGenerator/images/redo.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/rotation_dte.png b/BraceletGenerator/images/rotation_dte.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/rotation_dte_m.png b/BraceletGenerator/images/rotation_dte_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/rotation_gche.png b/BraceletGenerator/images/rotation_gche.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/rotation_gche_m.png b/BraceletGenerator/images/rotation_gche_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/sauver.png b/BraceletGenerator/images/sauver.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/sauver_m.png b/BraceletGenerator/images/sauver_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/saveas.png b/BraceletGenerator/images/saveas.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/saveas_m.png b/BraceletGenerator/images/saveas_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/shifts.png b/BraceletGenerator/images/shifts.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/sym_horizontal.png b/BraceletGenerator/images/sym_horizontal.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/sym_horizontal_m.png b/BraceletGenerator/images/sym_horizontal_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/sym_vertical.png b/BraceletGenerator/images/sym_vertical.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/sym_vertical_m.png b/BraceletGenerator/images/sym_vertical_m.png old mode 100755 new mode 100644 diff --git a/BraceletGenerator/images/undo.png b/BraceletGenerator/images/undo.png old mode 100755 new mode 100644 diff --git a/CHANGELOG.txt b/CHANGELOG.txt old mode 100755 new mode 100644 diff --git a/COPYING.txt b/COPYING.txt old mode 100755 new mode 100644 diff --git a/MANIFEST.in b/MANIFEST.in old mode 100755 new mode 100644 index 0fe5de6..3c4b01c --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,7 @@ -include bracelet-generator *.txt *.rst bracelet-generator.desktop *.py bracelet-generator.svg -recursive-include BraceletGenerator/* -recursive-include documentation * +include *.txt *.rst *.py bracelet-generator.* +include BraceletGenerator/locale/fr_FR/LC_MESSAGES/BraceletGenerator.mo +include BraceletGenerator/locale/en_US/LC_MESSAGES/BraceletGenerator.mo recursive-include examples * +recursive-include BraceletGenerator/images * +recursive-include BraceletGenerator/doc * recursive-include po * diff --git a/archlinux/BraceletGenerator-1.4.0/BraceletGenerator/__init__.py b/archlinux/BraceletGenerator-1.4.0/BraceletGenerator/__init__.py deleted file mode 100755 index e69de29..0000000 diff --git a/archlinux/BraceletGenerator-1.4.0/BraceletGenerator/about.py b/archlinux/BraceletGenerator-1.4.0/BraceletGenerator/about.py deleted file mode 100755 index a6697ba..0000000 --- a/archlinux/BraceletGenerator-1.4.0/BraceletGenerator/about.py +++ /dev/null @@ -1,115 +0,0 @@ -#! /usr/bin/python3 -# -*- coding:Utf-8 -*- -""" -Bracelet Generator - An easy way to design friendship bracelet patterns -Copyright 2014-2017 Juliette Monsel - -Bracelet Generator is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Bracelet Generator is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - - -Window displaying the information about the software -""" - -from tkinter import Text, Toplevel -from tkinter.ttk import Button, Label, Style -from BraceletGenerator.constantes import open_image, BG_COLOR, STYLE, VERSION, IM_ICON48, set_icon, webOpen - - -class About(Toplevel): - """ Toplevel de l'application principale donnant les informations à - propos du logiciel """ - def __init__(self, master, **options): - """ créer le Toplevel 'À propos de Bracelet Generator' """ - Toplevel.__init__(self, master, **options) - - self.title(_("About Bracelet Generator")) - self.transient(master) - self.grab_set() - self.configure(bg=BG_COLOR) - - set_icon(self) - - self.style = Style(self) - self.style.theme_use(STYLE) - self.style.configure('TButton', background=BG_COLOR) - self.style.configure('TLabel', background=BG_COLOR) - self.image = open_image(file=IM_ICON48, master=self) - Label(self, image=self.image).grid(row=0, columnspan=2, pady=10) - - Label(self, - text=_("Bracelet Generator %(version)s") - % ({"version": VERSION})).grid(row=1, columnspan=2) - Label(self, text=_("Friendship bracelet patterns designer")).grid(row=2, columnspan=2, padx=10) - Label(self, text="Copyright (C) Juliette Monsel 2014-2017").grid(row=3, columnspan=2) - Label(self, text="j_4321@protonmail.com").grid(row=4, columnspan=2) - Button(self, text=_("License"), command=self._license).grid(row=5, column=0, pady=20, padx=4) - Button(self, text=_("Close"), command=self.exit).grid(row=5, column=1, pady=20, padx=4) - - self.initial_focus = self - - self.protocol("WM_DELETE_WINDOW", self.exit) - self.resizable(0, 0) - self.initial_focus.focus_set() - self.wait_window(self) - - def exit(self): - """ ferme la fenêtre """ - if self.master: - self.master.focus_set() - self.destroy() - - def _license(self): - """ affiche la licence dans une nouvelle fenêtre """ - def close(): - """ ferme la fenêtre """ - self.focus_set() - fen.destroy() - - fen = Toplevel(self) - fen.title(_("License")) - fen.transient(self) - fen.protocol("WM_DELETE_WINDOW", close) - fen.resizable(0, 0) - fen.grab_set() - fen.configure(bg=BG_COLOR) - set_icon(fen) - style = Style(fen) - style.theme_use(STYLE) - style.configure('TButton', background=BG_COLOR) - style.configure('TLabel', background=BG_COLOR) - - texte = Text(fen, width=50, height=18) - texte.pack() - texte.insert("end", - _("Bracelet Generator is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\n")) - texte.insert("end", - _("Bracelet Generator is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\n")) - texte.insert("end", - _("You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.")) - - i = int(texte.index("5.end").split(".")[1]) - texte.tag_add("link", "5.%i" % (i - 29), "5.%i" % (i - 1)) - texte.tag_configure("link", foreground="#0000ff", underline=1) - texte.tag_bind("link", "