Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Update metadata.py to work with Ideamaker #740

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

Manu512
Copy link
Contributor

@Manu512 Manu512 commented Nov 3, 2023

metadata : fix extract to work with Ideamaker

Correction of the regex (Replacing the = with one: and adding the filament index for the regex to work)
Correction du regex (Remplacement du = par un : et ajout de l'index du filament pour que le regex fonctionne)

Signed-off-by: Emmanuel WALDNER [email protected]

Correction of the regex (Replacing the = with one:
and adding the filament index for the regex to work)
Correction du regex (Remplacement du = par un :
et ajout de l'index du filament pour que le regex fonctionne)
@Arksine
Copy link
Owner

Arksine commented Nov 5, 2023

Thanks. Presumably IdeaMaker now officially supports this metadata, whereas previously it was necessary for the user to add it in their start gcode. I'm ok with the corrections, however I'm not sure that Moonraker should drop support for the legacy entries immediately. We could do something like the following:

def parse_filament_type(self) -> Optional[str]:
    return (
        _regex_find_string(r";Filament\sName\s.\d:\s(.*)", self.header_data) or
        _regex_find_string(r";Filament\stype\s=\s(.*)", self.header_data)
    )

The above would prefer the new style, then fallback to the legacy expression if it isn't found. We could modify the expression to handle either case, however doing it this way will make it easier to remove the deprecated expression the future.

@Arksine Arksine merged commit 975011d into Arksine:master Nov 7, 2023
1 check passed
@Arksine
Copy link
Owner

Arksine commented Nov 7, 2023

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants