-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add `.pre-commit-config.yaml` and commit the modifications to respect it. Remove compatibility with Python < 3.8.
- Loading branch information
Gaël Écorchard
committed
Jan 23, 2025
1 parent
920a059
commit 5969cdf
Showing
35 changed files
with
335 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
Thank you for creating a pull request to contribute to FreeCAD-macros! | ||
To integrate your macro please make sure the following steps are complete: | ||
|
||
- [ ] Please check this box if you're not submitting a new macro. | ||
- [ ] Are you submitting a new macro ? | ||
- [ ] Have you followed the ['How to submit a macro'](../README.md#how-to-submit-a-macro) section of the README.md ? | ||
- [ ] Your macro has a [Description](../README.md#macro-description) in its header. | ||
- [ ] Your macro has a [CamelCase name](../README.md#camelcase-macro-name). | ||
- [ ] Your macro is named [appropriately](../README.md#macro-name-specifics). | ||
- [ ] Your macro contains a [Metadata section](../README.md#macro-metadata) that immediately follows the header description. | ||
- [ ] Your macro is Python3/Qt5 compliant and tested on the latest FreeCAD stable and development releases. | ||
- [ ] You're including documentation on how your macro works (bonus: screenshots and/or video on the Wiki) | ||
- [ ] Commit message is [well-written](https://chris.beams.io/posts/git-commit/) | ||
- [ ] Please check this box if you're not submitting a new macro. | ||
- [ ] Are you submitting a new macro ? | ||
- [ ] Have you followed the ['How to submit a macro'](../README.md#how-to-submit-a-macro) section of the README.md ? | ||
- [ ] Your macro has a [Description](../README.md#macro-description) in its header. | ||
- [ ] Your macro has a [CamelCase name](../README.md#camelcase-macro-name). | ||
- [ ] Your macro is named [appropriately](../README.md#macro-name-specifics). | ||
- [ ] Your macro contains a [Metadata section](../README.md#macro-metadata) that immediately follows the header description. | ||
- [ ] Your macro is Python3/Qt5 compliant and tested on the latest FreeCAD stable and development releases. | ||
- [ ] You're including documentation on how your macro works (bonus: screenshots and/or video on the Wiki) | ||
- [ ] Commit message is [well-written](https://chris.beams.io/posts/git-commit/) | ||
- [ ] Commit message is titled in the following way `[MacroName] Short description`. | ||
- [ ] Optional, write or update the changelog in the macro, from latest to oldest. | ||
|
||
And please remember to update the Wiki with the features added or changed once this PR is merged. | ||
And please remember to update the Wiki with the features added or changed once this PR is merged. | ||
**Note**: If you don't have wiki access, then please mention your contribution on the [0.19 Changelog Forum Thread](https://forum.freecadweb.org/viewtopic.php?f=10&t=34586). | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# To use: | ||
# | ||
# pre-commit run -a | ||
# | ||
# Or: | ||
# | ||
# pre-commit install # (runs every time you commit in git) | ||
# | ||
# To update this file: | ||
# | ||
# pre-commit autoupdate | ||
# | ||
# See https://github.com/pre-commit/pre-commit for more information. | ||
# See https://pre-commit.com/hooks.html for more hooks. | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
# - id: check-illegal-windows-names | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-toml | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: destroyed-symlinks | ||
- id: fix-byte-order-marker | ||
- id: forbid-submodules | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.19.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py38-plus] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Objects To Python | ||
Exports existing objects from a FreeCAD project to a python script | ||
|
||
This macro should create clean, human readable python code from already existing FreeCAD objects. | ||
This macro should create clean, human readable python code from already existing FreeCAD objects. | ||
When the generated code is executed, it should create all objects from scratch. | ||
|
||
ATTENTION: It does not work for all objects in FreeCAD. Especially objects created by built in python scripts like everything in the Draft workbench will not work correctly. | ||
ATTENTION: It does not work for all objects in FreeCAD. Especially objects created by built in python scripts like everything in the Draft workbench will not work correctly. | ||
|
||
## How it works | ||
The macro is quite simple. It loops through the properties of all selected objects, compares then to a default object, and generates script lines for object creation and changed properties. For some objects (Sketcher or Spreadsheet objects), special handling in the macro is needed. It may not be complete. | ||
|
||
## Usage | ||
This macro generates python code from all selected objects in a FreeCAD project. | ||
If no object is selected, all objects in the project will be selected. | ||
This macro generates python code from all selected objects in a FreeCAD project. | ||
If no object is selected, all objects in the project will be selected. | ||
|
||
A dialog will open and the output will be written into it. Press CTRL-a and CTRL-c to copy the code. | ||
A dialog will open and the output will be written into it. Press CTRL-a and CTRL-c to copy the code. | ||
|
Oops, something went wrong.