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

Add cache file versioning, distrust cache with different version #33

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

TojikCZ
Copy link
Contributor

@TojikCZ TojikCZ commented Oct 19, 2023

No description provided.

Copy link
Collaborator

@ondratu ondratu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chybí changelog

gcode_metadata/__init__.py Outdated Show resolved Hide resolved
gcode_metadata/metadata.py Outdated Show resolved Hide resolved
gcode_metadata/metadata.py Outdated Show resolved Hide resolved
gcode_metadata/metadata.py Show resolved Hide resolved
gcode_metadata/metadata.py Outdated Show resolved Hide resolved
gcode_metadata/metadata.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@TojikCZ TojikCZ force-pushed the metadata-versioning branch 5 times, most recently from 2e37f6c to fe1b5b1 Compare October 23, 2023 19:20
@TojikCZ TojikCZ changed the title Add metadata versioning, modify setup for easy dependencies Add cache file versioning, distrust cache with different version Oct 23, 2023
@TojikCZ TojikCZ force-pushed the metadata-versioning branch 3 times, most recently from f667943 to c9ad956 Compare October 24, 2023 10:02
@TojikCZ TojikCZ force-pushed the metadata-versioning branch from c9ad956 to 6b98c50 Compare October 24, 2023 10:47
"""Filters out disallowed characters, used with str.filter"""
return char not in "\",\n} "

# This expects the first item in the json file to be the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kdyz ocekáváš že to má být v první line je potřeba v případě nenajití toho stringu procházet celý soubor?

Copy link
Contributor Author

@TojikCZ TojikCZ Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Načítám soubor řádek po řádku, jakmile narazím na jakékoli písmenko abecedy, zjistím, jestli načtené znaky začínají slovem "version", pokud ano, pokračuju parsováním verze z momentálního načteného řádku, co začínal slovem version a další řádky nečtu. Pokud ne, vracím false. Jediný případ kdy bych přečetl celý soubor by nastal, pokud by v něm nebyla písmenka, což se v normálním případě nestane, jen někdo se zlým úmyslem by mi mohl soubor zaplnit pouze speciálnímy znaky a čísly a v takovém případě bych doopravdy četl celý soubor.
Pokud by se celý soubor nacházel na prvním řádku, přečtu ho taky celý, to není ideální, ale dokud s tím nebude problém, nechci špinit kód dalšími checky

@TojikCZ TojikCZ dismissed ondratu’s stale review October 24, 2023 12:08

Updated to reflect the requested changes, reviewer does not have time to re-review this time

@TojikCZ TojikCZ merged commit d4343f8 into master Oct 24, 2023
4 checks passed
@TojikCZ TojikCZ deleted the metadata-versioning branch October 24, 2023 12:14
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.

3 participants