From f20413437c10219103a7211ca53e6e8cefbed643 Mon Sep 17 00:00:00 2001 From: xy Date: Fri, 17 Jan 2025 20:14:45 +0100 Subject: [PATCH] nuitka disabled, more translations, draft --- .github/workflows/run.yml | 178 +++++++++++++++++++------------------- requirements.txt | 1 - src/librer.py | 18 ++-- src/text.py | 20 +++++ 4 files changed, 119 insertions(+), 98 deletions(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 3e37180..13ca90d 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -62,110 +62,110 @@ jobs: if-no-files-found: error ########################################################################## - win-nuitka: - needs: [win-pyinstaller-gen-version] - runs-on: windows-latest +# win-nuitka: +# needs: [win-pyinstaller-gen-version] +# runs-on: windows-latest - steps: - - name: checkout - uses: actions/checkout@v4 +# steps: +# - name: checkout +# uses: actions/checkout@v4 - - name: python setup - uses: actions/setup-python@v5 - with: - python-version: "3.13" - cache: 'pip' - check-latest: true +# - name: python setup +# uses: actions/setup-python@v5 +# with: +# python-version: "3.13" +# cache: 'pip' +# check-latest: true - - name: pip upgrade - run: python -m pip install --upgrade pip +# - name: pip upgrade +# run: python -m pip install --upgrade pip - - name: install requirements - run: pip install -r requirements.txt +# - name: install requirements +# run: pip install -r requirements.txt ##################################### - - name: version download - uses: actions/download-artifact@v4 - with: - name: version - path: ./src +# - name: version download +# uses: actions/download-artifact@v4 +# with: +# name: version +# path: ./src ##################################### - - name: convert icons to python source - working-directory: ./scripts - run: "icons.convert.bat" - shell: cmd +# - name: convert icons to python source +# working-directory: ./scripts +# run: "icons.convert.bat" +# shell: cmd ##################################### - - name: run nuitka - working-directory: ./scripts - run: "nuitka.run.bat" - shell: cmd +# - name: run nuitka +# working-directory: ./scripts +# run: "nuitka.run.bat" +# shell: cmd ##################################### - - name: upload win nuitka distro - uses: actions/upload-artifact@v4 - with: - name: nuitka-win - path: ./build-nuitka/librer.win.zip - if-no-files-found: error +# - name: upload win nuitka distro +# uses: actions/upload-artifact@v4 +# with: +# name: nuitka-win +# path: ./build-nuitka/librer.win.zip +# if-no-files-found: error ########################################################################## - lin-nuitka: - permissions: write-all - needs: [win-nuitka] - runs-on: ubuntu-20.04 +# lin-nuitka: +# permissions: write-all +# needs: [win-nuitka] +# runs-on: ubuntu-20.04 - steps: - - name: checkout - uses: actions/checkout@v4 +# steps: +# - name: checkout +# uses: actions/checkout@v4 - - name: python setup - uses: actions/setup-python@v5 - with: - python-version: "3.13" - cache: 'pip' - check-latest: true +# - name: python setup +# uses: actions/setup-python@v5 +# with: +# python-version: "3.13" +# cache: 'pip' +# check-latest: true - - name: pip upgrade - run: python -m pip install --upgrade pip +# - name: pip upgrade +# run: python -m pip install --upgrade pip - - name: install requirements - run: pip install -r requirements.txt +# - name: install requirements +# run: pip install -r requirements.txt - - name: strip python binaries - run: find $pythonLocation -name *.so* -type f -exec strip {} \; +# - name: strip python binaries +# run: find $pythonLocation -name *.so* -type f -exec strip {} \; ##################################### - - name: version download - uses: actions/download-artifact@v4 - with: - name: version - path: ./src +# - name: version download +# uses: actions/download-artifact@v4 +# with: +# name: version +# path: ./src ##################################### - - name: convert icons to python source - working-directory: ./scripts - run: bash "icons.convert.sh" +# - name: convert icons to python source +# working-directory: ./scripts +# run: bash "icons.convert.sh" ##################################### - - name: run nuitka - working-directory: ./scripts - run: bash "nuitka.run.sh" +# - name: run nuitka +# working-directory: ./scripts +# run: bash "nuitka.run.sh" ##################################### - - name: upload lin distro - uses: actions/upload-artifact@v4 - with: - name: nuitka-lin - path: ./build-nuitka/librer.lin.zip - if-no-files-found: error +# - name: upload lin distro +# uses: actions/upload-artifact@v4 +# with: +# name: nuitka-lin +# path: ./build-nuitka/librer.lin.zip +# if-no-files-found: error ########################################################################## lin-pyinstaller: permissions: write-all - needs: [lin-nuitka] + needs: [win-pyinstaller-gen-version] runs-on: ubuntu-20.04 steps: @@ -231,25 +231,25 @@ jobs: run: mv ./librer.win.zip ./librer.${{ steps.version.outputs.version }}.windows.portable.zip ##################################### - - name: download windows nuitka distro - uses: actions/download-artifact@v4 - with: - name: nuitka-win - path: ./ +# - name: download windows nuitka distro +# uses: actions/download-artifact@v4 +# with: +# name: nuitka-win +# path: ./ - - name: rename windows distro - run: mv ./librer.win.zip ./librer.${{ steps.version.outputs.version }}.windows.nuitka.portable.zip +# - name: rename windows distro +# run: mv ./librer.win.zip ./librer.${{ steps.version.outputs.version }}.windows.nuitka.portable.zip ##################################### - - name: download linux nuitka distro - uses: actions/download-artifact@v4 - with: - name: nuitka-lin - path: ./ +# - name: download linux nuitka distro +# uses: actions/download-artifact@v4 +# with: +# name: nuitka-lin +# path: ./ - - name: rename linux distro - run: mv ./librer.lin.zip ./librer.${{ steps.version.outputs.version }}.linux.nuitka.portable.zip +# - name: rename linux distro +# run: mv ./librer.lin.zip ./librer.${{ steps.version.outputs.version }}.linux.nuitka.portable.zip ##################################### - name: Create GitHub release @@ -259,11 +259,11 @@ jobs: with: tag_name: ${{ steps.version.outputs.version }} name: Librer ${{ steps.version.outputs.version }} - draft: false + draft: true prerelease: true files: | librer.${{ steps.version.outputs.version }}.linux.portable.zip - librer.${{ steps.version.outputs.version }}.linux.nuitka.portable.zip +# librer.${{ steps.version.outputs.version }}.linux.nuitka.portable.zip librer.${{ steps.version.outputs.version }}.windows.portable.zip - librer.${{ steps.version.outputs.version }}.windows.nuitka.portable.zip +# librer.${{ steps.version.outputs.version }}.windows.nuitka.portable.zip diff --git a/requirements.txt b/requirements.txt index 1cc7b54..fbe23d6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ pyinstaller==6.11.1 send2trash==1.8.3 zstandard==0.23.0 -nuitka==2.5.9 tkinterdnd2==0.4.2 psutil==6.1.1 pympler==1.1 diff --git a/src/librer.py b/src/librer.py index 319a0fe..48696ef 100755 --- a/src/librer.py +++ b/src/librer.py @@ -1193,7 +1193,7 @@ def get_scan_dialog(self): temp_frame = Frame(dialog.area_main,borderwidth=2,bg=self.bg_color) temp_frame.grid(row=0,column=0,sticky='we',padx=4,pady=4) - ul_lab=Label(temp_frame,text="Label:",bg=self.bg_color,anchor='w') + ul_lab=Label(temp_frame,text=STR("Label:"),bg=self.bg_color,anchor='w') ul_lab.grid(row=0, column=4, sticky='news',padx=4,pady=4)\ label_tooltip = STR("Internal Label of the record to be created") @@ -1726,6 +1726,8 @@ def get_entry_ask_dialog(self): if not self.entry_ask_dialog_created: self.status(STR("Creating dialog ...")) self.entry_ask_dialog = EntryDialogQuestion(self.main,self.main_icon_tuple,self.bg_color,pre_show=self.pre_show,post_close=self.post_close) + self.entry_ask_dialog.cancel_button.configure(text=STR('Cancel')) + self.entry_ask_dialog_created = True return self.entry_ask_dialog @@ -2185,7 +2187,7 @@ def alias_name(self): alias_info = f' ({alias})' if alias else '' alias_init = alias if alias else self.current_record.header.label - self.get_entry_ask_dialog().show('Alias record name',f"New alias name for record '{self.current_record.header.label}' {alias_info} :",alias_init) + self.get_entry_ask_dialog().show(STR('Alias record name'),STR('New alias name for record') + ' "' + str(self.current_record.header.label) + '"' + str(alias_info) + ":",alias_init) if self.entry_ask_dialog.res_bool: alias = self.entry_ask_dialog.entry_val.get() @@ -2268,7 +2270,7 @@ def record_import_wii(self): postfix = f' to group:{group}' if group else '' - if import_filenames := askopenfilenames(initialdir=self.last_dir,parent = self.main,title='Choose "Where Is It?" Report xml files to import' + postfix, defaultextension=".xml",filetypes=[("XML Files","*.xml"),("All Files","*.*")]): + if import_filenames := askopenfilenames(initialdir=self.last_dir,parent = self.main,title='Choose "Where Is It?" Report xml files to import' + postfix, defaultextension=".xml",filetypes=[(STR("XML Files"),"*.xml"),(STR("All Files"),"*.*")]): self.status('Parsing WII files ... ') self.main.update() dialog = self.get_progress_dialog_on_main() @@ -2385,7 +2387,7 @@ def record_import(self): postfix = STR('to group:') + str(group) if group else '' - if import_filenames := askopenfilenames(initialdir=self.last_dir,parent = self.main,title=STR('Choose record files to import') + ' ' + postfix, defaultextension=".dat",filetypes=[("Dat Files","*.dat"),("All Files","*.*")]): + if import_filenames := askopenfilenames(initialdir=self.last_dir,parent = self.main,title=STR('Choose record files to import') + ' ' + postfix, defaultextension=".dat",filetypes=[(STR("Dat Files"),"*.dat"),(STR("All Files"),"*.*")]): self.last_dir = dirname(import_filenames[0]) if import_res := librer_core.import_records(import_filenames,self.single_record_show,group): self.info_dialog_on_main.show(STR('Import failed'),import_res) @@ -2400,7 +2402,7 @@ def record_import(self): @block def record_export(self): if self.current_record: - if export_file_path := asksaveasfilename(initialdir=self.last_dir,parent = self.main, initialfile = 'record.dat',defaultextension=".dat",filetypes=[("Dat Files","*.dat"),("All Files","*.*")]): + if export_file_path := asksaveasfilename(initialdir=self.last_dir,parent = self.main, initialfile = 'record.dat',defaultextension=".dat",filetypes=[(STR("Dat Files"),"*.dat"),(STR("All Files"),"*.*")]): self.last_dir = dirname(export_file_path) if export_res := librer_core.export_record(self.current_record,export_file_path): @@ -2768,7 +2770,7 @@ def find_next(self): self.select_find_result(1) def find_save_results(self): - if report_file_name := asksaveasfilename(parent = self.find_dialog.widget, initialfile = 'librer_search_report.txt',defaultextension=".txt",filetypes=[("All Files","*.*"),("Text Files","*.txt")]): + if report_file_name := asksaveasfilename(parent = self.find_dialog.widget, initialfile = 'librer_search_report.txt',defaultextension=".txt",filetypes=[(STR("All Files"),"*.*"),(STR("Text Files"),"*.txt")]): self.status('saving file "%s" ...' % str(report_file_name)) with open(report_file_name,'w') as report_file: @@ -3945,7 +3947,7 @@ def scan(self,compression_level,threads,group=None): self_configure_tooltip = self.configure_tooltip self_tooltip_message[str_self_progress_dialog_on_scan_abort_button]=STR('If you abort at this stage,\nData record will not be created.') - self_progress_dialog_on_scan.abort_button.configure(image=self.ico_abort,text='Cancel',compound='left',width=15) + self_progress_dialog_on_scan.abort_button.configure(image=self.ico_abort,text=STR("Cancel"),compound='left',width=15) self.scan_dialog.widget.update() @@ -4515,7 +4517,7 @@ def cde_up(self,e): def cde_entry_open(self,e) : initialdir = self.last_dir if self.last_dir else self.cwd - if res:=askopenfilename(title='Select File',initialdir=initialdir,parent=self.scan_dialog.area_main,filetypes=(("Executable Files","*.exe"),("Bat Files","*.bat"),("All Files","*.*")) if windows else (("Bash Files","*.sh"),("All Files","*.*")) ): + if res:=askopenfilename(title=STR('Select File'),initialdir=initialdir,parent=self.scan_dialog.area_main,filetypes=((STR("Executable Files"),"*.exe"),(STR("Bat Files"),"*.bat"),(STR("All Files"),"*.*")) if windows else ((STR("Bash Files"),"*.sh"),(STR("All Files"),"*.*")) ): self.last_dir=dirname(res) expr = normpath(abspath(res)) diff --git a/src/text.py b/src/text.py index 67de624..8f058d1 100644 --- a/src/text.py +++ b/src/text.py @@ -415,6 +415,18 @@ class LANGUAGES: "pl":'Wybierz plik'}, 'All Files':{ "pl":'Wszystkie pliki'}, + 'Text Files':{ + "pl":'Pliki tekstowe'}, + "Bash Files":{ + "pl":'Pliki Bash'}, + "Executable Files":{ + "pl":'Pliki Wykonywalne'}, + "Bat Files":{ + "pl":'Pliki bat'}, + "XML Files":{ + "pl":'Pliki XML'}, + "Dat Files":{ + "pl":'Pliki Dat'}, 'Test Custom Data Extractor on selected file ?':{ "pl":'Przetestować Ekstraktor Danych Użytkownika na wybranym pliku ?'}, 'Testing selected Custom Data Extractor':{ @@ -439,6 +451,14 @@ class LANGUAGES: "pl":'Język:'}, 'Records':{ "pl":'Rekordy'}, + 'Alias record name':{ + "pl":'Alias nazwy rekordu'}, + 'Cancel':{ + "pl":'Anuluj'}, + "Label:":{ + "pl":'Nazwa:'}, + 'New alias name for record':{ + "pl":'Nowy Alias:'}, 'Include hidden files/folders in scan.':{ "pl":'Uwzględniaj pliki/foldery ukryte.'}, }