Skip to content

Ensure default styles file is loaded (#7)#14700

Closed
MisterSeajay wants to merge 1 commit intoAUTOMATIC1111:devfrom
MisterSeajay:dev
Closed

Ensure default styles file is loaded (#7)#14700
MisterSeajay wants to merge 1 commit intoAUTOMATIC1111:devfrom
MisterSeajay:dev

Conversation

@MisterSeajay
Copy link
Copy Markdown
Contributor

@MisterSeajay MisterSeajay commented Jan 19, 2024

Description

  • Sets default style CSV to be "styles.csv" if no default has been loaded (when using wildcard matching for CSV names)
  • Ensures default style file is loaded, to prevent overwriting
  • Moves code to format styles list dividers to helper function
  • Fix for Issue 14681

Checklist:

@AUTOMATIC1111
Copy link
Copy Markdown
Owner

Can't this be solved by just setting the correct self.default_path in the constructor and not changing anything else?

@w-e-w
Copy link
Copy Markdown
Collaborator

w-e-w commented Jan 20, 2024

hold on a bit I was working on an alternative implementation

@w-e-w w-e-w mentioned this pull request Jan 20, 2024
4 tasks
@w-e-w
Copy link
Copy Markdown
Collaborator

w-e-w commented Jan 20, 2024

alternative implementation

@MisterSeajay
Copy link
Copy Markdown
Contributor Author

Can't this be solved by just setting the correct self.default_path in the constructor and not changing anything else?

Yes... except for in an edge case: Here is an example. If I have 3 styles files named "my.csv", "my_anime.csv" and "my_realistic.csv" I would naturally use "my*.csv" in the command line to load these. In this case the default file will be "my.csv" rather than "styles.csv".

If, when loading all files matching the wildcard there hadn't been a "my.csv" file there we do indeed fall back to "styles.csv".

@MisterSeajay
Copy link
Copy Markdown
Contributor Author

alternative implementation

👀

@AUTOMATIC1111
Copy link
Copy Markdown
Owner

Can't this be solved by just setting the correct self.default_path in the constructor and not changing anything else?

Yes... except for in an edge case: Here is an example. If I have 3 styles files named "my.csv", "my_anime.csv" and "my_realistic.csv" I would naturally use "my*.csv" in the command line to load these. In this case the default file will be "my.csv" rather than "styles.csv".

If, when loading all files matching the wildcard there hadn't been a "my.csv" file there we do indeed fall back to "styles.csv".

But can't you do what you described in constructor and set self.default_path correctly?

@MisterSeajay
Copy link
Copy Markdown
Contributor Author

@w-e-w #14707 looks good to me. Ran through my own use-cases and all seems fine.

@w-e-w
Copy link
Copy Markdown
Collaborator

w-e-w commented Jan 22, 2024

@w-e-w #14707 looks good to me. Ran through my own use-cases and all seems fine.

thanks good to hear

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