Skip to content

Update .config.template.toml fix multiple subreddits regex#1275

Merged
OpenSourceSimon merged 1 commit intoelebumm:developfrom
dasbts:config.template-multiple-subreddits-fix-regex
Oct 2, 2022
Merged

Update .config.template.toml fix multiple subreddits regex#1275
OpenSourceSimon merged 1 commit intoelebumm:developfrom
dasbts:config.template-multiple-subreddits-fix-regex

Conversation

@dasbts
Copy link
Copy Markdown
Contributor

@dasbts dasbts commented Sep 28, 2022

Description

Minor change to the regex to allow multiple subreddits to be used. Previously, it would prompt the user even if multiple subreddits was entered successfully, and only after in the terminal/CMD if the user entered it again, it would work, for that run of main.py. This solves the issue as there was a missing part of the regex.

Issue Fixes

#1193
#1020
Probably more issues too, and we have discussed it in the Discord.

Checklist:

  • I am pushing changes to the develop branch
  • I am using the recommended development environment
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have formatted and linted my code using python-black and pylint
  • I have cleaned up unnecessary files
  • My changes generate no new warnings
  • My changes follow the existing code-style
  • My changes are relevant to the project

Any other information (e.g how to test the changes)

Change the [reddit.thread] config for "subreddit" in .config.template.toml from regex = "[_0-9a-zA-Z]+$" to regex = "[_0-9a-zA-Z\+]+$"

Fixing the regex for allowing multiple subreddits.
@dasbts dasbts changed the title Update .config.template.toml Update .config.template.toml fix multiple subreddits regex Sep 28, 2022
Copy link
Copy Markdown
Collaborator

@OpenSourceSimon OpenSourceSimon left a comment

Choose a reason for hiding this comment

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

Awesome! Looks good to me, @JasonLovesDoggo Can you review it too?

@JasonLovesDoggo
Copy link
Copy Markdown
Collaborator

JasonLovesDoggo commented Sep 28, 2022

Have you tested it? @dasbts

@OpenSourceSimon
Copy link
Copy Markdown
Collaborator

Have you tested it? @dasbts

I tested it in an online regex tester. It should work fine.

@OpenSourceSimon OpenSourceSimon merged commit 82bd71d into elebumm:develop Oct 2, 2022
@gabx03
Copy link
Copy Markdown

gabx03 commented Nov 18, 2022

For anyone that is getting problems on this, you gotta correct this like this: regex = "[_0-9a-zA-Z/+]+$" and not like this: regex = "[_0-9a-zA-Z '' +]+$", because '' is an escape key.

@OpenSourceSimon
Copy link
Copy Markdown
Collaborator

For anyone that is getting problems on this, you gotta correct this like this: regex = "[_0-9a-zA-Z/+]+$" and not like this: regex = "[_0-9a-zA-Z+]+$", because , at least in windows is an escape key.

A lot of people have this problem, can you tell more about this? And maybe open a pull request?

@gabx03
Copy link
Copy Markdown

gabx03 commented Nov 18, 2022

Sure man. user @dasbts said that he corrected the line in .config.template.toml, in [reddit.thread] from regex = "[_0-9a-zA-Z]+$" to regex = "[_0-9a-zA-Z+]+$", but this does not work since the character '' is an escape key, so you have to replace '' in this updated string regex = "[_0-9a-zA-Z+]+$", with '/', like this: regex = "[_0-9a-zA-Z/+]+$". It should work then.

@gabx03
Copy link
Copy Markdown

gabx03 commented Nov 18, 2022

You gotta simply replace the string in [reddit.thread] for "subreddit" in .config.template.toml from regex = "[_0-9a-zA-Z]+$" to regex = "[_0-9a-zA-Z/+]+$", maybe I am clearer.

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.

4 participants