Skip to content

Commit

Permalink
Updated regex for obtaining metadata from path to be more precise
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Zoubek committed Aug 25, 2023
1 parent 3f4c6bd commit 9298fd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gcode_metadata/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ def set_attr(self, name, value):
}

FDM_FILENAME_PAT = re.compile(
r"^(?P<name>.*?)_(?P<height>[0-9.]+)mm_"
r"(?P<material>\w+)_(?P<printer>\w+)_(?P<time>.*)\.")
r"^(?P<name>.*?)_(?P<height>[0-9.]+)mm_(?P<material>[A-Za-z]+)_"
r"(?P<printer>[A-Za-z0-9]+)_(?P<time>[A-Za-z0-9]+)_?\w*.")

METADATA_START_OFFSET = 400000 # Read 400KB from the start
METADATA_END_OFFSET = 40000 # Read 40KB at the end of the file
Expand Down

0 comments on commit 9298fd3

Please sign in to comment.