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

Filename format problem with symbol ~ #13

Open
pavolNovak opened this issue Sep 14, 2022 · 5 comments
Open

Filename format problem with symbol ~ #13

pavolNovak opened this issue Sep 14, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@pavolNovak
Copy link

Love the possibility to use custom filename format, but Im missing possibility to pass Wave dash symbol.
Example I put this into filename format :
[object_count]x_[job_name]°[print_time_days]d-t〜PA6-c〜BLACK-m〜PRUSA-0,4.gcode
this is what Im getting:
1x_Shape-Cylinder-30mm°0d-tPA6-cBLACK-mPRUSA-0,4.gcode.gcode
As you see the symbol "〜" or "~" in not present in the gcode filename.

Need it because I use it later in other software for tracking.

Thank you.

@rgomezjnr
Copy link
Owner

Can you try adding the ~ character in line 8 of ParseFilenameFormat.py as follows:

filename = re.sub('[^A-Za-z0-9.,_\-%°$£€#\[\]\(\)\|\+\'\"\~ ]+', '', filename_format)

You can open the Cura configuration folder that contains the GFF+ plugin files by selecting Help -> Show Configuration Folder while Cura is running.

@rgomezjnr rgomezjnr added the enhancement New feature or request label Sep 15, 2022
@rgomezjnr
Copy link
Owner

Hello @pavolNovak were you able to try my suggestion? Did it work for you?

@pavolNovak
Copy link
Author

Hello @rgomezjnr , your solution worked flawlessly and now Im able to fully use it. Thank you.

@fskelly
Copy link

fskelly commented Oct 11, 2022

Would it be possible to show me how to add / - Needed as part of my folder structure.
/[machine_nozzle_size]/[machine_nozzle_size]mm-[abbr_machine]-[base_name]-[material]-[infill_sparse_density]%infill-[material_print_temperature]C-[material_bed_temperature]C

This removes "/" and becomes
[machine_nozzle_size][machine_nozzle_size]mm-[abbr_machine]-[base_name]-[material]-[infill_sparse_density]%infill-[material_print_temperature]C-[material_bed_temperature]C

Can you please help, love this plugin!

@rgomezjnr
Copy link
Owner

Try this:

filename = re.sub('[^A-Za-z0-9.,_\-%°$£€#\[\]\(\)\|\+\'\"\~\/ ]+', '', filename_format)

What OS are you using? Characters like / and ~ can be invalid filename characters depending on OS and filesystem type, and are best usually avoided, which is why I'm hesitant to implement these changes in GFF+. I could add checks for the OS type to allow different characters, but that is more maintenance, and I'd rather keep the codebase cross-platform since Cura is cross-platform.

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

No branches or pull requests

3 participants