Commit Graph

322 Commits

Author SHA1 Message Date
wmayer
c5fb91170b dist-git: make script working again for Py3 and Linux 2021-10-30 14:50:00 +02:00
Chris Hennes
9cbfe835f3 [Tools] Eliminate default value modification
LGTM catches a potential error with the mutation of default values:
implement their suggested workaround of using a None placeholder to
ensure the default itself is never modified.
2021-10-11 21:13:22 -05:00
Yorik van Havre
7489e8ea9e Merge pull request #5078 from chennes/femRemoveExtraTranslations
[Fem] Clean up Fem.ts to remove extra translations
2021-10-08 14:46:04 +02:00
luz paz
1bac25de44 Tools: fix updatecrowdin.py variable typo [skip ci] 2021-10-06 18:15:53 -04:00
Chris Hennes
ef7127a456 [Tools] Strip translations from base TS files 2021-09-30 15:13:26 -05:00
Chris Hennes
20848125a9 Merge branch 'master' into fixMixedLanguageTranslationExtraction 2021-09-24 07:58:15 -05:00
Yorik van Havre
fafc18158c Tools: small fix in crowdin script 2021-09-23 17:14:31 +02:00
Chris Hennes
6a9b27df1e Tools: Corrected arguments to git.extractInfo 2021-09-21 11:17:21 -05:00
Chris Hennes
be10709785 Tools: LGTM - don't catch BaseException 2021-09-19 14:38:05 -05:00
wmayer
c1cbee9a06 Tools: port example of embedding to Py3 2021-09-19 18:01:24 +02:00
Chris Hennes
def6d0563a [Tools] Refactor updatets to support two-lang mods 2021-09-17 10:22:35 -05:00
Yorik van Havre
455412ccc7 Tools: Updated crowdin script after PR #5021 2021-09-13 15:40:36 +02:00
Yorik van Havre
419e601482 Tools: Updated crowdin scripts
- Removed updateFromCrowdin script (now merged within updateCrowdin)
- Now automatically installs all languages above 25% translated
- Now updates Gui/Language/Translator.cpp too
2021-09-07 11:27:05 +02:00
Yorik van Havre
e359c01cc9 Tools: Removed Plot from translation scripts 2021-08-26 14:50:36 +02:00
Chris Hennes
1b12226bd4 [Tools] Silence LGTM warning about missing init 2021-08-17 12:25:12 -05:00
Yorik van Havre
61ac0b4838 Merge pull request #4900 from sanguinariojoe/del_ship
Ship: Remove Ship module
2021-08-16 17:30:43 +02:00
Chris Hennes
6d136c9b1b Add PartDesign Python commands for translation (#4961)
Fixes #4583
2021-08-11 14:51:18 -05:00
Jose Luis Cercos-Pita
63c9e7ee72 Remove Ship module 2021-07-05 09:24:21 +02:00
Yorik van Havre
909dfa7036 Tools: allow to run updatets script from updatecrowdin 2021-07-01 13:57:24 +02:00
Yorik van Havre
ac4937f59c Tools: small cosmetic fix 2021-06-10 11:53:02 +02:00
luz paz
261c06a052 Fix misc. typos
Found via 
```codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,parms,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/doc/SourceDocu```
2021-06-03 14:36:21 -04:00
Yorik van Havre
ff26df0a6d Tools: updated help text 2021-06-03 15:45:55 +02:00
Yorik van Havre
c7fb3ff829 Tools: cosmetic tweaks to updatecrowdin script 2021-05-12 16:36:15 +02:00
luz paz
05a22ec22d Misc: remove py2 code 2021-04-27 18:52:01 +02:00
wmayer
2f276601f8 Fix generation and build of python classes for 3.8 2021-04-27 14:35:34 +02:00
markus
aa0dcff74f Fix generation and build of python classes for 3.9 2021-04-27 00:41:53 +02:00
wmayer
af16ab02a0 Base: remove some more deprecated Py2 code
and remove deprecated void from function signature and replace 0 or NULL with nullptr
2021-04-26 10:29:48 +02:00
Yorik van Havre
bd0c319962 Merge pull request #4536 from hyarion/feature-updatecrowdin-api-v2
[0.20] Tools: updatecrowdin.py rewrite to support new api
2021-04-20 11:51:11 +02:00
wmayer
111a21e45c Base: do not report C++ exception when converting it to Python exception
See https://forum.freecadweb.org/viewtopic.php?f=23&t=56464
2021-04-11 14:54:11 +02:00
Yorik van Havre
62e4c7daf1 Merge branch 'master' into feature-updatecrowdin-api-v2 2021-03-30 13:08:45 +02:00
Chris Hennes
ee6222d216 [Start] Add missing files to translation script 2021-03-10 15:21:40 +01:00
Chris Hennes
6789ddaac9 Fix regex in translation extraction script 2021-03-04 19:18:23 +01:00
Benjamin Nauck
e8566f22bb Tools: Remove super old DistTools module
Back in 2004 the "new" build tools was introduced 2668c74b58
which are located in `src/Tools/fcbt/`. The new tools split up this file
into `src/Tools/fcbt/DistTools.py` and `src/Tools/fcbt/FilesTools.py`
which is why the both `DistTools.py` doesn't match up 1:1.

I've found no references in the repo to the version in `src/Tools/` so
I think it's safe to remove.
2021-03-03 21:53:02 +01:00
Chris Hennes
4b4a6b3580 [Offline Docs] Fix static analysis issues
LGTM identified a number of minor issues (mostly unused imports) in the
offline docs code. This commit addresses those, plus tweaks some output
formatting to include missing spaces, makes a regex more rigorously safe
by escaping some periods, and updates the use of a get() function which
appears to have changed since it was first written.
2021-02-28 17:53:58 +01:00
Chris Hennes
e2bb84fd2f [Tools] Fix static analyis issues
This commit addresses issues identified by LGTM for the various
independent (and mostly-independent) files in the Tools subdirectory.
The vast majority of the issues are trivial, and are things like unused
imports or catching BaseException. There was one true bug identified, a
global variable being changed in a function where it was not marked
global, but it only affected output quantity (the variable is named
"VERBOSE"). A couple of other issues identified variables that appear to
represent no-longer-existing options in the code. The options were left,
but a deprecation printout replaces the variable in the event the option
is provided.
2021-02-28 17:53:04 +01:00
Benjamin Nauck
f5b6c20699 Tools: updatecrowdin.py rewrite to support new api
Crowdin has depreciated their old api and will shut it down completely
in december 2021.

What's new:
 * rewritten in Python 3 (drops support for discontinued Python 2)
 * uses Crowdin's api v2
 * runs on vanilla Python 3, (no external modules)
 * automatically adds new translation from the src directory
 * supports api token to be specified in an environment variable
   (Makes GitHub integration easier in the future)
 * requires project id to be explicitly set with an environment variable
   (Makes testing safer)

The api token can be set either in ~/.crowdin-freecad-token similar to
how the old api key was set, or by specifying it in an environment
variable. The later has been added to make it easier with GitHub-Crowdin
integration in the future.

The requirement to explicitly set CROWDIN_PROJECT_ID has been introduced
to avoid accidentally using the main Crowdin project while testing the
script.

The script has been tested on Python versions 3.7, 3.8 and 3.9.

Co-authored-by: Mattias Pierre <github@mattiaspierre.com>
2021-02-28 12:03:41 +01:00
Chris Hennes
2599d67c2b Clean up various LGTM-flagged items
Static analysis showed some unused variables and imports, and running
the code in Python 3.9 revealed a few invalid escapes (previous versions
of Python silently "fixed" these, so the code change here will not
affect the results).
2021-02-27 18:23:15 +01:00
Yorik van Havre
872a1a3ecc Tools: Added link fix tool to offlinedoc tools 2021-02-22 22:05:51 +01:00
Yorik van Havre
442b1a5db5 Tools: Updated offline doc scripts 2021-02-22 14:07:33 +01:00
Yorik van Havre
354ac48d41 Tools: Updated offline wiki fetching script 2021-02-19 16:41:46 +01:00
Yorik van Havre
97bfc5541e Tools: Detect and use pyside2-lupdate in ts tools 2021-02-12 14:45:41 +01:00
tomate44
5c811d233a fcinfo: support FCBak backup files 2020-12-20 09:59:43 +01:00
tomate44
8719b48e12 fcinfo: support backup files 2020-12-20 09:25:36 +01:00
Mitch Roote
cefd6b2ce0 Update fcinfo script for py3 compatibility 2020-12-15 11:10:40 -05:00
wmayer
6575023f5c Tools: [skip ci] extend doc string of FreeCAD thumbnailer 2020-12-14 11:22:12 +01:00
wmayer
35ad37946f Py3: [skip ci] make FreeCAD thumbnailer working with Py3 by opening PNG icon in binary mode 2020-12-03 16:50:45 +01:00
Rafael Villar Burke
27130f779a Fix thumbnailing
This fixes thumbnailing for XDG desktops. The new script doesn't depend on GNOME libs and works either with python3 or python2.
Also, a thumbnailer config file is added to the installation in CMakeList.txt
2020-11-24 17:47:40 +01:00
Yorik van Havre
c3672f6e1d Tools: Made updatets delete temporary json files 2020-10-28 10:45:44 +01:00
wmayer
da4a2e4ea4 Py3: suppress warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
If the tp_print slot is not set the warning -Wmissing-field-initializers is raised. If it's set then -Wdeprecated-declarations is raised.
So, the only way is to suppress it.
2020-10-15 17:07:39 +02:00
wmayer
bc6fefe3a0 Py3: fix warning: missing field 'tp_print' initializer [-Wmissing-field-initializers]
This warning is only specific to Py3.8. See https://docs.python.org/3/c-api/typeobj.html
2020-10-15 10:35:47 +02:00